Author: fireball Date: Mon Dec 10 00:49:17 2007 New Revision: 31114
URL: http://svn.reactos.org/svn/reactos?rev=31114&view=rev Log: - Start filling out ARC component data nodes for all the new refactored hardware node APIs (these are just dummies for now).
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 Mon Dec 10 00:49:17 2007 @@ -275,7 +275,12 @@ DbgPrint((DPRINT_HWDETECT, "Estimated buffer size %u\n", NodeSize * NodeCount));
/* Create component key */ - FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, &BusKey); + FldrCreateComponentKey(SystemKey, + L"MultifunctionAdapter", + *BusNumber, + AdapterClass, + MultiFunctionAdapter, + &BusKey); (*BusNumber)++;
/* Set the component information */ @@ -605,6 +610,8 @@ FldrCreateComponentKey(BusKey, L"DiskController\0\DiskPeripheral", i, + PeripheralClass, + DiskPeripheral, &DiskKey);
/* Set disk values */ @@ -681,6 +688,8 @@ FldrCreateComponentKey(ControllerKey, L"FloppyDiskPeripheral", FloppyNumber, + PeripheralClass, + FloppyDiskPeripheral, &PeripheralKey);
/* Set 'ComponentInformation' value */ @@ -754,6 +763,8 @@ FldrCreateComponentKey(SystemKey, L"DiskController", 0, + ControllerClass, + DiskController, &ControllerKey); DbgPrint((DPRINT_HWDETECT, "Created key: DiskController\0\n"));
@@ -1130,6 +1141,8 @@ FldrCreateComponentKey(ControllerKey, L"PointerPeripheral", 0, + PeripheralClass, + PointerPeripheral, &PeripheralKey); DbgPrint((DPRINT_HWDETECT, "Created key: PointerPeripheral\0\n")); @@ -1193,6 +1206,8 @@ FldrCreateComponentKey(BusKey, L"SerialController", ControllerNumber, + ControllerClass, + SerialController, &ControllerKey);
/* Set 'ComponentInformation' value */ @@ -1305,6 +1320,8 @@ FldrCreateComponentKey(BusKey, L"ParallelController", ControllerNumber, + ControllerClass, + ParallelController, &ControllerKey);
/* Set 'ComponentInformation' value */ @@ -1460,6 +1477,8 @@ FldrCreateComponentKey(ControllerKey, L"KeyboardPeripheral", 0, + PeripheralClass, + KeyboardPeripheral, &PeripheralKey); DbgPrint((DPRINT_HWDETECT, "Created key: KeyboardPeripheral\0\n"));
@@ -1522,6 +1541,8 @@ FldrCreateComponentKey(BusKey, L"KeyboardController", 0, + ControllerClass, + KeyboardController, &ControllerKey); DbgPrint((DPRINT_HWDETECT, "Created key: KeyboardController\0\n"));
@@ -1709,6 +1730,8 @@ FldrCreateComponentKey(BusKey, L"PointerController", 0, + ControllerClass, + PointerController, &ControllerKey); DbgPrint((DPRINT_HWDETECT, "Created key: PointerController\0\n"));
@@ -1746,8 +1769,10 @@
/* Create peripheral key */ FldrCreateComponentKey(ControllerKey, - L"PointerController", + L"PointerPeripheral", 0, + ControllerClass, + PointerPeripheral, &PeripheralKey); DbgPrint((DPRINT_HWDETECT, "Created key: PointerPeripheral\0\n"));
@@ -1788,6 +1813,8 @@ FldrCreateComponentKey(BusKey, L"DisplayController", 0, + ControllerClass, + DisplayController, &ControllerKey); DbgPrint((DPRINT_HWDETECT, "Created key: DisplayController\0\n"));
@@ -1842,6 +1869,8 @@ FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, + AdapterClass, + MultiFunctionAdapter, &BusKey);
/* Set 'Component Information' value similar to my NT4 box */
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 Mon Dec 10 00:49:17 2007 @@ -61,6 +61,8 @@ FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, + AdapterClass, + MultiFunctionAdapter, &BiosKey);
#if 0
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 Mon Dec 10 00:49:17 2007 @@ -64,6 +64,8 @@ FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, + AdapterClass, + MultiFunctionAdapter, &BiosKey);
#if 0
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 Mon Dec 10 00:49:17 2007 @@ -156,6 +156,8 @@ FldrCreateComponentKey(BusKey, L"RealModeIrqRoutingTable", 0, + SystemClass, + RealModeIrqRoutingTable, &TableKey);
/* Set 'Component Information' */ @@ -228,6 +230,8 @@ FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, + AdapterClass, + MultiFunctionAdapter, &BiosKey);
/* Set 'Component Information' */ @@ -283,6 +287,8 @@ FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, + AdapterClass, + MultiFunctionAdapter, &BiosKey);
/* Set 'Component Information' */
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 Mon Dec 10 00:49:17 2007 @@ -59,6 +59,8 @@ IN FRLDRHKEY SystemKey, IN PWCHAR BusName, IN ULONG BusNumber, + IN CONFIGURATION_CLASS Class, + IN CONFIGURATION_TYPE Type, OUT FRLDRHKEY *ComponentKey );
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 Mon Dec 10 00:49:17 2007 @@ -12,6 +12,67 @@ #define NDEBUG #include <debug.h>
+/* GLOBALS ********************************************************************/ + +PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot; +ULONG FldrBusTypeCount[MaximumType + 1] = {0}; +const PWCHAR FldrBusTypeString[MaximumType + 1] = +{ + L"System", + L"CentralProcessor", + L"FloatingPointProcessor", + L"PrimaryICache", + L"PrimaryDCache", + L"SecondaryICache", + L"SecondaryDCache", + L"SecondaryCache", + L"EisaAdapter", + L"TcAdapter", + L"ScsiAdapter", + L"DtiAdapter", + L"MultifunctionAdapter", + L"DiskController", + L"TapeController", + L"CdRomController", + L"WormController", + L"SerialController", + L"NetworkController", + L"DisplayController", + L"ParallelController", + L"PointerController", + L"KeyboardController", + L"AudioController", + L"OtherController", + L"DiskPeripheral", + L"FloppyDiskPeripheral", + L"TapePeripheral", + L"ModemPeripheral", + L"MonitorPeripheral", + L"PrinterPeripheral", + L"PointerPeripheral", + L"KeyboardPeripheral", + L"TerminalPeripheral", + L"OtherPeripheral", + L"LinePeripheral", + L"NetworkPeripheral", + L"SystemMemory", + L"DockingInformation", + L"RealModeIrqRoutingTable", + L"RealModePCIEnumeration", + L"Undefined" +}; +const PWCHAR FldrClassString[MaximumClass + 1] = +{ + L"System", + L"Processor", + L"Cache", + L"Adapter", + L"Controller", + L"Peripheral", + L"MemoryClass", + L"Undefined" +}; + /* FUNCTIONS ******************************************************************/
VOID @@ -21,21 +82,23 @@ IN ULONG Key, IN ULONG Affinity) { - CONFIGURATION_COMPONENT ConfigurationComponent; - LONG Error; - - /* Build the component information */ - ConfigurationComponent.Flags = Flags; - ConfigurationComponent.Version = 0; - ConfigurationComponent.Revision = 0; - ConfigurationComponent.Key = Key; - ConfigurationComponent.AffinityMask = Affinity; + LONG Error; + CONFIGURATION_COMPONENT_DATA Data = {0}; // This would be "ComponentKey" + PCONFIGURATION_COMPONENT_DATA ComponentData = &Data; + PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; + + /* Set component information */ + Component->Flags = Flags; + Component->Version = 0; + Component->Revision = 0; + Component->Key = Key; + Component->AffinityMask = Affinity;
/* Set the value */ Error = RegSetValue(ComponentKey, L"Component Information", REG_BINARY, - (PVOID)&ConfigurationComponent.Flags, + (PVOID)&Component->Flags, FIELD_OFFSET(CONFIGURATION_COMPONENT, ConfigurationDataLength) - FIELD_OFFSET(CONFIGURATION_COMPONENT, Flags)); if (Error != ERROR_SUCCESS) @@ -51,7 +114,14 @@ { LONG Error; ULONG IdentifierLength = (wcslen(Identifier) + 1) * sizeof(WCHAR); - + CONFIGURATION_COMPONENT_DATA Data = {0}; // This would be "ComponentKey" + PCONFIGURATION_COMPONENT_DATA ComponentData = &Data; + PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; + + /* Set component information */ + Component->IdentifierLength = IdentifierLength; + Component->Identifier = (PCHAR)Identifier; // We need to use ASCII instead + /* Set the key */ Error = RegSetValue(ComponentKey, L"Identifier", @@ -70,6 +140,22 @@ FldrCreateSystemKey(OUT FRLDRHKEY *SystemKey) { LONG Error; + PCONFIGURATION_COMPONENT Component; + + /* Allocate the root */ + FldrArcHwTreeRoot = MmAllocateMemory(sizeof(CONFIGURATION_COMPONENT_DATA)); + if (!FldrArcHwTreeRoot) return; + + /* Set it up */ + Component = &FldrArcHwTreeRoot->ComponentEntry; + Component->Class = SystemClass; + Component->Type = MaximumType; + Component->Version = 0; + Component->Key = 0; + Component->AffinityMask = 0; + Component->ConfigurationDataLength = 0; + Component->Identifier = 0; + Component->IdentifierLength = 0;
/* Create the key */ Error = RegCreateKey(NULL, @@ -79,7 +165,7 @@ { DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", Error)); return; - } + } }
VOID @@ -87,10 +173,42 @@ FldrCreateComponentKey(IN FRLDRHKEY SystemKey, IN PWCHAR BusName, IN ULONG BusNumber, + IN CONFIGURATION_CLASS Class, + IN CONFIGURATION_TYPE Type, OUT FRLDRHKEY *ComponentKey) { LONG Error; WCHAR Buffer[80]; + CONFIGURATION_COMPONENT_DATA Root = {0}; // This would be "SystemKey" + PCONFIGURATION_COMPONENT_DATA SystemNode = &Root; + PCONFIGURATION_COMPONENT_DATA ComponentData; + PCONFIGURATION_COMPONENT Component; + + /* Allocate the node for this component */ + ComponentData = MmAllocateMemory(sizeof(CONFIGURATION_COMPONENT_DATA)); + if (!ComponentData) return; + + /* Now save our parent */ + ComponentData->Parent = SystemNode; + + /* Now we need to figure out if the parent already has a child entry */ + if (SystemNode->Child) + { + /* It does, so we'll be a sibling of the child instead */ + SystemNode->Child->Sibling = ComponentData; + } + else + { + /* It doesn't, so we will be the first child */ + SystemNode->Child = ComponentData; + } + + /* Set us up (need to use class/type instead of name/number) */ + Component = &FldrArcHwTreeRoot->ComponentEntry; + Component->Class = Class; + Component->Type = Type; + + /* FIXME: Use Class/Type to build key name */
/* Build the key name */ swprintf(Buffer, L"%s\%u", BusName, BusNumber); @@ -111,6 +229,13 @@ IN ULONG Size) { LONG Error; + CONFIGURATION_COMPONENT_DATA Data = {0}; // This would be "ComponentKey" + PCONFIGURATION_COMPONENT_DATA ComponentData = &Data; + PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry; + + /* Set component information */ + ComponentData->ConfigurationData = ConfigurationData; + Component->ConfigurationDataLength = Size;
/* Set 'Configuration Data' value */ Error = RegSetValue(ComponentKey,