mirror of
https://github.com/reactos/reactos.git
synced 2026-07-05 04:44:38 +08:00
Check if the cpu supports the pae mode.
svn path=/trunk/; revision=16899
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include <freeldr.h>
|
||||
#include <../arch/i386/hardware.h>
|
||||
#include <internal/i386/ke.h>
|
||||
|
||||
#define NDEBUG
|
||||
@@ -279,32 +280,42 @@ VOID
|
||||
FASTCALL
|
||||
FrLdrGetPaeMode(VOID)
|
||||
{
|
||||
PCHAR p;
|
||||
BOOLEAN PaeModeSupported;
|
||||
|
||||
PaeModeSupported = FALSE;
|
||||
PaeModeEnabled = FALSE;
|
||||
|
||||
/* Read Command Line */
|
||||
p = (PCHAR)LoaderBlock.CommandLine;
|
||||
while ((p = strchr(p, '/')) != NULL) {
|
||||
|
||||
p++;
|
||||
/* Find "PAE" */
|
||||
if (!strnicmp(p, "PAE", 3)) {
|
||||
|
||||
/* Make sure there's nothing following it */
|
||||
if (p[3] == ' ' || p[3] == 0) {
|
||||
|
||||
/* Use Pae */
|
||||
PaeModeEnabled = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (PaeModeEnabled)
|
||||
if (CpuidSupported() & 1)
|
||||
{
|
||||
/* FIXME:
|
||||
* Check if the cpu is pae capable
|
||||
*/
|
||||
ULONG eax, ebx, ecx, FeatureBits;
|
||||
GetCpuid(1, &eax, &ebx, &ecx, &FeatureBits);
|
||||
if (FeatureBits & X86_FEATURE_PAE)
|
||||
{
|
||||
PaeModeSupported = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (PaeModeSupported)
|
||||
{
|
||||
PCHAR p;
|
||||
|
||||
/* Read Command Line */
|
||||
p = (PCHAR)LoaderBlock.CommandLine;
|
||||
while ((p = strchr(p, '/')) != NULL) {
|
||||
|
||||
p++;
|
||||
/* Find "PAE" */
|
||||
if (!strnicmp(p, "PAE", 3)) {
|
||||
|
||||
/* Make sure there's nothing following it */
|
||||
if (p[3] == ' ' || p[3] == 0) {
|
||||
|
||||
/* Use Pae */
|
||||
PaeModeEnabled = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user