Author: hpoussin
Date: Mon Jun 4 14:01:29 2007
New Revision: 26992
URL:
http://svn.reactos.org/svn/reactos?rev=26992&view=rev
Log:
Add a bus number to the PCI resource descriptor
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c Mon Jun 4 14:01:29 2007
@@ -182,8 +182,8 @@
}
/* Set 'Configuration Data' value */
- Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) +
- Table->Size;
+ Size = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR,
PartialResourceList.PartialDescriptors) +
+ 2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->Size;
FullResourceDescriptor = MmAllocateMemory(Size);
if (FullResourceDescriptor == NULL)
{
@@ -196,14 +196,22 @@
memset(FullResourceDescriptor, 0, Size);
FullResourceDescriptor->InterfaceType = Isa;
FullResourceDescriptor->BusNumber = 0;
- FullResourceDescriptor->PartialResourceList.Count = 1;
+ FullResourceDescriptor->PartialResourceList.Version = 1;
+ FullResourceDescriptor->PartialResourceList.Revision = 1;
+ FullResourceDescriptor->PartialResourceList.Count = 2;
PartialDescriptor =
&FullResourceDescriptor->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->Type = CmResourceTypeDeviceSpecific;
PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
PartialDescriptor->u.DeviceSpecificData.DataSize = Table->Size;
- memcpy((PVOID)((ULONG_PTR)FullResourceDescriptor +
sizeof(CM_FULL_RESOURCE_DESCRIPTOR)),
+ memcpy(&FullResourceDescriptor->PartialResourceList.PartialDescriptors[2],
Table,
Table->Size);