summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlmuHS <almuhs@github.com>2019-05-20 17:27:19 +0200
committerAlmuHS <almuhs@github.com>2019-05-20 17:27:19 +0200
commit5d4df7ed707fc4c7b09b48d6bdb122835494f13c (patch)
treec09516a489f7624506d78ea07ff6222388636cde
parentf533f44f599e86da8e3b6d8dec8863b8a17b1dbd (diff)
wip: fixed pagging enable in assembly macro (not tested yet)
-rw-r--r--i386/i386/cpuboot.S18
-rw-r--r--i386/i386/locore.h6
2 files changed, 17 insertions, 7 deletions
diff --git a/i386/i386/cpuboot.S b/i386/i386/cpuboot.S
index d50d2dc5..35ef2e92 100644
--- a/i386/i386/cpuboot.S
+++ b/i386/i386/cpuboot.S
@@ -1,5 +1,7 @@
#include <mach/machine/asm.h>
#include <i386/i386asm.h>
+#include <i386/locore.h>
+#include <i386/proc_reg.h>
#define STACK_SIZE (4096 * 2)
@@ -96,9 +98,10 @@ _apboot:
#ifndef MACH_HYP
//if (!CPU_HAS_FEATURE(CPU_FEATURE_PAE))
- bt %cr4, $CPU_FEATURE_PAE
- jc setpae
- jnc nopae
+ mov cpu_features, %eax
+ test $(1<<CPU_FEATURE_PAE), %eax
+ jz setpae
+ jnz nopae
setpae:
movl %cr4, %eax
@@ -132,14 +135,15 @@ nopae:
movl $CR0_CD, %edx
orl $CR0_NW, %edx
not %edx
- andl %edx, %eax
+ andl %edx, %eax
movl %eax, %cr0
//if (CPU_HAS_FEATURE(CPU_FEATURE_PGE))
- bt %cr4, $CPU_FEATURE_PGE
- jc setpge
- jnc nopge
+ movl cpu_features, %eax
+ test $(1<<CPU_FEATURE_PGE), %eax
+ jnz setpge
+ jz nopge
setpge:
//set_cr4(get_cr4() | CR4_PGE);
diff --git a/i386/i386/locore.h b/i386/i386/locore.h
index ece8aafa..8683e641 100644
--- a/i386/i386/locore.h
+++ b/i386/i386/locore.h
@@ -19,10 +19,14 @@
#ifndef _MACHINE_LOCORE_H_
#define _MACHINE_LOCORE_H_
+#ifndef __ASSEMBLER__
+
#include <sys/types.h>
#include <kern/sched_prim.h>
+
+
/*
* Fault recovery in copyin/copyout routines.
*/
@@ -60,6 +64,8 @@ extern int syscall (void);
extern unsigned int cpu_features[1];
+#endif // __ASSEMBLER__
+
#define CPU_FEATURE_FPU 0
#define CPU_FEATURE_VME 1
#define CPU_FEATURE_DE 2