Author: hpoussin
Date: Sun Aug 9 10:11:52 2009
New Revision: 42544
URL:
http://svn.reactos.org/svn/reactos?rev=42544&view=rev
Log:
Merge FldrCreateComponentKey and FldrSetIdentifier
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/arch/i386/xboxhw.c
trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h
trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h
trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/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/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c [iso-8859-1] Sun Aug 9
10:11:52 2009
@@ -243,11 +243,9 @@
0x0,
0x0,
0xFFFFFFFF,
+ "PNP BIOS",
&BusKey);
(*BusNumber)++;
-
- /* Set the identifier */
- FldrSetIdentifier(BusKey, "PNP BIOS");
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount);
@@ -492,7 +490,7 @@
};
static VOID
-SetHarddiskIdentifier(PCONFIGURATION_COMPONENT_DATA DiskKey,
+GetHarddiskIdentifier(PCHAR Identifier,
ULONG DriveNumber)
{
PMASTER_BOOT_RECORD Mbr;
@@ -500,7 +498,6 @@
ULONG i;
ULONG Checksum;
ULONG Signature;
- CHAR Identifier[20];
CHAR ArcName[256];
PARTITION_TABLE_ENTRY PartitionTableEntry;
@@ -574,9 +571,6 @@
Identifier[18] = 'A';
Identifier[19] = 0;
DPRINTM(DPRINT_HWDETECT, "Identifier: %s\n", Identifier);
-
- /* Set identifier */
- FldrSetIdentifier(DiskKey, Identifier);
}
static ULONG
@@ -642,13 +636,17 @@
DiskResetController(FloppyNumber);
Ptr = GetInt1eTable();
-
+
+ /* Set 'Identifier' value */
+ sprintf(Identifier, "FLOPPY%ld", FloppyNumber + 1);
+
FldrCreateComponentKey(ControllerKey,
PeripheralClass,
FloppyDiskPeripheral,
Input | Output,
FloppyNumber,
0xFFFFFFFF,
+ Identifier,
&PeripheralKey);
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
@@ -685,10 +683,6 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size);
MmHeapFree(PartialResourceList);
-
- /* Set 'Identifier' value */
- sprintf(Identifier, "FLOPPY%ld", FloppyNumber + 1);
- FldrSetIdentifier(PeripheralKey, Identifier);
}
}
@@ -806,6 +800,7 @@
Output | Input | Removable,
0x0,
0xFFFFFFFF,
+ NULL,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
@@ -865,6 +860,11 @@
/* Create and fill subkey for each harddisk */
for (i = 0; i < DiskCount; i++)
{
+ CHAR Identifier[20];
+
+ /* Get disk values */
+ GetHarddiskIdentifier(Identifier, 0x80 + i);
+
/* Create disk key */
FldrCreateComponentKey(ControllerKey,
PeripheralClass,
@@ -872,11 +872,11 @@
Output | Input,
0x0,
0xFFFFFFFF,
+ Identifier,
&DiskKey);
/* Set disk values */
SetHarddiskConfigurationData(DiskKey, 0x80 + i);
- SetHarddiskIdentifier(DiskKey, 0x80 + i);
}
/* Get the drive we're booting from */
@@ -1209,6 +1209,7 @@
Input,
0x0,
0xFFFFFFFF,
+ Identifier,
&PeripheralKey);
DPRINTM(DPRINT_HWDETECT,
"Created key: PointerPeripheral\\0\n");
@@ -1223,9 +1224,6 @@
&PartialResourceList,
sizeof(CM_PARTIAL_RESOURCE_LIST) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(PeripheralKey, Identifier);
}
}
@@ -1260,6 +1258,9 @@
i + 1,
Base);
+ /* Set 'Identifier' value */
+ sprintf(Buffer, "COM%ld", i + 1);
+
/* Create controller key */
FldrCreateComponentKey(BusKey,
ControllerClass,
@@ -1267,6 +1268,7 @@
Output | Input | ConsoleIn | ConsoleOut,
ControllerNumber,
0xFFFFFFFF,
+ Buffer,
&ControllerKey);
/* Build full device descriptor */
@@ -1320,13 +1322,6 @@
FldrSetConfigurationData(ControllerKey, PartialResourceList, Size);
MmHeapFree(PartialResourceList);
- /* Set 'Identifier' value */
- sprintf(Buffer, "COM%ld", i + 1);
- FldrSetIdentifier(ControllerKey, Buffer);
- DPRINTM(DPRINT_HWDETECT,
- "Created value: Identifier %s\n",
- Buffer);
-
if (!Rs232PortInUse(Base))
{
/* Detect serial mouse */
@@ -1367,6 +1362,9 @@
ControllerNumber,
Base);
+ /* Set 'Identifier' value */
+ sprintf(Buffer, "PARALLEL%ld", i + 1);
+
/* Create controller key */
FldrCreateComponentKey(BusKey,
ControllerClass,
@@ -1374,6 +1372,7 @@
Output,
ControllerNumber,
0xFFFFFFFF,
+ Buffer,
&ControllerKey);
/* Build full device descriptor */
@@ -1420,13 +1419,6 @@
FldrSetConfigurationData(ControllerKey, PartialResourceList, Size);
MmHeapFree(PartialResourceList);
- /* Set 'Identifier' value */
- sprintf(Buffer, "PARALLEL%ld", i + 1);
- FldrSetIdentifier(ControllerKey, Buffer);
- DPRINTM(DPRINT_HWDETECT,
- "Created value: Identifier %s\n",
- Buffer);
-
ControllerNumber++;
}
@@ -1524,6 +1516,7 @@
Input | ConsoleIn,
0x0,
0xFFFFFFFF,
+ "PCAT_ENHANCED",
&PeripheralKey);
DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n");
@@ -1559,9 +1552,6 @@
/* Set 'Configuration Data' value */
FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size);
MmHeapFree(PartialResourceList);
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(PeripheralKey, "PCAT_ENHANCED");
}
}
@@ -1581,6 +1571,7 @@
Input | ConsoleIn,
0x0,
0xFFFFFFFF,
+ NULL,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n");
@@ -1763,6 +1754,7 @@
Input,
0x0,
0xFFFFFFFF,
+ NULL,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: PointerController\\0\n");
@@ -1797,6 +1789,7 @@
Input,
0x0,
0xFFFFFFFF,
+ "MICROSOFT PS2 MOUSE",
&PeripheralKey);
DPRINTM(DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n");
@@ -1811,9 +1804,6 @@
&PartialResourceList,
sizeof(CM_PARTIAL_RESOURCE_LIST) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(PeripheralKey, "MICROSOFT PS2 MOUSE");
}
}
}
@@ -1825,6 +1815,33 @@
CHAR Buffer[80];
PCONFIGURATION_COMPONENT_DATA ControllerKey;
USHORT VesaVersion;
+
+ /* FIXME: Set 'ComponentInformation' value */
+
+ VesaVersion = BiosIsVesaSupported();
+ if (VesaVersion != 0)
+ {
+ DPRINTM(DPRINT_HWDETECT,
+ "VESA version %c.%c\n",
+ (VesaVersion >> 8) + '0',
+ (VesaVersion & 0xFF) + '0');
+ }
+ else
+ {
+ DPRINTM(DPRINT_HWDETECT,
+ "VESA not supported\n");
+ }
+
+ if (VesaVersion >= 0x0200)
+ {
+ strcpy(Buffer,
+ "VBE Display");
+ }
+ else
+ {
+ strcpy(Buffer,
+ "VGA Display");
+ }
FldrCreateComponentKey(BusKey,
ControllerClass,
@@ -1832,38 +1849,9 @@
0x0,
0x0,
0xFFFFFFFF,
+ Buffer,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DisplayController\\0\n");
-
- /* FIXME: Set 'ComponentInformation' value */
-
- VesaVersion = BiosIsVesaSupported();
- if (VesaVersion != 0)
- {
- DPRINTM(DPRINT_HWDETECT,
- "VESA version %c.%c\n",
- (VesaVersion >> 8) + '0',
- (VesaVersion & 0xFF) + '0');
- }
- else
- {
- DPRINTM(DPRINT_HWDETECT,
- "VESA not supported\n");
- }
-
- if (VesaVersion >= 0x0200)
- {
- strcpy(Buffer,
- "VBE Display");
- }
- else
- {
- strcpy(Buffer,
- "VGA Display");
- }
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(ControllerKey, Buffer);
/* FIXME: Add display peripheral (monitor) data */
}
@@ -1883,13 +1871,11 @@
0x0,
0x0,
0xFFFFFFFF,
+ "ISA",
&BusKey);
/* Increment bus number */
(*BusNumber)++;
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(BusKey, "ISA");
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwacpi.c [iso-8859-1] Sun Aug 9 10:11:52
2009
@@ -74,6 +74,7 @@
0x0,
0x0,
0xFFFFFFFF,
+ "ACPI BIOS",
&BiosKey);
/* Get BIOS memory map */
@@ -116,8 +117,6 @@
/* Increment bus number */
(*BusNumber)++;
- /* Set 'Identifier' value */
- FldrSetIdentifier(BiosKey, "ACPI BIOS");
MmHeapFree(PartialResourceList);
}
}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwapm.c [iso-8859-1] Sun Aug 9 10:11:52
2009
@@ -68,6 +68,7 @@
0x0,
0x0,
0xFFFFFFFF,
+ "APM",
&BiosKey);
/* Set 'Configuration Data' value */
@@ -82,9 +83,6 @@
/* Increment bus number */
(*BusNumber)++;
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(BiosKey, "APM");
}
/* FIXME: Add configuration data */
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 [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c [iso-8859-1] Sun Aug 9 10:11:52
2009
@@ -160,10 +160,8 @@
0x0,
0x0,
0xFFFFFFFF,
+ "PCI Real-mode IRQ Routing Table",
&TableKey);
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(TableKey, "PCI Real-mode IRQ Routing Table");
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
@@ -213,7 +211,6 @@
ULONG Size;
PCONFIGURATION_COMPONENT_DATA BusKey;
ULONG i;
- CHAR szPci[] = "PCI";
/* Report the PCI BIOS */
if (FindPciBios(&BusData))
@@ -225,13 +222,11 @@
0x0,
0x0,
0xFFFFFFFF,
+ "PCI BIOS"
&BiosKey);
/* Increment bus number */
(*BusNumber)++;
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(BiosKey, "PCI BIOS");
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST,
@@ -263,6 +258,7 @@
0x0,
0x0,
0xFFFFFFFF,
+ "PCI",
&BusKey);
/* Check if this is the first bus */
@@ -321,9 +317,6 @@
/* Increment bus number */
(*BusNumber)++;
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(BusKey, szPci);
}
}
}
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c [iso-8859-1] Sun Aug 9 10:11:52
2009
@@ -94,7 +94,7 @@
static VOID
-SetHarddiskIdentifier(PCONFIGURATION_COMPONENT_DATA DiskKey,
+GetHarddiskIdentifier(PCHAR Identifier,
ULONG DriveNumber)
{
PMASTER_BOOT_RECORD Mbr;
@@ -158,9 +158,6 @@
Identifier[18] = 'A';
Identifier[19] = 0;
DPRINTM(DPRINT_HWDETECT, "Identifier: %s\n", Identifier);
-
- /* Set identifier */
- FldrSetIdentifier(DiskKey, Identifier);
}
static VOID
@@ -212,6 +209,7 @@
Output | Input | Removable,
0,
0xFFFFFFFF,
+ NULL,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
@@ -268,6 +266,11 @@
/* Create and fill subkey for each harddisk */
for (i = 0; i < DiskCount; i++)
{
+ CHAR Identifier[20];
+
+ /* Get disk values */
+ GetHarddiskIdentifier(Identifier, 0x80 + i);
+
/* Create disk key */
FldrCreateComponentKey(ControllerKey,
PeripheralClass,
@@ -275,11 +278,11 @@
Output | Input,
0,
0xFFFFFFFF,
+ Identifier,
&DiskKey);
/* Set disk values */
SetHarddiskConfigurationData(DiskKey, 0x80 + i);
- SetHarddiskIdentifier(DiskKey, 0x80 + i);
}
}
@@ -297,13 +300,11 @@
0x0,
0x0,
0xFFFFFFFF,
+ "ISA",
&BusKey);
/* Increment bus number */
(*BusNumber)++;
-
- /* Set 'Identifier' value */
- FldrSetIdentifier(BusKey, "ISA");
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
Modified: trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c [iso-8859-1] Sun Aug 9
10:11:52 2009
@@ -393,6 +393,7 @@
0,
0,
(ULONG)-1,
+ NULL,
&NewKey);
/* Add properties */
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h [iso-8859-1]
(original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/amd64/hardware.h [iso-8859-1] Sun Aug
9 10:11:52 2009
@@ -40,13 +40,6 @@
//
VOID
NTAPI
-FldrSetIdentifier(
- IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
- IN PCHAR Identifier
-);
-
-VOID
-NTAPI
FldrCreateSystemKey(
OUT PCONFIGURATION_COMPONENT_DATA *SystemKey
);
@@ -60,6 +53,7 @@
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
+ IN PCHAR IdentifierString,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h [iso-8859-1]
(original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/arm/hardware.h [iso-8859-1] Sun Aug 9
10:11:52 2009
@@ -60,13 +60,6 @@
//
VOID
NTAPI
-FldrSetIdentifier(
- IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
- IN PCHAR Identifier
-);
-
-VOID
-NTAPI
FldrCreateSystemKey(
OUT PCONFIGURATION_COMPONENT_DATA *SystemKey
);
@@ -80,6 +73,7 @@
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
+ IN PCHAR IdentifierString,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h [iso-8859-1]
(original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h [iso-8859-1] Sun Aug
9 10:11:52 2009
@@ -40,13 +40,6 @@
//
VOID
NTAPI
-FldrSetIdentifier(
- IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
- IN PCHAR Identifier
-);
-
-VOID
-NTAPI
FldrCreateSystemKey(
OUT PCONFIGURATION_COMPONENT_DATA *SystemKey
);
@@ -60,6 +53,7 @@
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
+ IN PCHAR IdentifierString,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h [iso-8859-1]
(original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/powerpc/hardware.h [iso-8859-1] Sun
Aug 9 10:11:52 2009
@@ -39,13 +39,6 @@
//
VOID
NTAPI
-FldrSetIdentifier(
- IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
- IN PCHAR Identifier
-);
-
-VOID
-NTAPI
FldrCreateSystemKey(
OUT PCONFIGURATION_COMPONENT_DATA *SystemKey
);
@@ -59,6 +52,7 @@
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
+ IN PCHAR IdentifierString,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
);
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c [iso-8859-1] Sun Aug 9 10:11:52
2009
@@ -138,6 +138,7 @@
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity,
+ IN PCHAR IdentifierString,
OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
{
PCONFIGURATION_COMPONENT_DATA ComponentData;
@@ -157,6 +158,13 @@
Component = &ComponentData->ComponentEntry;
Component->Class = Class;
Component->Type = Type;
+ Component->Flags = Flags;
+ Component->Key = Key;
+ Component->Affinity = Affinity;
+
+ /* Set identifier */
+ if (Identifier)
+ FldrSetIdentifier(ComponentData, Identifier);
/* Return the child */
*ComponentKey = ComponentData;