@@ -69,6 +69,8 @@
#define __ASM_SEL(a,b) __ASM_FORM(b)
#endif
+#ifndef __ASSEMBLER__
+
#include <setjmp.h>
void setup_idt(void);
@@ -338,4 +340,7 @@ do { \
#define asm_safe_report_ex __asm_safe_report
-#endif
+
+#endif /* __ASSEMBLER__ */
+
+#endif /* _X86_DESC_H_ */
@@ -1,5 +1,5 @@
-
#include "apic-defs.h"
+#include "desc.h"
ipi_vector = 0x20
@@ -66,7 +66,7 @@ start:
mov $stacktop, %esp
setup_percpu_area
call prepare_64
- jmpl $8, $start64
+ jmpl $KERNEL_CS, $start64
switch_to_5level:
/* Disable CR4.PCIDE */
@@ -86,11 +86,11 @@ switch_to_5level:
bts $12, %eax
mov %eax, %cr4
- mov $0x10, %ax
+ mov $KERNEL_DS, %ax
mov %ax, %ss
call enter_long_mode
- jmpl $8, $lvl5
+ jmpl $KERNEL_CS, $lvl5
smp_stacktop: .long stacktop - 4096
@@ -3,6 +3,8 @@
* transition from 32-bit to 64-bit code (x86-64 only)
*/
+#include "desc.h"
+
/* EFI provides it's own SIPI sequence to handle relocation. */
#ifndef CONFIG_EFI
.code16
@@ -15,7 +17,7 @@ sipi_entry:
or $1, %eax
mov %eax, %cr0
lgdtl ap_rm_gdt_descr - sipi_entry
- ljmpl $8, $ap_start32
+ ljmpl $KERNEL_CS32, $ap_start32
sipi_end:
.globl ap_rm_gdt_descr
@@ -66,7 +68,7 @@ MSR_GS_BASE = 0xc0000101
mov $MSR_GS_BASE, %ecx
rdmsr
- mov $0x10, %bx
+ mov $KERNEL_DS, %bx
mov %bx, %ds
mov %bx, %es
mov %bx, %fs
@@ -123,7 +125,7 @@ ap_start32:
call prepare_64
load_absolute_addr $ap_start64, %edx
- pushl $0x08
+ pushl $KERNEL_CS
pushl %edx
lretl
#endif