diff options
Diffstat (limited to 'include/asm-i386/system.h')
-rw-r--r-- | include/asm-i386/system.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index 3db717a244f0..8048a5e018cd 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -107,13 +107,33 @@ static inline unsigned long _get_base(char * addr) | |||
107 | #define clts() __asm__ __volatile__ ("clts") | 107 | #define clts() __asm__ __volatile__ ("clts") |
108 | #define read_cr0() ({ \ | 108 | #define read_cr0() ({ \ |
109 | unsigned int __dummy; \ | 109 | unsigned int __dummy; \ |
110 | __asm__( \ | 110 | __asm__ __volatile__( \ |
111 | "movl %%cr0,%0\n\t" \ | 111 | "movl %%cr0,%0\n\t" \ |
112 | :"=r" (__dummy)); \ | 112 | :"=r" (__dummy)); \ |
113 | __dummy; \ | 113 | __dummy; \ |
114 | }) | 114 | }) |
115 | #define write_cr0(x) \ | 115 | #define write_cr0(x) \ |
116 | __asm__("movl %0,%%cr0": :"r" (x)); | 116 | __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); |
117 | |||
118 | #define read_cr2() ({ \ | ||
119 | unsigned int __dummy; \ | ||
120 | __asm__ __volatile__( \ | ||
121 | "movl %%cr2,%0\n\t" \ | ||
122 | :"=r" (__dummy)); \ | ||
123 | __dummy; \ | ||
124 | }) | ||
125 | #define write_cr2(x) \ | ||
126 | __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); | ||
127 | |||
128 | #define read_cr3() ({ \ | ||
129 | unsigned int __dummy; \ | ||
130 | __asm__ ( \ | ||
131 | "movl %%cr3,%0\n\t" \ | ||
132 | :"=r" (__dummy)); \ | ||
133 | __dummy; \ | ||
134 | }) | ||
135 | #define write_cr3(x) \ | ||
136 | __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); | ||
117 | 137 | ||
118 | #define read_cr4() ({ \ | 138 | #define read_cr4() ({ \ |
119 | unsigned int __dummy; \ | 139 | unsigned int __dummy; \ |
@@ -123,7 +143,7 @@ static inline unsigned long _get_base(char * addr) | |||
123 | __dummy; \ | 143 | __dummy; \ |
124 | }) | 144 | }) |
125 | #define write_cr4(x) \ | 145 | #define write_cr4(x) \ |
126 | __asm__("movl %0,%%cr4": :"r" (x)); | 146 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); |
127 | #define stts() write_cr0(8 | read_cr0()) | 147 | #define stts() write_cr0(8 | read_cr0()) |
128 | 148 | ||
129 | #endif /* __KERNEL__ */ | 149 | #endif /* __KERNEL__ */ |
@@ -447,6 +467,8 @@ struct alt_instr { | |||
447 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") | 467 | #define local_irq_enable() __asm__ __volatile__("sti": : :"memory") |
448 | /* used in the idle loop; sti takes one instruction cycle to complete */ | 468 | /* used in the idle loop; sti takes one instruction cycle to complete */ |
449 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") | 469 | #define safe_halt() __asm__ __volatile__("sti; hlt": : :"memory") |
470 | /* used when interrupts are already enabled or to shutdown the processor */ | ||
471 | #define halt() __asm__ __volatile__("hlt": : :"memory") | ||
450 | 472 | ||
451 | #define irqs_disabled() \ | 473 | #define irqs_disabled() \ |
452 | ({ \ | 474 | ({ \ |