aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/system.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/x86/include/asm/system.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/x86/include/asm/system.h')
-rw-r--r--arch/x86/include/asm/system.h87
1 files changed, 71 insertions, 16 deletions
diff --git a/arch/x86/include/asm/system.h b/arch/x86/include/asm/system.h
index 33ecc3ea8782..c2ff2a1d845e 100644
--- a/arch/x86/include/asm/system.h
+++ b/arch/x86/include/asm/system.h
@@ -98,8 +98,6 @@ do { \
98 */ 98 */
99#define HAVE_DISABLE_HLT 99#define HAVE_DISABLE_HLT
100#else 100#else
101#define __SAVE(reg, offset) "movq %%" #reg ",(14-" #offset ")*8(%%rsp)\n\t"
102#define __RESTORE(reg, offset) "movq (14-" #offset ")*8(%%rsp),%%" #reg "\n\t"
103 101
104/* frame pointer must be last for get_wchan */ 102/* frame pointer must be last for get_wchan */
105#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t" 103#define SAVE_CONTEXT "pushf ; pushq %%rbp ; movq %%rsi,%%rbp\n\t"
@@ -305,24 +303,81 @@ static inline void native_wbinvd(void)
305#ifdef CONFIG_PARAVIRT 303#ifdef CONFIG_PARAVIRT
306#include <asm/paravirt.h> 304#include <asm/paravirt.h>
307#else 305#else
308#define read_cr0() (native_read_cr0()) 306
309#define write_cr0(x) (native_write_cr0(x)) 307static inline unsigned long read_cr0(void)
310#define read_cr2() (native_read_cr2()) 308{
311#define write_cr2(x) (native_write_cr2(x)) 309 return native_read_cr0();
312#define read_cr3() (native_read_cr3()) 310}
313#define write_cr3(x) (native_write_cr3(x)) 311
314#define read_cr4() (native_read_cr4()) 312static inline void write_cr0(unsigned long x)
315#define read_cr4_safe() (native_read_cr4_safe()) 313{
316#define write_cr4(x) (native_write_cr4(x)) 314 native_write_cr0(x);
317#define wbinvd() (native_wbinvd()) 315}
316
317static inline unsigned long read_cr2(void)
318{
319 return native_read_cr2();
320}
321
322static inline void write_cr2(unsigned long x)
323{
324 native_write_cr2(x);
325}
326
327static inline unsigned long read_cr3(void)
328{
329 return native_read_cr3();
330}
331
332static inline void write_cr3(unsigned long x)
333{
334 native_write_cr3(x);
335}
336
337static inline unsigned long read_cr4(void)
338{
339 return native_read_cr4();
340}
341
342static inline unsigned long read_cr4_safe(void)
343{
344 return native_read_cr4_safe();
345}
346
347static inline void write_cr4(unsigned long x)
348{
349 native_write_cr4(x);
350}
351
352static inline void wbinvd(void)
353{
354 native_wbinvd();
355}
356
318#ifdef CONFIG_X86_64 357#ifdef CONFIG_X86_64
319#define read_cr8() (native_read_cr8()) 358
320#define write_cr8(x) (native_write_cr8(x)) 359static inline unsigned long read_cr8(void)
321#define load_gs_index native_load_gs_index 360{
361 return native_read_cr8();
362}
363
364static inline void write_cr8(unsigned long x)
365{
366 native_write_cr8(x);
367}
368
369static inline void load_gs_index(unsigned selector)
370{
371 native_load_gs_index(selector);
372}
373
322#endif 374#endif
323 375
324/* Clear the 'TS' bit */ 376/* Clear the 'TS' bit */
325#define clts() (native_clts()) 377static inline void clts(void)
378{
379 native_clts();
380}
326 381
327#endif/* CONFIG_PARAVIRT */ 382#endif/* CONFIG_PARAVIRT */
328 383