[FREELDR:NTLDR] Pass boot-time detection options to HwDetect routines.

Will be used for supporting /NOSERIALMICE, /FASTDETECT (NT 5+) switches
(see PR #5886), as well as the undocumented /PCIENUM option.
This commit is contained in:
Hermès Bélusca-Maïto 2023-06-15 17:04:53 +02:00
parent 413b5a0827
commit 10e7643c80
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
11 changed files with 34 additions and 14 deletions

View file

@ -94,7 +94,8 @@ ArmPrepareForReactOS(VOID)
} }
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
ArmHwDetect(VOID) ArmHwDetect(
_In_opt_ PCSTR Options)
{ {
ARM_CACHE_REGISTER CacheReg; ARM_CACHE_REGISTER CacheReg;
@ -137,7 +138,7 @@ BOOLEAN
ArmInitializeBootDevices(VOID) ArmInitializeBootDevices(VOID)
{ {
/* Emulate old behavior */ /* Emulate old behavior */
if (ArmHwDetect() == NULL) if (ArmHwDetect(NULL) == NULL)
return FALSE; return FALSE;
/* On ARM platforms, the loader is always in RAM */ /* On ARM platforms, the loader is always in RAM */

View file

@ -1628,7 +1628,8 @@ PcGetFloppyCount(VOID)
#endif #endif
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
PcHwDetect(VOID) PcHwDetect(
_In_opt_ PCSTR Options)
{ {
PCONFIGURATION_COMPONENT_DATA SystemKey; PCONFIGURATION_COMPONENT_DATA SystemKey;
ULONG BusNumber = 0; ULONG BusNumber = 0;

View file

@ -1180,7 +1180,8 @@ DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
} }
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
Pc98HwDetect(VOID) Pc98HwDetect(
_In_opt_ PCSTR Options)
{ {
PCONFIGURATION_COMPONENT_DATA SystemKey; PCONFIGURATION_COMPONENT_DATA SystemKey;
ULONG BusNumber = 0; ULONG BusNumber = 0;

View file

@ -263,7 +263,8 @@ XboxGetFloppyCount(VOID)
} }
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
XboxHwDetect(VOID) XboxHwDetect(
_In_opt_ PCSTR Options)
{ {
PCONFIGURATION_COMPONENT_DATA SystemKey; PCONFIGURATION_COMPONENT_DATA SystemKey;
ULONG BusNumber = 0; ULONG BusNumber = 0;

View file

@ -123,7 +123,8 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
} }
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
UefiHwDetect(VOID) UefiHwDetect(
_In_opt_ PCSTR Options)
{ {
PCONFIGURATION_COMPONENT_DATA SystemKey; PCONFIGURATION_COMPONENT_DATA SystemKey;
ULONG BusNumber = 0; ULONG BusNumber = 0;

View file

@ -80,7 +80,11 @@ VOID Pc98VideoPrepareForReactOS(VOID);
VOID Pc98PrepareForReactOS(VOID); VOID Pc98PrepareForReactOS(VOID);
TIMEINFO* Pc98GetTime(VOID); TIMEINFO* Pc98GetTime(VOID);
BOOLEAN Pc98InitializeBootDevices(VOID); BOOLEAN Pc98InitializeBootDevices(VOID);
PCONFIGURATION_COMPONENT_DATA Pc98HwDetect(VOID);
PCONFIGURATION_COMPONENT_DATA
Pc98HwDetect(
_In_opt_ PCSTR Options);
VOID Pc98HwIdle(VOID); VOID Pc98HwIdle(VOID);
/* pcmem.c */ /* pcmem.c */

View file

@ -58,7 +58,10 @@ ULONG XboxDiskGetCacheableBlockCount(UCHAR DriveNumber);
TIMEINFO* XboxGetTime(VOID); TIMEINFO* XboxGetTime(VOID);
PCONFIGURATION_COMPONENT_DATA XboxHwDetect(VOID); PCONFIGURATION_COMPONENT_DATA
XboxHwDetect(
_In_opt_ PCSTR Options);
VOID XboxHwIdle(VOID); VOID XboxHwIdle(VOID);
VOID XboxSetLED(PCSTR Pattern); VOID XboxSetLED(PCSTR Pattern);

View file

@ -67,7 +67,11 @@ ULONG PcDiskGetCacheableBlockCount(UCHAR DriveNumber);
TIMEINFO* PcGetTime(VOID); TIMEINFO* PcGetTime(VOID);
BOOLEAN PcInitializeBootDevices(VOID); BOOLEAN PcInitializeBootDevices(VOID);
PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID);
PCONFIGURATION_COMPONENT_DATA
PcHwDetect(
_In_opt_ PCSTR Options);
VOID PcHwIdle(VOID); VOID PcHwIdle(VOID);
extern BIOS_MEMORY_MAP PcBiosMemoryMap[]; extern BIOS_MEMORY_MAP PcBiosMemoryMap[];

View file

@ -106,7 +106,8 @@ BOOLEAN
UefiInitializeBootDevices(VOID); UefiInitializeBootDevices(VOID);
PCONFIGURATION_COMPONENT_DATA PCONFIGURATION_COMPONENT_DATA
UefiHwDetect(VOID); UefiHwDetect(
_In_opt_ PCSTR Options);
VOID VOID
UefiPrepareForReactOS(VOID); UefiPrepareForReactOS(VOID);

View file

@ -74,7 +74,7 @@ typedef struct tagMACHVTBL
// NOTE: Not in the machine.c ... // NOTE: Not in the machine.c ...
BOOLEAN (*InitializeBootDevices)(VOID); BOOLEAN (*InitializeBootDevices)(VOID);
PCONFIGURATION_COMPONENT_DATA (*HwDetect)(VOID); PCONFIGURATION_COMPONENT_DATA (*HwDetect)(_In_opt_ PCSTR Options);
VOID (*HwIdle)(VOID); VOID (*HwIdle)(VOID);
} MACHVTBL, *PMACHVTBL; } MACHVTBL, *PMACHVTBL;
@ -133,8 +133,11 @@ VOID MachInit(const char *CmdLine);
#define MachInitializeBootDevices() \ #define MachInitializeBootDevices() \
MachVtbl.InitializeBootDevices() MachVtbl.InitializeBootDevices()
#define MachHwDetect() MachVtbl.HwDetect() #define MachHwDetect(Options) \
#define MachHwIdle() MachVtbl.HwIdle() MachVtbl.HwDetect(Options)
#define MachHwIdle() \
MachVtbl.HwIdle()
/* ARC FUNCTIONS **************************************************************/ /* ARC FUNCTIONS **************************************************************/

View file

@ -1173,7 +1173,7 @@ LoadAndBootWindowsCommon(
/* Detect hardware */ /* Detect hardware */
UiUpdateProgressBar(20, "Detecting hardware..."); UiUpdateProgressBar(20, "Detecting hardware...");
LoaderBlock->ConfigurationRoot = MachHwDetect(); LoaderBlock->ConfigurationRoot = MachHwDetect(BootOptions);
/* Initialize the PE loader import-DLL callback, so that we can obtain /* Initialize the PE loader import-DLL callback, so that we can obtain
* feedback (for example during SOS) on the PE images that get loaded. */ * feedback (for example during SOS) on the PE images that get loaded. */