aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86/system.h
diff options
context:
space:
mode:
authorGlauber de Oliveira Costa <gcosta@redhat.com>2008-01-30 07:31:08 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:31:08 -0500
commitd46d7d754014a299fa9b3400d080e09bfe4d629f (patch)
tree5075bc8b217c9ead5e5f7cce57b6b7ec67c5c6aa /include/asm-x86/system.h
parent0a3b4d151a8e57f50ce5a12c7ea5ec9965cf0b5a (diff)
x86: unify system.h
This patch finishes the unification of system.h file. i386 needs a constant to be defined, and it is defined inside an ifdef. Other than that, pretty much nothing but includes are left in the arch specific headers, and they are deleted. [ mingo@elte.hu: 64-bit needs the cr8 access inlines. ] Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/system.h')
-rw-r--r--include/asm-x86/system.h26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h
index ba3403f1d020..8a37dad38bc0 100644
--- a/include/asm-x86/system.h
+++ b/include/asm-x86/system.h
@@ -2,8 +2,12 @@
2#define _ASM_X86_SYSTEM_H_ 2#define _ASM_X86_SYSTEM_H_
3 3
4#include <asm/asm.h> 4#include <asm/asm.h>
5#include <asm/segment.h>
6#include <asm/cpufeature.h>
7#include <asm/cmpxchg.h>
5 8
6#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/irqflags.h>
7 11
8#ifdef CONFIG_X86_32 12#ifdef CONFIG_X86_32
9#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ 13#define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */
@@ -34,7 +38,10 @@ extern struct task_struct *FASTCALL(__switch_to(struct task_struct *prev,
34 "2" (prev), "d" (next)); \ 38 "2" (prev), "d" (next)); \
35} while (0) 39} while (0)
36 40
37# include "system_32.h" 41/*
42 * disable hlt during certain critical i/o operations
43 */
44#define HAVE_DISABLE_HLT
38#else 45#else
39#define __SAVE(reg, offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t" 46#define __SAVE(reg, offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
40#define __RESTORE(reg, offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t" 47#define __RESTORE(reg, offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
@@ -69,7 +76,6 @@ extern struct task_struct *FASTCALL(__switch_to(struct task_struct *prev,
69 [thread_info] "i" (offsetof(struct task_struct, stack)), \ 76 [thread_info] "i" (offsetof(struct task_struct, stack)), \
70 [pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent)) \ 77 [pda_pcurrent] "i" (offsetof(struct x8664_pda, pcurrent)) \
71 : "memory", "cc" __EXTRA_CLOBBER) 78 : "memory", "cc" __EXTRA_CLOBBER)
72# include "system_64.h"
73#endif 79#endif
74 80
75#ifdef __KERNEL__ 81#ifdef __KERNEL__
@@ -236,6 +242,22 @@ static inline void native_wbinvd(void)
236#define write_cr4(x) (native_write_cr4(x)) 242#define write_cr4(x) (native_write_cr4(x))
237#define wbinvd() (native_wbinvd()) 243#define wbinvd() (native_wbinvd())
238 244
245#ifdef CONFIG_X86_64
246
247static inline unsigned long read_cr8(void)
248{
249 unsigned long cr8;
250 asm volatile("movq %%cr8,%0" : "=r" (cr8));
251 return cr8;
252}
253
254static inline void write_cr8(unsigned long val)
255{
256 asm volatile("movq %0,%%cr8" :: "r" (val) : "memory");
257}
258
259#endif
260
239/* Clear the 'TS' bit */ 261/* Clear the 'TS' bit */
240#define clts() (native_clts()) 262#define clts() (native_clts())
241 263