Author: fireball Date: Sun Dec 16 13:04:04 2007 New Revision: 31274
URL: http://svn.reactos.org/svn/reactos?rev=31274&view=rev Log: - ARC hardware device tree passed to the kernel contains only partial descriptors (contents of full descriptors was ignored anyway).
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c Sun Dec 16 13:04:04 2007 @@ -198,7 +198,7 @@ static VOID DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PNP_BIOS_DEVICE_NODE DeviceNode; PCM_PNP_BIOS_INSTALLATION_CHECK InstData; PCONFIGURATION_COMPONENT_DATA BusKey; @@ -255,28 +255,26 @@ FldrSetIdentifier(BusKey, L"PNP BIOS");
/* Set 'Configuration Data' value */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + (NodeSize * NodeCount); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount); + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); return; } - memset(FullResourceDescriptor, 0, Size); + memset(PartialResourceList, 0, Size);
/* Initialize resource descriptor */ - FullResourceDescriptor->InterfaceType = Internal; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 1; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Type = + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].ShareDisposition = + PartialResourceList->PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined;
- Ptr = (char *)(((ULONG_PTR)&FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]) + + Ptr = (char *)(((ULONG_PTR)&PartialResourceList->PartialDescriptors[0]) + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
/* Set instalation check data */ @@ -315,15 +313,15 @@ }
/* Set real data size */ - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].u.DeviceSpecificData.DataSize = + PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = PnpBufferSize; - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + PnpBufferSize; + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSize;
DbgPrint((DPRINT_HWDETECT, "Real buffer size: %u\n", PnpBufferSize)); DbgPrint((DPRINT_HWDETECT, "Resource size: %u\n", Size));
- FldrSetConfigurationData(BusKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(BusKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList); }
@@ -332,38 +330,36 @@ SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey, ULONG DriveNumber) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry; EXTENDED_GEOMETRY ExtGeometry; GEOMETRY Geometry; ULONG Size;
/* Set 'Configuration Data' value */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_DISK_GEOMETRY_DEVICE_DATA); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate a full resource descriptor\n")); return; }
- memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 1; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Type = + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific; -// FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].ShareDisposition = -// FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Flags = - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].u.DeviceSpecificData.DataSize = +// PartialResourceList->PartialDescriptors[0].ShareDisposition = +// PartialResourceList->PartialDescriptors[0].Flags = + PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
/* Get pointer to geometry data */ - DiskGeometry = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); + DiskGeometry = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
/* Get the disk geometry */ ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY); @@ -384,7 +380,7 @@ else { DbgPrint((DPRINT_HWDETECT, "Reading disk geometry failed\n")); - MmFreeMemory(FullResourceDescriptor); + MmFreeMemory(PartialResourceList); return; } DbgPrint((DPRINT_HWDETECT, @@ -395,8 +391,8 @@ DiskGeometry->SectorsPerTrack, DiskGeometry->BytesPerSector));
- FldrSetConfigurationData(DiskKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(DiskKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList); }
@@ -512,7 +508,7 @@ static VOID DetectBiosFloppyPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCM_FLOPPY_DEVICE_DATA FloppyData; WCHAR Identifier[20]; @@ -547,29 +543,27 @@ FloppyNumber, 0xFFFFFFFF);
- Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_FLOPPY_DEVICE_DATA); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); return; }
- memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 1; - - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypeDeviceSpecific; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_FLOPPY_DEVICE_DATA);
- FloppyData = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); + FloppyData = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); FloppyData->Version = 2; FloppyData->Revision = 0; FloppyData->MaxDensity = MaxDensity[FloppyType]; @@ -581,8 +575,8 @@ FloppyData->DataTransferRate = 0;
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
/* Set 'Identifier' value */ swprintf(Identifier, L"FLOPPY%u", FloppyNumber + 1); @@ -595,7 +589,7 @@ DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey, PCONFIGURATION_COMPONENT_DATA ControllerKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; ULONG Size; ULONG FloppyCount; @@ -605,26 +599,24 @@ "Floppy count: %u\n", FloppyCount));
- Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); return; } - memset(FullResourceDescriptor, 0, Size); + memset(PartialResourceList, 0, Size);
/* Initialize resource descriptor */ - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 3; + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 3;
/* Set IO Port */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypePort; PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; @@ -633,7 +625,7 @@ PartialDescriptor->u.Port.Length = 8;
/* Set Interrupt */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[1]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; PartialDescriptor->Type = CmResourceTypeInterrupt; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; @@ -642,7 +634,7 @@ PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set DMA channel */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[2]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[2]; PartialDescriptor->Type = CmResourceTypeDma; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->Flags = 0; @@ -650,8 +642,8 @@ PartialDescriptor->u.Dma.Port = 0;
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
if (FloppyCount) DetectBiosFloppyPeripheral(ControllerKey); } @@ -660,7 +652,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, PCONFIGURATION_COMPONENT_DATA BusKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_INT13_DRIVE_PARAMETER Int13Drives; GEOMETRY Geometry; PCONFIGURATION_COMPONENT_DATA DiskKey, ControllerKey; @@ -716,10 +708,10 @@ DetectBiosFloppyController(BusKey, ControllerKey);
/* Allocate resource descriptor */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount; - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -727,20 +719,18 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = InterfaceTypeUndefined; - FullResourceDescriptor->BusNumber = -1; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 1; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].ShareDisposition = 0; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].Flags = 0; - FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].u.DeviceSpecificData.DataSize = + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeDeviceSpecific; + PartialResourceList->PartialDescriptors[0].ShareDisposition = 0; + PartialResourceList->PartialDescriptors[0].Flags = 0; + PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize = sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
/* Get harddisk Int13 geometry data */ - Int13Drives = (PVOID)(((ULONG_PTR)FullResourceDescriptor) + sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); + Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST)); for (i = 0; i < DiskCount; i++) { if (MachDiskGetDriveGeometry(0x80 + i, &Geometry)) @@ -762,8 +752,8 @@ }
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(SystemKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(SystemKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
/* Create and fill subkey for each harddisk */ for (i = 0; i < DiskCount; i++) @@ -964,7 +954,7 @@ DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, ULONG Base) { - CM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; char Buffer[256]; WCHAR Identifier[256]; PCONFIGURATION_COMPONENT_DATA PeripheralKey; @@ -1116,16 +1106,14 @@ 0xFFFFFFFF);
/* Set 'Configuration Data' value */ - memset(&FullResourceDescriptor, 0, sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); - FullResourceDescriptor.InterfaceType = Isa; - FullResourceDescriptor.BusNumber = 0; - FullResourceDescriptor.PartialResourceList.Version = 1; - FullResourceDescriptor.PartialResourceList.Revision = 1; - FullResourceDescriptor.PartialResourceList.Count = 0; + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 1; + PartialResourceList.Revision = 1; + PartialResourceList.Count = 0;
FldrSetConfigurationData(PeripheralKey, - &FullResourceDescriptor, - sizeof(CM_FULL_RESOURCE_DESCRIPTOR) - + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
/* Set 'Identifier' value */ @@ -1137,7 +1125,7 @@ static VOID DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCM_SERIAL_DEVICE_DATA SerialDeviceData; ULONG Irq[4] = {4, 3, 4, 3}; @@ -1179,27 +1167,25 @@ 0xFFFFFFFF);
/* Build full device descriptor */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + sizeof(CM_SERIAL_DEVICE_DATA); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); continue; } - memset(FullResourceDescriptor, 0, Size); + memset(PartialResourceList, 0, Size);
/* Initialize resource descriptor */ - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 3; + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 3;
/* Set IO Port */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypePort; PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; @@ -1208,7 +1194,7 @@ PartialDescriptor->u.Port.Length = 7;
/* Set Interrupt */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[1]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; PartialDescriptor->Type = CmResourceTypeInterrupt; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; @@ -1217,20 +1203,20 @@ PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set serial data (device specific) */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[2]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[2]; PartialDescriptor->Type = CmResourceTypeDeviceSpecific; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->Flags = 0; PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_SERIAL_DEVICE_DATA);
SerialDeviceData = - (PCM_SERIAL_DEVICE_DATA)&FullResourceDescriptor->PartialResourceList.PartialDescriptors[3]; + (PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3]; SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); - + FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList); + /* Set 'Identifier' value */ swprintf(Buffer, L"COM%u", i + 1); FldrSetIdentifier(ControllerKey, Buffer); @@ -1252,7 +1238,7 @@ static VOID DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; ULONG Irq[3] = {7, 5, (ULONG)-1}; WCHAR Buffer[80]; @@ -1293,28 +1279,26 @@ 0xFFFFFFFF);
/* Build full device descriptor */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR); + Size = sizeof(CM_PARTIAL_RESOURCE_LIST); if (Irq[i] != (ULONG)-1) Size += sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
- FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); continue; } - memset(FullResourceDescriptor, 0, Size); + memset(PartialResourceList, 0, Size);
/* Initialize resource descriptor */ - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = (Irq[i] != (ULONG)-1) ? 2 : 1; + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = (Irq[i] != (ULONG)-1) ? 2 : 1;
/* Set IO Port */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypePort; PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; @@ -1325,7 +1309,7 @@ /* Set Interrupt */ if (Irq[i] != (ULONG)-1) { - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[1]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; PartialDescriptor->Type = CmResourceTypeInterrupt; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; @@ -1335,8 +1319,8 @@ }
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
/* Set 'Identifier' value */ swprintf(Buffer, L"PARALLEL%u", i + 1); @@ -1426,7 +1410,7 @@ static VOID DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCM_KEYBOARD_DEVICE_DATA KeyboardData; PCONFIGURATION_COMPONENT_DATA PeripheralKey; @@ -1451,10 +1435,10 @@ 0xFFFFFFFF);
/* Set 'Configuration Data' value */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_KEYBOARD_DEVICE_DATA); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -1462,14 +1446,12 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 1; - - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypeDeviceSpecific; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_KEYBOARD_DEVICE_DATA); @@ -1482,8 +1464,8 @@ KeyboardData->KeyboardFlags = 0x20;
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(PeripheralKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
/* Set 'Identifier' value */ FldrSetIdentifier(PeripheralKey, L"PCAT_ENHANCED"); @@ -1494,7 +1476,7 @@ static VOID DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCONFIGURATION_COMPONENT_DATA ControllerKey; ULONG Size; @@ -1515,10 +1497,10 @@ 0xFFFFFFFF);
/* Set 'Configuration Data' value */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -1526,15 +1508,13 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 3; + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 3;
/* Set Interrupt */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypeInterrupt; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED; @@ -1543,7 +1523,7 @@ PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set IO Port 0x60 */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[1]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; PartialDescriptor->Type = CmResourceTypePort; PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; @@ -1552,7 +1532,7 @@ PartialDescriptor->u.Port.Length = 1;
/* Set IO Port 0x64 */ - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[2]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[2]; PartialDescriptor->Type = CmResourceTypePort; PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; PartialDescriptor->Flags = CM_RESOURCE_PORT_IO; @@ -1561,8 +1541,8 @@ PartialDescriptor->u.Port.Length = 1;
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(ControllerKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
DetectKeyboardPeripheral(ControllerKey); } @@ -1680,7 +1660,7 @@ static VOID DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey) { - CM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + CM_PARTIAL_RESOURCE_LIST PartialResourceList; PCONFIGURATION_COMPONENT_DATA ControllerKey; PCONFIGURATION_COMPONENT_DATA PeripheralKey;
@@ -1703,27 +1683,25 @@ 0, 0xFFFFFFFF);
- memset(&FullResourceDescriptor, 0, sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
/* Initialize resource descriptor */ - FullResourceDescriptor.InterfaceType = Isa; - FullResourceDescriptor.BusNumber = 0; - FullResourceDescriptor.PartialResourceList.Version = 1; - FullResourceDescriptor.PartialResourceList.Revision = 1; - FullResourceDescriptor.PartialResourceList.Count = 1; + PartialResourceList.Version = 1; + PartialResourceList.Revision = 1; + PartialResourceList.Count = 1;
/* Set Interrupt */ - FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeInterrupt; - FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined; - FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED; - FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = 12; - FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0; - FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF; + PartialResourceList.PartialDescriptors[0].Type = CmResourceTypeInterrupt; + PartialResourceList.PartialDescriptors[0].ShareDisposition = CmResourceShareUndetermined; + PartialResourceList.PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED; + PartialResourceList.PartialDescriptors[0].u.Interrupt.Level = 12; + PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0; + PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set 'Configuration Data' value */ FldrSetConfigurationData(ControllerKey, - &FullResourceDescriptor, - sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST));
if (DetectPS2AuxDevice()) { @@ -1745,17 +1723,15 @@ 0xFFFFFFFF);
/* Initialize resource descriptor */ - memset(&FullResourceDescriptor, 0, sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); - FullResourceDescriptor.InterfaceType = Isa; - FullResourceDescriptor.BusNumber = 0; - FullResourceDescriptor.PartialResourceList.Version = 1; - FullResourceDescriptor.PartialResourceList.Revision = 1; - FullResourceDescriptor.PartialResourceList.Count = 0; + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 1; + PartialResourceList.Revision = 1; + PartialResourceList.Count = 0;
/* Set 'Configuration Data' value */ FldrSetConfigurationData(PeripheralKey, - &FullResourceDescriptor, - sizeof(CM_FULL_RESOURCE_DESCRIPTOR) - + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
/* Set 'Identifier' value */ @@ -1823,7 +1799,7 @@ static VOID DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCONFIGURATION_COMPONENT_DATA BusKey; ULONG Size;
@@ -1848,10 +1824,10 @@ FldrSetIdentifier(BusKey, L"ISA");
/* Set 'Configuration Data' value */ - Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) - + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -1859,16 +1835,14 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Isa; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 0; + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 0;
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(BusKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
/* Detect ISA/BIOS devices */ DetectBiosDisks(SystemKey, BusKey);
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c Sun Dec 16 13:04:04 2007 @@ -52,7 +52,7 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) { PCONFIGURATION_COMPONENT_DATA BiosKey; - CM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + CM_PARTIAL_RESOURCE_LIST PartialResourceList;
if (FindAcpiBios()) { @@ -73,15 +73,13 @@ 0xFFFFFFFF);
/* Set 'Configuration Data' value */ - memset(&FullResourceDescriptor, 0, sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); - FullResourceDescriptor.InterfaceType = Internal; - FullResourceDescriptor.BusNumber = *BusNumber; - FullResourceDescriptor.PartialResourceList.Version = 0; - FullResourceDescriptor.PartialResourceList.Revision = 0; - FullResourceDescriptor.PartialResourceList.Count = 0; + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 0; + PartialResourceList.Revision = 0; + PartialResourceList.Count = 0; FldrSetConfigurationData(BiosKey, - &FullResourceDescriptor, - sizeof(CM_FULL_RESOURCE_DESCRIPTOR) - + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
/* Increment bus number */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c Sun Dec 16 13:04:04 2007 @@ -57,7 +57,7 @@ DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) { PCONFIGURATION_COMPONENT_DATA BiosKey; - CM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + CM_PARTIAL_RESOURCE_LIST PartialResourceList;
if (FindApmBios()) { @@ -74,27 +74,25 @@ 0x0, 0x0, 0xFFFFFFFF); - + /* Set 'Configuration Data' value */ - memset(&FullResourceDescriptor, 0, sizeof(CM_FULL_RESOURCE_DESCRIPTOR)); - FullResourceDescriptor.InterfaceType = Internal; - FullResourceDescriptor.BusNumber = *BusNumber; - FullResourceDescriptor.PartialResourceList.Version = 0; - FullResourceDescriptor.PartialResourceList.Revision = 0; - FullResourceDescriptor.PartialResourceList.Count = 0; + memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST)); + PartialResourceList.Version = 0; + PartialResourceList.Revision = 0; + PartialResourceList.Count = 0; FldrSetConfigurationData(BiosKey, - &FullResourceDescriptor, - sizeof(CM_FULL_RESOURCE_DESCRIPTOR) - + &PartialResourceList, + sizeof(CM_PARTIAL_RESOURCE_LIST) - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - + /* Increment bus number */ (*BusNumber)++; - + /* Set 'Identifier' value */ FldrSetIdentifier(BiosKey, L"APM"); } - - /* FIXME: Add congiguration data */ + + /* FIXME: Add configuration data */ }
/* EOF */
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/i... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c (original) +++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c Sun Dec 16 13:04:04 2007 @@ -143,7 +143,7 @@ static VOID DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PPCI_IRQ_ROUTING_TABLE Table; PCONFIGURATION_COMPONENT_DATA TableKey; @@ -171,42 +171,39 @@ FldrSetIdentifier(TableKey, L"PCI Real-mode IRQ Routing Table");
/* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) + - 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size; - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) - { - DbgPrint((DPRINT_HWDETECT, - "Failed to allocate resource descriptor\n")); - return; - } + Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) + + 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size; + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) + { + DbgPrint((DPRINT_HWDETECT, + "Failed to allocate resource descriptor\n")); + return; + }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Internal; - FullResourceDescriptor->BusNumber = 0; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 2; - - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 2; + + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypeBusNumber; PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive; PartialDescriptor->u.BusNumber.Start = 0; PartialDescriptor->u.BusNumber.Length = 1;
- PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[1]; + PartialDescriptor = &PartialResourceList->PartialDescriptors[1]; PartialDescriptor->Type = CmResourceTypeDeviceSpecific; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->u.DeviceSpecificData.DataSize = Table->Size;
- memcpy(&FullResourceDescriptor->PartialResourceList.PartialDescriptors[2], - Table, - Table->Size); + memcpy(&PartialResourceList->PartialDescriptors[2], + Table, Table->Size);
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(TableKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(TableKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList); } }
@@ -214,7 +211,7 @@ VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) { - PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor; + PCM_PARTIAL_RESOURCE_LIST PartialResourceList; PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor; PCI_REGISTRY_INFO BusData; PCONFIGURATION_COMPONENT_DATA BiosKey; @@ -247,10 +244,10 @@ FldrSetIdentifier(BiosKey, L"PCI BIOS");
/* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, - PartialResourceList.PartialDescriptors); - FullResourceDescriptor = MmAllocateMemory(Size); - if (FullResourceDescriptor == NULL) + Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, + PartialDescriptors); + PartialResourceList = MmAllocateMemory(Size); + if (PartialResourceList == NULL) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -258,13 +255,11 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = Internal; - FullResourceDescriptor->BusNumber = 0; + memset(PartialResourceList, 0, Size);
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(BiosKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(BiosKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList);
DetectPciIrqRoutingTable(BiosKey);
@@ -289,12 +284,12 @@ if (i == 0) { /* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, - PartialResourceList.PartialDescriptors) + + Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, + PartialDescriptors) + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + sizeof(PCI_REGISTRY_INFO); - FullResourceDescriptor = MmAllocateMemory(Size); - if (!FullResourceDescriptor) + PartialResourceList = MmAllocateMemory(Size); + if (!PartialResourceList) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -302,31 +297,29 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = PCIBus; - FullResourceDescriptor->BusNumber = i; - FullResourceDescriptor->PartialResourceList.Version = 1; - FullResourceDescriptor->PartialResourceList.Revision = 1; - FullResourceDescriptor->PartialResourceList.Count = 1; - PartialDescriptor = &FullResourceDescriptor->PartialResourceList.PartialDescriptors[0]; + memset(PartialResourceList, 0, Size); + PartialResourceList->Version = 1; + PartialResourceList->Revision = 1; + PartialResourceList->Count = 1; + PartialDescriptor = &PartialResourceList->PartialDescriptors[0]; PartialDescriptor->Type = CmResourceTypeDeviceSpecific; PartialDescriptor->ShareDisposition = CmResourceShareUndetermined; PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(PCI_REGISTRY_INFO); - memcpy(&FullResourceDescriptor->PartialResourceList.PartialDescriptors[1], + memcpy(&PartialResourceList->PartialDescriptors[1], &BusData, sizeof(PCI_REGISTRY_INFO));
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(BusKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList); } else { /* Set 'Configuration Data' value */ - Size = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, - PartialResourceList.PartialDescriptors); - FullResourceDescriptor = MmAllocateMemory(Size); - if (!FullResourceDescriptor) + Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, + PartialDescriptors); + PartialResourceList = MmAllocateMemory(Size); + if (!PartialResourceList) { DbgPrint((DPRINT_HWDETECT, "Failed to allocate resource descriptor\n")); @@ -334,13 +327,11 @@ }
/* Initialize resource descriptor */ - memset(FullResourceDescriptor, 0, Size); - FullResourceDescriptor->InterfaceType = PCIBus; - FullResourceDescriptor->BusNumber = i; + memset(PartialResourceList, 0, Size);
/* Set 'Configuration Data' value */ - FldrSetConfigurationData(BusKey, FullResourceDescriptor, Size); - MmFreeMemory(FullResourceDescriptor); + FldrSetConfigurationData(BusKey, PartialResourceList, Size); + MmFreeMemory(PartialResourceList); }
/* Increment bus number */
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/includ... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h (original) +++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h Sun Dec 16 13:04:04 2007 @@ -75,7 +75,7 @@ NTAPI FldrSetConfigurationData( IN PCONFIGURATION_COMPONENT_DATA ComponentKey, - IN PCM_FULL_RESOURCE_DESCRIPTOR ConfigurationData, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size );
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/reacto... ============================================================================== --- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c (original) +++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c Sun Dec 16 13:04:04 2007 @@ -167,7 +167,7 @@ VOID NTAPI FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData, - IN PCM_FULL_RESOURCE_DESCRIPTOR Data, + IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size) { PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; @@ -178,11 +178,9 @@ if (!ConfigurationData) return;
/* Copy component information */ - RtlCopyMemory(ConfigurationData, &Data->PartialResourceList.Version, Size); - + RtlCopyMemory(ConfigurationData, ResourceList, Size); + /* Set component information */ ComponentData->ConfigurationData = ConfigurationData; - Component->ConfigurationDataLength = Size - - FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, - PartialResourceList); + Component->ConfigurationDataLength = Size; }