mirror of
https://github.com/reactos/reactos.git
synced 2025-08-01 23:53:07 +00:00
Check if the cpu supports the pae mode.
svn path=/trunk/; revision=16899
This commit is contained in:
parent
dce178cf7c
commit
2316f95498
1 changed files with 33 additions and 22 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue