Preparations for PAE support
Change-Id: I9a7c9ed9f803e2e26d745d14149a8aec64ab0c75
This commit is contained in:
parent
e70e5a1722
commit
bf609e1012
@ -74,6 +74,7 @@ i386/vm.h
|
||||
#define CPUID1_EDX_FPU (1L) /* FPU presence */
|
||||
#define CPUID1_EDX_PSE (1L << 3) /* Page Size Extension */
|
||||
#define CPUID1_EDX_SYSENTER (1L << 11) /* Intel SYSENTER */
|
||||
#define CPUID1_EDX_PAE (1L << 6) /* Physical Address Extension */
|
||||
#define CPUID1_EDX_PGE (1L << 13) /* Page Global (bit) Enable */
|
||||
#define CPUID1_EDX_APIC_ON_CHIP (1L << 9) /* APIC is present on the chip */
|
||||
#define CPUID1_EDX_TSC (1L << 4) /* Timestamp counter present */
|
||||
|
@ -25,6 +25,8 @@
|
||||
#define _CPUF_I386_SYSENTER 16 /* Intel SYSENTER instrs */
|
||||
#define _CPUF_I386_SYSCALL 17 /* AMD SYSCALL instrs */
|
||||
|
||||
#define _CPUF_I386_PAE 18 /* Page Address Extension */
|
||||
|
||||
int _cpufeature(int featureno);
|
||||
|
||||
#endif
|
||||
|
@ -43,6 +43,10 @@ CPPFLAGS+= -I${NETBSDSRCDIR}/minix/include/arch/${MACHINE_ARCH}/include
|
||||
|
||||
.include "system/Makefile.inc"
|
||||
|
||||
.if ${MKPAE:Uno} != "no"
|
||||
CPPFLAGS+= -DPAE=1
|
||||
.endif
|
||||
|
||||
.ifdef CONFIG_SMP
|
||||
SRCS+= smp.c
|
||||
.endif
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include <sys/reboot.h>
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <machine/vm.h>
|
||||
|
||||
#include <minix/u64.h>
|
||||
|
||||
|
@ -208,6 +208,11 @@ void vm_enable_paging(void)
|
||||
|
||||
pgeok = _cpufeature(_CPUF_I386_PGE);
|
||||
|
||||
#ifdef PAE
|
||||
if(_cpufeature(_CPUF_I386_PAE) == 0)
|
||||
panic("kernel built with PAE support, CPU seems to lack PAE support?\n");
|
||||
#endif
|
||||
|
||||
cr0= read_cr0();
|
||||
cr4= read_cr4();
|
||||
|
||||
|
@ -337,6 +337,9 @@ static void announce(void)
|
||||
{
|
||||
/* Display the MINIX startup banner. */
|
||||
printf("\nMINIX %s. "
|
||||
#ifdef PAE
|
||||
"(PAE) "
|
||||
#endif
|
||||
#ifdef _VCS_REVISION
|
||||
"(" _VCS_REVISION ")\n"
|
||||
#endif
|
||||
|
@ -51,6 +51,8 @@ int _cpufeature(int cpufeature)
|
||||
switch(cpufeature) {
|
||||
case _CPUF_I386_PSE:
|
||||
return edx & CPUID1_EDX_PSE;
|
||||
case _CPUF_I386_PAE:
|
||||
return edx & CPUID1_EDX_PAE;
|
||||
case _CPUF_I386_PGE:
|
||||
return edx & CPUID1_EDX_PGE;
|
||||
case _CPUF_I386_APIC_ON_CHIP:
|
||||
|
@ -40,7 +40,7 @@ typedef struct _st_init_info_t {
|
||||
typedef struct st_alloc_pages {
|
||||
int num_pages;
|
||||
void *virt_addr;
|
||||
uint32_t phys_addr;
|
||||
phys_bytes phys_addr;
|
||||
struct st_alloc_pages *previous;
|
||||
} st_alloc_pages;
|
||||
|
||||
|
@ -12,6 +12,10 @@ SRCS= main.c alloc.c utility.c exit.c fork.c break.c \
|
||||
LDFLAGS+= -T ${.CURDIR}/arch/${MACHINE_ARCH}/vm.lds
|
||||
.endif
|
||||
|
||||
.if ${MKPAE:Uno} != "no"
|
||||
CPPFLAGS+= -DPAE=1
|
||||
.endif
|
||||
|
||||
DPADD+= ${LIBSYS} ${LIBEXEC}
|
||||
LDADD+= -lsys -lexec
|
||||
|
||||
|
@ -1268,7 +1268,7 @@ _MKVARS.yes+= \
|
||||
MKSYSDEBUG MKLIVEUPDATE MKLWIP MKLLVMCMDS
|
||||
.if (${MACHINE_ARCH} == "i386")
|
||||
_MKVARS.yes+= \
|
||||
MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
|
||||
MKWATCHDOG MKACPI MKPAE MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
|
||||
.endif
|
||||
|
||||
.for var in ${_MKVARS.yes}
|
||||
@ -1309,7 +1309,7 @@ _MKVARS.no+= \
|
||||
MKIMAGEONLY MKSMALL MKBITCODE MKMAGIC MKASR MKSRC
|
||||
.if !empty(MACHINE_ARCH:Mearm*)
|
||||
_MKVARS.no+= \
|
||||
MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
|
||||
MKWATCHDOG MKPAE MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
|
||||
.endif
|
||||
|
||||
.for var in ${_MKVARS.no}
|
||||
@ -1497,7 +1497,7 @@ ${var}?= yes
|
||||
|
||||
#MINIX-specific vars
|
||||
.for var in \
|
||||
USE_WATCHDOG USE_ACPI USE_APIC USE_DEBUGREG USE_SYSDEBUG \
|
||||
USE_WATCHDOG USE_ACPI USE_PAE USE_APIC USE_DEBUGREG USE_SYSDEBUG \
|
||||
USE_LIVEUPDATE USE_PCI USE_BITCODE USE_MAGIC USE_ASR
|
||||
.if (${${var:S/USE_/MK/}} == "no")
|
||||
${var}:= no
|
||||
|
Loading…
x
Reference in New Issue
Block a user