summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-01-24 00:00:50 +0000
committerderaadt <deraadt@openbsd.org>2019-01-24 00:00:50 +0000
commit284831593da5de0663d3fcbda83f16f05a4380ea (patch)
tree4f5bc499d5fba759a6b720f4fa5385f5c5e2db85
parentmptramp.S does not export gdt64, another historical locore.s splitup error (diff)
downloadwireguard-openbsd-284831593da5de0663d3fcbda83f16f05a4380ea.tar.xz
wireguard-openbsd-284831593da5de0663d3fcbda83f16f05a4380ea.zip
gdt64 is only used by locore0 during the gut-wrenching 32-bit bring-up, so
move it to right place.
-rw-r--r--sys/arch/amd64/amd64/locore.S23
-rw-r--r--sys/arch/amd64/amd64/locore0.S13
2 files changed, 13 insertions, 23 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index 788e50eb1a6..70b1dcb6aec 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.112 2019/01/20 00:53:08 mlarkin Exp $ */
+/* $OpenBSD: locore.S,v 1.113 2019/01/24 00:00:50 deraadt Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@@ -215,27 +215,6 @@ _C_LABEL(pg_g_kern): .quad 0 # 0x100 if global pages should be used
# insecure CPUs)
_C_LABEL(cpu_meltdown): .long 0 # 1 if this CPU has Meltdown
-#define _RELOC(x) ((x) - KERNBASE)
-#define RELOC(x) _RELOC(_C_LABEL(x))
-
- .globl gdt64
-
-gdt64:
- .word gdt64_end-gdt64_start-1
- .quad _RELOC(gdt64_start)
-.align 64, 0xcc
-
-gdt64_start:
- .quad 0x0000000000000000 /* always empty */
- .quad 0x00af9a000000ffff /* kernel CS */
- .quad 0x00cf92000000ffff /* kernel DS */
-gdt64_end:
-
-/*
- * Some hackage to deal with 64bit symbols in 32 bit mode.
- * This may not be needed if things are cleaned up a little.
- */
-
/*****************************************************************************/
/*
diff --git a/sys/arch/amd64/amd64/locore0.S b/sys/arch/amd64/amd64/locore0.S
index fb10cd96ae5..78726334b67 100644
--- a/sys/arch/amd64/amd64/locore0.S
+++ b/sys/arch/amd64/amd64/locore0.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore0.S,v 1.12 2019/01/23 23:51:58 deraadt Exp $ */
+/* $OpenBSD: locore0.S,v 1.13 2019/01/24 00:00:50 deraadt Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@@ -692,6 +692,17 @@ _C_LABEL(codepatch_end):
.previous
.data
+ .globl gdt64
+gdt64:
+ .word gdt64_end-gdt64_start-1
+ .quad _RELOC(gdt64_start)
+ .align 64, 0xcc
+
+gdt64_start:
+ .quad 0x0000000000000000 /* always empty */
+ .quad 0x00af9a000000ffff /* kernel CS */
+ .quad 0x00cf92000000ffff /* kernel DS */
+gdt64_end:
farjmp64:
.long longmode-KERNBASE