From 6fd43506eb33e6aa1caa2ad8fc374afcd6edbb62 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 25 Jan 2008 12:22:51 +0000 Subject: [PATCH] - Make HwDetect routine return a pointer to the root of a configuration tree (instead of directly referencing a global variable). svn path=/trunk/; revision=31987 --- reactos/boot/freeldr/freeldr/arch/i386/hardware.c | 4 +++- reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c | 3 ++- reactos/boot/freeldr/freeldr/arch/powerpc/mach.c | 3 ++- reactos/boot/freeldr/freeldr/arch/powerpc/prep.c | 3 ++- reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h | 2 +- reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h | 2 +- reactos/boot/freeldr/freeldr/include/machine.h | 2 +- reactos/boot/freeldr/freeldr/reactos/reactos.c | 3 +-- reactos/boot/freeldr/freeldr/reactos/setupldr.c | 3 +-- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c index 829975a2925..60c7d0365b1 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/hardware.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/hardware.c @@ -1861,7 +1861,7 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) } -VOID +PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID) { PCONFIGURATION_COMPONENT_DATA SystemKey; @@ -1886,6 +1886,8 @@ PcHwDetect(VOID) DetectAcpiBios(SystemKey, &BusNumber); DbgPrint((DPRINT_HWDETECT, "DetectHardware() Done\n")); + + return SystemKey; } /* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c b/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c index 91092ebd81f..3df71f8bc31 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c +++ b/reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c @@ -349,7 +349,7 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber) /* FIXME: Detect more ISA devices */ } -VOID +PCONFIGURATION_COMPONENT_DATA XboxHwDetect(VOID) { PCONFIGURATION_COMPONENT_DATA SystemKey; @@ -370,6 +370,7 @@ XboxHwDetect(VOID) DetectIsaBios(SystemKey, &BusNumber); DbgPrint((DPRINT_HWDETECT, "DetectHardware() Done\n")); + return SystemKey; } /* EOF */ diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c index 45d7da0aae5..37f6adbd422 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c @@ -446,7 +446,7 @@ VOID OfwCopyDeviceTree } } -VOID PpcHwDetect() { +PCONFIGURATION_COMPONENT_DATA PpcHwDetect() { PCONFIGURATION_COMPONENT_DATA RootKey; ULONG BusNumber = 0, DiskController = 0, DiskNumber = 0; int node = ofw_finddevice("/"); @@ -456,6 +456,7 @@ VOID PpcHwDetect() { FldrSetComponentInformation(RootKey, 0, 0, (ULONG)-1); OfwCopyDeviceTree(RootKey,"/",node,&BusNumber,&DiskController,&DiskNumber); + return RootKey; } BOOLEAN PpcDiskNormalizeSystemPath(char *SystemPath, unsigned Size) { diff --git a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c index ba30ab2e99c..b4c3fff3631 100644 --- a/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c +++ b/reactos/boot/freeldr/freeldr/arch/powerpc/prep.c @@ -108,7 +108,7 @@ ULONG PpcPrepGetMemoryMap( PBIOS_MEMORY_MAP BiosMemoryMap, /* Most PReP hardware is in standard locations, based on the corresponding * hardware on PCs. */ -VOID PpcPrepHwDetect() { +PCONFIGURATION_COMPONENT_DATA PpcPrepHwDetect() { PCONFIGURATION_COMPONENT_DATA SystemKey; /* Create the 'System' key */ @@ -121,6 +121,7 @@ VOID PpcPrepHwDetect() { 0xFFFFFFFF); printf("DetectHardware() Done\n"); + return SystemKey; } void PpcPrepInit() diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h b/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h index c6d43074314..d8aa96e1c77 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h +++ b/reactos/boot/freeldr/freeldr/include/arch/i386/machpc.h @@ -55,7 +55,7 @@ ULONG PcDiskGetCacheableBlockCount(ULONG DriveNumber); VOID PcRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second); -VOID PcHwDetect(VOID); +PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID); #endif /* __I386_MACHPC_H_ */ diff --git a/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h b/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h index 3eabbe71d81..3911711364b 100644 --- a/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h +++ b/reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h @@ -58,7 +58,7 @@ ULONG XboxDiskGetCacheableBlockCount(ULONG DriveNumber); VOID XboxRTCGetCurrentDateTime(PULONG Year, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second); -VOID XboxHwDetect(VOID); +PCONFIGURATION_COMPONENT_DATA XboxHwDetect(VOID); VOID XboxSetLED(PCSTR Pattern); diff --git a/reactos/boot/freeldr/freeldr/include/machine.h b/reactos/boot/freeldr/freeldr/include/machine.h index 5b0cf460d97..7fb03fab247 100644 --- a/reactos/boot/freeldr/freeldr/include/machine.h +++ b/reactos/boot/freeldr/freeldr/include/machine.h @@ -69,7 +69,7 @@ typedef struct tagMACHVTBL VOID (*RTCGetCurrentDateTime)(PULONG Year, PULONG Month, PULONG Day, PULONG Hour, PULONG Minute, PULONG Second); - VOID (*HwDetect)(VOID); + PCONFIGURATION_COMPONENT_DATA (*HwDetect)(VOID); } MACHVTBL, *PMACHVTBL; VOID MachInit(const char *CmdLine); diff --git a/reactos/boot/freeldr/freeldr/reactos/reactos.c b/reactos/boot/freeldr/freeldr/reactos/reactos.c index 27ad05aae6c..2df4c98ab81 100644 --- a/reactos/boot/freeldr/freeldr/reactos/reactos.c +++ b/reactos/boot/freeldr/freeldr/reactos/reactos.c @@ -604,7 +604,6 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; LoaderBlock.DrivesAddr = reactos_arc_disk_info; - LoaderBlock.ArchExtra = (ULONG)reactos_arc_hardware_data; LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { @@ -700,7 +699,7 @@ LoadAndBootReactOS(PCSTR OperatingSystemName) /* * Detect hardware */ - MachHwDetect(); + LoaderBlock.ArchExtra = (ULONG)MachHwDetect(); UiDrawProgressBarCenter(5, 100, szLoadingMsg); if (AcpiPresent) LoaderBlock.Flags |= MB_FLAGS_ACPI_TABLE; diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c index 7dd90e7c761..15b5846393e 100644 --- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c +++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c @@ -187,7 +187,6 @@ VOID RunLoader(VOID) LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd; LoaderBlock.ModsCount = 0; LoaderBlock.ModsAddr = reactos_modules; - LoaderBlock.ArchExtra = (ULONG)reactos_arc_hardware_data; LoaderBlock.MmapLength = (unsigned long)MachGetMemoryMap((PBIOS_MEMORY_MAP)reactos_memory_map, 32) * sizeof(memory_map_t); if (LoaderBlock.MmapLength) { @@ -232,7 +231,7 @@ VOID RunLoader(VOID) /* Detect hardware */ UiDrawStatusText("Detecting hardware..."); - MachHwDetect(); + LoaderBlock.ArchExtra = (ULONG)MachHwDetect(); UiDrawStatusText(""); /* set boot device */