Alex Ionescu <ionucu@videotron.ca>

Pass an ACPI flag from FreeLdr to the kernel and replace the usage of ACPI compile time option with it.

svn path=/trunk/; revision=13945
This commit is contained in:
Filip Navara 2005-03-12 00:49:18 +00:00
parent b89e71762d
commit 94066e01ef
10 changed files with 23 additions and 26 deletions

View file

@ -28,6 +28,7 @@
#include "../../reactos/registry.h"
#include "hardware.h"
BOOLEAN AcpiPresent = FALSE;
static BOOL
FindAcpiBios(VOID)
@ -63,6 +64,7 @@ DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
if (FindAcpiBios())
{
AcpiPresent = TRUE;
/* Create new bus key */
sprintf(Buffer,
"MultifunctionAdapter\\%u", *BusNumber);

View file

@ -52,6 +52,7 @@
#define MB_INFO_FLAG_BOOT_LOADER_NAME 0x00000200
#define MB_INFO_FLAG_APM_TABLE 0x00000400
#define MB_INFO_FLAG_GRAPHICS_TABLE 0x00000800
#define MB_INFO_FLAG_ACPI_TABLE 0x00001000
#ifndef ASM
/* Do not include here in boot.S. */

View file

@ -580,6 +580,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
extern ULONG PageDirectoryStart;
extern ULONG PageDirectoryEnd;
extern BOOLEAN AcpiPresent;
//
// Open the operating system section
@ -596,6 +597,7 @@ LoadAndBootReactOS(PUCHAR OperatingSystemName)
* Setup multiboot information structure
*/
LoaderBlock.Flags = MB_INFO_FLAG_MEM_SIZE | MB_INFO_FLAG_BOOT_DEVICE | MB_INFO_FLAG_COMMAND_LINE | MB_INFO_FLAG_MODULES;
if (AcpiPresent) LoaderBlock.Flags |= MB_INFO_FLAG_ACPI_TABLE;
LoaderBlock.PageDirectoryStart = (ULONG)&PageDirectoryStart;
LoaderBlock.PageDirectoryEnd = (ULONG)&PageDirectoryEnd;
LoaderBlock.BootDevice = 0xffffffff;

View file

@ -37,11 +37,6 @@ OPTIMIZED := 0
#
CONFIG_SMP := 0
#
# Whether to compile for ACPI compliant systems
#
ACPI := 0
#
# whether to use a 3GB User, 1GB Kernel memory map
#

View file

@ -492,6 +492,7 @@ typedef struct _ADDRESS_RANGE
#define MB_FLAGS_BOOT_LOADER_NAME (0x200)
#define MB_FLAGS_APM_TABLE (0x400)
#define MB_FLAGS_GRAPHICS_TABLE (0x800)
#define MB_FLAGS_ACPI_TABLE (0x1000)
typedef struct _LOADER_MODULE
{

View file

@ -18,7 +18,7 @@
extern PDEVICE_NODE PopSystemPowerDeviceNode;
VOID
PoInit(VOID);
PoInit(PLOADER_PARAMETER_BLOCK LoaderBlock, BOOLEAN ForceAcpiDisable);
NTSTATUS
PopSetSystemPowerState(

View file

@ -82,7 +82,6 @@ IopInitializeDevice(
return Status;
}
#ifdef ACPI
if (Fdo->DeviceType == FILE_DEVICE_ACPI)
{
static BOOLEAN SystemPowerDeviceNodeCreated = FALSE;
@ -94,7 +93,6 @@ IopInitializeDevice(
SystemPowerDeviceNodeCreated = TRUE;
}
}
#endif /* ACPI */
if (Fdo->DeviceType == FILE_DEVICE_BUS_EXTENDER ||
Fdo->DeviceType == FILE_DEVICE_ACPI)

View file

@ -528,7 +528,7 @@ ExpInitializeExecutive(VOID)
ExInit3();
KdInit1();
IoInit();
PoInit();
PoInit(&KeLoaderBlock, FALSE);
CmInitializeRegistry();
MmInit3();
CcInit();

View file

@ -12,8 +12,8 @@
#define NDEBUG
#include <internal/debug.h>
PDEVICE_NODE PopSystemPowerDeviceNode = NULL;
BOOLEAN PopAcpiPresent = FALSE;
/*
* @implemented
@ -134,9 +134,6 @@ NTSTATUS
PopSetSystemPowerState(
SYSTEM_POWER_STATE PowerState)
{
#ifdef ACPI
IO_STATUS_BLOCK IoStatusBlock;
PDEVICE_OBJECT DeviceObject;
PIO_STACK_LOCATION IrpSp;
@ -145,6 +142,8 @@ PopSetSystemPowerState(
KEVENT Event;
PIRP Irp;
if (!PopAcpiPresent) return STATUS_NOT_IMPLEMENTED;
Status = IopGetSystemPowerDeviceObject(&DeviceObject);
if (!NT_SUCCESS(Status)) {
CPRINT("No system power driver available\n");
@ -190,15 +189,18 @@ PopSetSystemPowerState(
ObDereferenceObject(Fdo);
return Status;
#endif /* ACPI */
return STATUS_NOT_IMPLEMENTED;
}
VOID INIT_FUNCTION
PoInit(VOID)
VOID
INIT_FUNCTION
PoInit(PLOADER_PARAMETER_BLOCK LoaderBlock,
BOOLEAN ForceAcpiDisable)
{
/* Set the ACPI State to False if it's been forced that way */
if (ForceAcpiDisable) PopAcpiPresent = FALSE;
/* Otherwise check the LoaderBlock's Flag */
PopAcpiPresent = LoaderBlock->Flags & MB_FLAGS_ACPI_TABLE;
}
/*

View file

@ -19,10 +19,6 @@ ifeq ($(CONFIG_SMP), 1)
CONFIG += CONFIG_SMP
endif
ifeq ($(ACPI), 1)
CONFIG += ACPI
endif
$(PATH_TO_TOP)/tools/mkconfig$(EXE_POSTFIX): $(PATH_TO_TOP)/tools/mkconfig.c
@$(HOST_CC) -g -o $(PATH_TO_TOP)/tools/mkconfig$(EXE_POSTFIX) $(PATH_TO_TOP)/tools/mkconfig.c