mirror of
https://github.com/reactos/reactos.git
synced 2024-10-15 05:37:44 +00:00
- 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:
parent
5b30480967
commit
78b58e34df
|
@ -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))
|
||||
|
|
57
reactos/ntoskrnl/config/i386/cmhardwr.c
Normal file
57
reactos/ntoskrnl/config/i386/cmhardwr.c
Normal 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;
|
||||
}
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue