diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 07:31:08 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:08 -0500 |
commit | d89542229b657bdcce6a6f76168f9098ee3e9344 (patch) | |
tree | 5beb503b43c24a3d666898ef68b656caae77e4da /include/asm-x86/system.h | |
parent | e34907ae180f4fe6c28bb4516c679c2f81b0c9ed (diff) |
x86: put together equal pieces of system.h
This patch puts together pieces of system_{32,64}.h that
looks like the same. It's the first step towards integration
of this file.
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.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h index 692562b48f2a..d0803f8c70c4 100644 --- a/include/asm-x86/system.h +++ b/include/asm-x86/system.h | |||
@@ -1,5 +1,74 @@ | |||
1 | #ifndef _ASM_X86_SYSTEM_H_ | ||
2 | #define _ASM_X86_SYSTEM_H_ | ||
3 | |||
4 | #include <asm/asm.h> | ||
5 | |||
1 | #ifdef CONFIG_X86_32 | 6 | #ifdef CONFIG_X86_32 |
2 | # include "system_32.h" | 7 | # include "system_32.h" |
3 | #else | 8 | #else |
4 | # include "system_64.h" | 9 | # include "system_64.h" |
5 | #endif | 10 | #endif |
11 | |||
12 | #ifdef __KERNEL__ | ||
13 | #define _set_base(addr, base) do { unsigned long __pr; \ | ||
14 | __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | ||
15 | "rorl $16,%%edx\n\t" \ | ||
16 | "movb %%dl,%2\n\t" \ | ||
17 | "movb %%dh,%3" \ | ||
18 | :"=&d" (__pr) \ | ||
19 | :"m" (*((addr)+2)), \ | ||
20 | "m" (*((addr)+4)), \ | ||
21 | "m" (*((addr)+7)), \ | ||
22 | "0" (base) \ | ||
23 | ); } while (0) | ||
24 | |||
25 | #define _set_limit(addr, limit) do { unsigned long __lr; \ | ||
26 | __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | ||
27 | "rorl $16,%%edx\n\t" \ | ||
28 | "movb %2,%%dh\n\t" \ | ||
29 | "andb $0xf0,%%dh\n\t" \ | ||
30 | "orb %%dh,%%dl\n\t" \ | ||
31 | "movb %%dl,%2" \ | ||
32 | :"=&d" (__lr) \ | ||
33 | :"m" (*(addr)), \ | ||
34 | "m" (*((addr)+6)), \ | ||
35 | "0" (limit) \ | ||
36 | ); } while (0) | ||
37 | |||
38 | #define set_base(ldt, base) _set_base(((char *)&(ldt)) , (base)) | ||
39 | #define set_limit(ldt, limit) _set_limit(((char *)&(ldt)) , ((limit)-1)) | ||
40 | |||
41 | /* | ||
42 | * Save a segment register away | ||
43 | */ | ||
44 | #define savesegment(seg, value) \ | ||
45 | asm volatile("mov %%" #seg ",%0":"=rm" (value)) | ||
46 | |||
47 | static inline unsigned long get_limit(unsigned long segment) | ||
48 | { | ||
49 | unsigned long __limit; | ||
50 | __asm__("lsll %1,%0" | ||
51 | :"=r" (__limit):"r" (segment)); | ||
52 | return __limit+1; | ||
53 | } | ||
54 | #endif /* __KERNEL__ */ | ||
55 | |||
56 | static inline void clflush(void *__p) | ||
57 | { | ||
58 | asm volatile("clflush %0" : "+m" (*(char __force *)__p)); | ||
59 | } | ||
60 | |||
61 | #define nop() __asm__ __volatile__ ("nop") | ||
62 | |||
63 | void disable_hlt(void); | ||
64 | void enable_hlt(void); | ||
65 | |||
66 | extern int es7000_plat; | ||
67 | void cpu_idle_wait(void); | ||
68 | |||
69 | extern unsigned long arch_align_stack(unsigned long sp); | ||
70 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | ||
71 | |||
72 | void default_idle(void); | ||
73 | |||
74 | #endif | ||