Merge FldrCreateComponentKey and FldrSetComponentInformation

Remove unneeded parameters in FldrCreateComponentKey

svn path=/trunk/; revision=42543
This commit is contained in:
Hervé Poussineau 2009-08-09 07:45:41 +00:00
parent bfe9c97ce3
commit d7ca524325
14 changed files with 91 additions and 264 deletions

View file

@ -102,14 +102,6 @@ ArmHwDetect(VOID)
//
FldrCreateSystemKey(&RootNode);
//
// Write null component information
//
FldrSetComponentInformation(RootNode,
0x0,
0x0,
0xFFFFFFFF);
//
// TODO:
// There's no such thing as "PnP" on embedded hardware.

View file

@ -238,19 +238,14 @@ DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
/* Create component key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BusKey);
(*BusNumber)++;
/* Set the component information */
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
/* Set the identifier */
FldrSetIdentifier(BusKey, "PNP BIOS");
@ -649,18 +644,13 @@ DetectBiosFloppyPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
Ptr = GetInt1eTable();
FldrCreateComponentKey(ControllerKey,
L"FloppyDiskPeripheral",
FloppyNumber,
PeripheralClass,
FloppyDiskPeripheral,
Input | Output,
FloppyNumber,
0xFFFFFFFF,
&PeripheralKey);
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(PeripheralKey,
Input | Output,
FloppyNumber,
0xFFFFFFFF);
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_FLOPPY_DEVICE_DATA);
PartialResourceList = MmHeapAlloc(Size);
@ -811,19 +801,14 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
(int)DiskCount, (DiskCount == 1) ? "": "s");
FldrCreateComponentKey(BusKey,
L"DiskController",
0,
ControllerClass,
DiskController,
Output | Input | Removable,
0x0,
0xFFFFFFFF,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
Output | Input | Removable,
0,
0xFFFFFFFF);
DetectBiosFloppyController(BusKey, ControllerKey);
/* Allocate resource descriptor */
@ -882,18 +867,13 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
{
/* Create disk key */
FldrCreateComponentKey(ControllerKey,
L"DiskPeripheral",
i,
PeripheralClass,
DiskPeripheral,
Output | Input,
0x0,
0xFFFFFFFF,
&DiskKey);
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(DiskKey,
Output | Input,
0,
0xFFFFFFFF);
/* Set disk values */
SetHarddiskConfigurationData(DiskKey, 0x80 + i);
SetHarddiskIdentifier(DiskKey, 0x80 + i);
@ -1224,20 +1204,15 @@ DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey,
/* Create 'PointerPeripheral' key */
FldrCreateComponentKey(ControllerKey,
L"PointerPeripheral",
0,
PeripheralClass,
PointerPeripheral,
Input,
0x0,
0xFFFFFFFF,
&PeripheralKey);
DPRINTM(DPRINT_HWDETECT,
"Created key: PointerPeripheral\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(PeripheralKey,
Input,
0,
0xFFFFFFFF);
/* Set 'Configuration Data' value */
memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
PartialResourceList.Version = 1;
@ -1287,18 +1262,13 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
/* Create controller key */
FldrCreateComponentKey(BusKey,
L"SerialController",
ControllerNumber,
ControllerClass,
SerialController,
Output | Input | ConsoleIn | ConsoleOut,
ControllerNumber,
0xFFFFFFFF,
&ControllerKey);
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
Output | Input | ConsoleIn | ConsoleOut,
ControllerNumber,
0xFFFFFFFF);
/* Build full device descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
@ -1399,18 +1369,13 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
/* Create controller key */
FldrCreateComponentKey(BusKey,
L"ParallelController",
ControllerNumber,
ControllerClass,
ParallelController,
Output,
ControllerNumber,
0xFFFFFFFF,
&ControllerKey);
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
Output,
ControllerNumber,
0xFFFFFFFF);
/* Build full device descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST);
if (Irq[i] != (ULONG)-1)
@ -1554,19 +1519,14 @@ DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
{
/* Create controller key */
FldrCreateComponentKey(ControllerKey,
L"KeyboardPeripheral",
0,
PeripheralClass,
KeyboardPeripheral,
Input | ConsoleIn,
0x0,
0xFFFFFFFF,
&PeripheralKey);
DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(PeripheralKey,
Input | ConsoleIn,
0,
0xFFFFFFFF);
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_KEYBOARD_DEVICE_DATA);
@ -1616,19 +1576,14 @@ DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
/* Create controller key */
FldrCreateComponentKey(BusKey,
L"KeyboardController",
0,
ControllerClass,
KeyboardController,
Input | ConsoleIn,
0x0,
0xFFFFFFFF,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
Input | ConsoleIn,
0,
0xFFFFFFFF);
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
@ -1803,19 +1758,14 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
/* Create controller key */
FldrCreateComponentKey(BusKey,
L"PointerController",
0,
ControllerClass,
PointerController,
Input,
0x0,
0xFFFFFFFF,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: PointerController\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
Input,
0,
0xFFFFFFFF);
memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
/* Initialize resource descriptor */
@ -1842,19 +1792,14 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
/* Create peripheral key */
FldrCreateComponentKey(ControllerKey,
L"PointerPeripheral",
0,
ControllerClass,
PointerPeripheral,
Input,
0x0,
0xFFFFFFFF,
&PeripheralKey);
DPRINTM(DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(PeripheralKey,
Input,
0,
0xFFFFFFFF);
/* Initialize resource descriptor */
memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
PartialResourceList.Version = 1;
@ -1882,19 +1827,14 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
USHORT VesaVersion;
FldrCreateComponentKey(BusKey,
L"DisplayController",
0,
ControllerClass,
DisplayController,
0x0,
0x0,
0xFFFFFFFF,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DisplayController\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
0x00,
0,
0xFFFFFFFF);
/* FIXME: Set 'ComponentInformation' value */
VesaVersion = BiosIsVesaSupported();
@ -1938,18 +1878,13 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
/* Create new bus key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BusKey);
/* Set 'Component Information' value similar to my NT4 box */
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
/* Increment bus number */
(*BusNumber)++;
@ -2004,12 +1939,6 @@ PcHwDetect(VOID)
/* Create the 'System' key */
FldrCreateSystemKey(&SystemKey);
/* Set empty component information */
FldrSetComponentInformation(SystemKey,
0x0,
0x0,
0xFFFFFFFF);
/* Detect buses */
DetectPciBios(SystemKey, &BusNumber);

View file

@ -69,18 +69,13 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
/* Create new bus key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BiosKey);
/* Set 'Component Information' */
FldrSetComponentInformation(BiosKey,
0x0,
0x0,
0xFFFFFFFF);
/* Get BIOS memory map */
RtlZeroMemory(BiosMemoryMap, sizeof(BIOS_MEMORY_MAP) * 32);
BiosMemoryMapEntryCount = PcMemGetMemoryMap(BiosMemoryMap,

View file

@ -63,18 +63,13 @@ DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
{
/* Create new bus key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BiosKey);
/* Set 'Component Information' */
FldrSetComponentInformation(BiosKey,
0x0,
0x0,
0xFFFFFFFF);
/* Set 'Configuration Data' value */
memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
PartialResourceList.Version = 0;

View file

@ -155,18 +155,13 @@ DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
DPRINTM(DPRINT_HWDETECT, "Table size: %u\n", Table->Size);
FldrCreateComponentKey(BusKey,
L"RealModeIrqRoutingTable",
0,
PeripheralClass,
RealModeIrqRoutingTable,
0x0,
0x0,
0xFFFFFFFF,
&TableKey);
/* Set 'Component Information' */
FldrSetComponentInformation(TableKey,
0x0,
0x0,
0xFFFFFFFF);
/* Set 'Identifier' value */
FldrSetIdentifier(TableKey, "PCI Real-mode IRQ Routing Table");
@ -225,18 +220,13 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
{
/* Create new bus key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BiosKey);
/* Set 'Component Information' */
FldrSetComponentInformation(BiosKey,
0x0,
0x0,
0xFFFFFFFF);
/* Increment bus number */
(*BusNumber)++;
@ -268,18 +258,13 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
{
/* Create the bus key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BusKey);
/* Set 'Component Information' */
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
/* Check if this is the first bus */
if (i == 0)
{

View file

@ -207,19 +207,14 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
(int)DiskCount, (DiskCount == 1) ? "": "s");
FldrCreateComponentKey(BusKey,
L"DiskController",
0,
ControllerClass,
DiskController,
Output | Input | Removable,
0,
0xFFFFFFFF,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(ControllerKey,
Output | Input | Removable,
0,
0xFFFFFFFF);
//DetectBiosFloppyController(BusKey, ControllerKey);
/* Allocate resource descriptor */
@ -275,18 +270,13 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
{
/* Create disk key */
FldrCreateComponentKey(ControllerKey,
L"DiskPeripheral",
i,
PeripheralClass,
DiskPeripheral,
Output | Input,
0,
0xFFFFFFFF,
&DiskKey);
/* Set 'ComponentInformation' value */
FldrSetComponentInformation(DiskKey,
Output | Input,
0,
0xFFFFFFFF);
/* Set disk values */
SetHarddiskConfigurationData(DiskKey, 0x80 + i);
SetHarddiskIdentifier(DiskKey, 0x80 + i);
@ -302,18 +292,13 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
/* Create new bus key */
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
AdapterClass,
MultiFunctionAdapter,
0x0,
0x0,
0xFFFFFFFF,
&BusKey);
/* Set 'Component Information' value similar to my NT4 box */
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
/* Increment bus number */
(*BusNumber)++;
@ -360,12 +345,6 @@ XboxHwDetect(VOID)
/* Create the 'System' key */
FldrCreateSystemKey(&SystemKey);
/* Set empty component information */
FldrSetComponentInformation(SystemKey,
0x0,
0x0,
0xFFFFFFFF);
/* TODO: Build actual xbox's hardware configuration tree */
DetectIsaBios(SystemKey, &BusNumber);

View file

@ -388,14 +388,13 @@ VOID OfwCopyDeviceTree
/* Create a key for this device */
FldrCreateComponentKey
(ParentKey,
wide_name,
0,
AdapterClass,
MultiFunctionAdapter,
0,
0,
(ULONG)-1,
&NewKey);
FldrSetComponentInformation(NewKey, 0, 0, (ULONG)-1);
/* Add properties */
for (prev_name = ""; ofw_nextprop(node, prev_name, cur_name) == 1; )
{
@ -452,8 +451,6 @@ PCONFIGURATION_COMPONENT_DATA PpcHwDetect() {
FldrCreateSystemKey(&RootKey);
FldrSetComponentInformation(RootKey, 0, 0, (ULONG)-1);
OfwCopyDeviceTree(RootKey,"/",node,&BusNumber,&DiskController,&DiskNumber);
return RootKey;
}

View file

@ -114,12 +114,6 @@ PCONFIGURATION_COMPONENT_DATA PpcPrepHwDetect() {
/* Create the 'System' key */
FldrCreateSystemKey(&SystemKey);
/* Set empty component information */
FldrSetComponentInformation(SystemKey,
0x0,
0x0,
0xFFFFFFFF);
printf("DetectHardware() Done\n");
return SystemKey;
}

View file

@ -11,6 +11,10 @@
<compilerflag>-fno-inline</compilerflag>
<compilerflag>-fno-zero-initialized-in-bss</compilerflag>
</group>
<directory name="arcemul">
<file>component.c</file>
<file>time.c</file>
</directory>
<directory name="cache">
<file>blocklist.c</file>
<file>cache.c</file>

View file

@ -38,15 +38,6 @@
//
// ARC Component Configuration Routines
//
VOID
NTAPI
FldrSetComponentInformation(
IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity
);
VOID
NTAPI
FldrSetIdentifier(
@ -64,10 +55,11 @@ VOID
NTAPI
FldrCreateComponentKey(
IN PCONFIGURATION_COMPONENT_DATA SystemKey,
IN PWCHAR BusName,
IN ULONG BusNumber,
IN CONFIGURATION_CLASS Class,
IN CONFIGURATION_TYPE Type,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);

View file

@ -58,15 +58,6 @@ typedef struct _ARM_BOARD_CONFIGURATION_BLOCK
//
// ARC Component Configuration Routines
//
VOID
NTAPI
FldrSetComponentInformation(
IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity
);
VOID
NTAPI
FldrSetIdentifier(
@ -83,11 +74,12 @@ FldrCreateSystemKey(
VOID
NTAPI
FldrCreateComponentKey(
IN PCONFIGURATION_COMPONENT_DATA SystemKey,
IN PWCHAR BusName,
IN ULONG BusNumber,
IN PCONFIGURATION_COMPONENT_DATA SystemKey,,
IN CONFIGURATION_CLASS Class,
IN CONFIGURATION_TYPE Type,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);

View file

@ -38,15 +38,6 @@
//
// ARC Component Configuration Routines
//
VOID
NTAPI
FldrSetComponentInformation(
IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity
);
VOID
NTAPI
FldrSetIdentifier(
@ -64,10 +55,11 @@ VOID
NTAPI
FldrCreateComponentKey(
IN PCONFIGURATION_COMPONENT_DATA SystemKey,
IN PWCHAR BusName,
IN ULONG BusNumber,
IN CONFIGURATION_CLASS Class,
IN CONFIGURATION_TYPE Type,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);

View file

@ -37,15 +37,6 @@
//
// ARC Component Configuration Routines
//
VOID
NTAPI
FldrSetComponentInformation(
IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity
);
VOID
NTAPI
FldrSetIdentifier(
@ -63,10 +54,11 @@ VOID
NTAPI
FldrCreateComponentKey(
IN PCONFIGURATION_COMPONENT_DATA SystemKey,
IN PWCHAR BusName,
IN ULONG BusNumber,
IN CONFIGURATION_CLASS Class,
IN CONFIGURATION_TYPE Type,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);

View file

@ -51,23 +51,6 @@ FldrpHwHeapAlloc(IN ULONG Size)
return Buffer;
}
VOID
NTAPI
FldrSetComponentInformation(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity)
{
PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry;
/* Set component information */
Component->Flags = Flags;
Component->Version = 0;
Component->Revision = 0;
Component->Key = Key;
Component->AffinityMask = Affinity;
}
VOID
NTAPI
FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
@ -107,6 +90,11 @@ FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
Component->ConfigurationDataLength = 0;
Component->Identifier = 0;
Component->IdentifierLength = 0;
Component->Flags = 0;
Component->Version = 0;
Component->Revision = 0;
Component->Key = 0;
Component->AffinityMask = 0xFFFFFFFF;
/* Return the node */
*SystemNode = FldrArcHwTreeRoot;
@ -145,10 +133,11 @@ FldrLinkToParent(IN PCONFIGURATION_COMPONENT_DATA Parent,
VOID
NTAPI
FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode,
IN PWCHAR BusName,
IN ULONG BusNumber,
IN CONFIGURATION_CLASS Class,
IN CONFIGURATION_TYPE Type,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
{
PCONFIGURATION_COMPONENT_DATA ComponentData;