Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/mpboot.s
Show All 31 Lines | |||||
#include "opt_pmap.h" | #include "opt_pmap.h" | ||||
#include <machine/asmacros.h> /* miscellaneous asm macros */ | #include <machine/asmacros.h> /* miscellaneous asm macros */ | ||||
#include <x86/apicreg.h> | #include <x86/apicreg.h> | ||||
#include <machine/specialreg.h> | #include <machine/specialreg.h> | ||||
#include "assym.inc" | #include "assym.inc" | ||||
#define R(x) ((x)-KERNBASE) | |||||
/* | /* | ||||
* this code MUST be enabled here and in mp_machdep.c | * this code MUST be enabled here and in mp_machdep.c | ||||
* it follows the very early stages of AP boot by placing values in CMOS ram. | * it follows the very early stages of AP boot by placing values in CMOS ram. | ||||
* it NORMALLY will never be needed and thus the primitive method for enabling. | * it NORMALLY will never be needed and thus the primitive method for enabling. | ||||
* | * | ||||
#define CHECK_POINTS | #define CHECK_POINTS | ||||
*/ | */ | ||||
Show All 25 Lines | NON_GPROF_ENTRY(MPentry) | ||||
/* | /* | ||||
* Enable features on this processor. We don't support SMP on | * Enable features on this processor. We don't support SMP on | ||||
* CPUs older than a Pentium, so we know that we can use the cpuid | * CPUs older than a Pentium, so we know that we can use the cpuid | ||||
* instruction. | * instruction. | ||||
*/ | */ | ||||
movl $1,%eax | movl $1,%eax | ||||
cpuid /* Retrieve features */ | cpuid /* Retrieve features */ | ||||
movl %cr4,%eax | movl %cr4,%eax | ||||
#ifndef DISABLE_PSE | |||||
testl $CPUID_PSE,%edx | testl $CPUID_PSE,%edx | ||||
jz 1f | jz 1f | ||||
orl $CR4_PSE,%eax /* Enable PSE */ | orl $CR4_PSE,%eax /* Enable PSE */ | ||||
1: | 1: | ||||
#endif | |||||
#ifndef DISABLE_PG_G | |||||
testl $CPUID_PGE,%edx | testl $CPUID_PGE,%edx | ||||
jz 1f | jz 1f | ||||
orl $CR4_PGE,%eax /* Enable PGE */ | orl $CR4_PGE,%eax /* Enable PGE */ | ||||
1: | 1: | ||||
#endif | |||||
testl $CPUID_VME,%edx | testl $CPUID_VME,%edx | ||||
jz 1f | jz 1f | ||||
orl $CR4_VME,%eax /* Enable VME */ | orl $CR4_VME,%eax /* Enable VME */ | ||||
1: | 1: | ||||
movl %eax,%cr4 | movl %eax,%cr4 | ||||
/* Now enable paging mode */ | /* Now enable paging mode */ | ||||
#if defined(PAE) || defined(PAE_TABLES) | #if defined(PAE) || defined(PAE_TABLES) | ||||
movl R(IdlePDPT), %eax | movl IdlePDPT, %eax | ||||
movl %eax, %cr3 | movl %eax, %cr3 | ||||
movl %cr4, %eax | movl %cr4, %eax | ||||
orl $CR4_PAE, %eax | orl $CR4_PAE, %eax | ||||
movl %eax, %cr4 | movl %eax, %cr4 | ||||
#else | #else | ||||
movl R(IdlePTD), %eax | movl IdlePTD, %eax | ||||
movl %eax,%cr3 | movl %eax,%cr3 | ||||
#endif | #endif | ||||
movl %cr0,%eax | movl %cr0,%eax | ||||
orl $CR0_PE|CR0_PG,%eax /* enable paging */ | orl $CR0_PE|CR0_PG,%eax /* enable paging */ | ||||
movl %eax,%cr0 /* let the games begin! */ | movl %eax,%cr0 /* let the games begin! */ | ||||
movl bootSTK,%esp /* boot stack end loc. */ | movl bootSTK,%esp /* boot stack end loc. */ | ||||
pushl $mp_begin /* jump to high mem */ | pushl $mp_begin /* jump to high mem */ | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |