- Add i386/cmhardwr.c and start implementing CmpInitializeMachineDependentConfiguration. Currently it only detects and writes the key for PAE.

- Call the API from CmInitSystem1.

svn path=/trunk/; revision=26675
This commit is contained in:
Alex Ionescu 2007-05-10 16:42:24 +00:00
parent 5b30480967
commit 78b58e34df
3 changed files with 74 additions and 0 deletions

View file

@ -74,6 +74,10 @@ NTSTATUS
NTAPI
CmpCreateControlSet(IN PLOADER_PARAMETER_BLOCK LoaderBlock);
NTSTATUS
NTAPI
CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock);
static VOID STDCALL
CmiHiveSyncDpcRoutine(PKDPC Dpc,
PVOID DeferredContext,
@ -510,6 +514,14 @@ CmInitSystem1(VOID)
KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 12, Status, 0);
}
/* Initialize machine-dependent information into the registry */
Status = CmpInitializeMachineDependentConfiguration(KeLoaderBlock);
if (!NT_SUCCESS(Status))
{
/* Bugcheck */
KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 14, Status, 0);
}
/* Initialize volatile registry settings */
Status = CmpSetSystemValues(KeLoaderBlock);
if (!NT_SUCCESS(Status))

View file

@ -0,0 +1,57 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL - See COPYING in the top level directory
* FILE: ntoskrnl/config/i386/cmhardwr.c
* PURPOSE: Configuration Manager - Hardware-Specific Code
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES ******************************************************************/
#include "ntoskrnl.h"
#include "../cm.h"
#define NDEBUG
#include "debug.h"
/* FUNCTIONS *****************************************************************/
NTSTATUS
NTAPI
CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
UNICODE_STRING KeyName, ValueName;
OBJECT_ATTRIBUTES ObjectAttributes;
ULONG HavePae;
NTSTATUS Status;
HANDLE KeyHandle;
RtlInitUnicodeString(&KeyName,
L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\"
L"Control\\Session Manager\\Memory Management");
InitializeObjectAttributes(&ObjectAttributes,
&KeyName,
OBJ_CASE_INSENSITIVE,
NULL,
NULL);
Status = NtOpenKey(&KeyHandle, KEY_READ | KEY_WRITE, &ObjectAttributes);
if (NT_SUCCESS(Status))
{
/* Detect if PAE is enabled */
HavePae = SharedUserData->ProcessorFeatures[PF_PAE_ENABLED];
/* Set the value */
RtlInitUnicodeString(&ValueName, L"PhysicalAddressExtension");
NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_DWORD,
&HavePae,
sizeof(HavePae));
/* Close the key */
NtClose(KeyHandle);
}
/* All done*/
return STATUS_SUCCESS;
}

View file

@ -84,6 +84,11 @@
<file>view.c</file>
</directory>
<directory name="config">
<if property="ARCH" value="i386">
<directory name="i386">
<file>cmhardwr.c</file>
</directory>
</if>
<file>cmboot.c</file>
<file>cmcontrl.c</file>
<file>cmdata.c</file>