summaryrefslogtreecommitdiff
path: root/arch/x86/machine/asm.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2012-10-10 21:18:28 +0200
committerRichard Braun <rbraun@sceen.net>2012-10-10 21:18:28 +0200
commit8eadbf1e9f3530fa7b0f93caf572d96a50891445 (patch)
treedc1404beb07c396b92e628643438b571a68a22da /arch/x86/machine/asm.h
parente2955084048dac30b081b62ba27d0282079dd01a (diff)
x86: initialize long mode on amd64
The boot procedure creates an identity mapping for the first 4 GiB of physical memory, then switches to long mode so that 64-bit code can be run to initialize the kernel.
Diffstat (limited to 'arch/x86/machine/asm.h')
-rw-r--r--arch/x86/machine/asm.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/machine/asm.h b/arch/x86/machine/asm.h
index e427b51..3d2da75 100644
--- a/arch/x86/machine/asm.h
+++ b/arch/x86/machine/asm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Richard Braun.
+ * Copyright (c) 2011, 2012 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,24 +18,25 @@
#ifndef _X86_ASM_H
#define _X86_ASM_H
-#ifdef __ASSEMBLY__
+#include <machine/param.h>
-#define TEXT_ALIGN 4
-#define DATA_ALIGN 2
+#ifdef __ASSEMBLY__
-#define ENTRY(x) \
-.p2align TEXT_ALIGN, 0x90; \
-.global x; \
-.type x, STT_FUNC; \
+#define ENTRY(x) \
+.align TEXT_ALIGN; \
+.global x; \
+.type x, STT_FUNC; \
x:
#define DATA(x) \
-.p2align DATA_ALIGN; \
+.align DATA_ALIGN; \
.global x; \
.type x, STT_OBJECT; \
x:
-#define END(x) .size x, . - x;
+#define END(x) \
+.size x, . - x; \
+x ## _end:
#endif /* __ASSEMBLY__ */