diff options
-rw-r--r-- | include/asm-i386/system.h | 21 | ||||
-rw-r--r-- | include/asm-m68knommu/uaccess.h | 12 |
2 files changed, 16 insertions, 17 deletions
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h index db398d88b1d9..2db168ef949f 100644 --- a/include/asm-i386/system.h +++ b/include/asm-i386/system.h | |||
@@ -82,10 +82,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
82 | #define savesegment(seg, value) \ | 82 | #define savesegment(seg, value) \ |
83 | asm volatile("mov %%" #seg ",%0":"=rm" (value)) | 83 | asm volatile("mov %%" #seg ",%0":"=rm" (value)) |
84 | 84 | ||
85 | /* | ||
86 | * Clear and set 'TS' bit respectively | ||
87 | */ | ||
88 | #define clts() __asm__ __volatile__ ("clts") | ||
89 | #define read_cr0() ({ \ | 85 | #define read_cr0() ({ \ |
90 | unsigned int __dummy; \ | 86 | unsigned int __dummy; \ |
91 | __asm__ __volatile__( \ | 87 | __asm__ __volatile__( \ |
@@ -94,7 +90,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
94 | __dummy; \ | 90 | __dummy; \ |
95 | }) | 91 | }) |
96 | #define write_cr0(x) \ | 92 | #define write_cr0(x) \ |
97 | __asm__ __volatile__("movl %0,%%cr0": :"r" (x)); | 93 | __asm__ __volatile__("movl %0,%%cr0": :"r" (x)) |
98 | 94 | ||
99 | #define read_cr2() ({ \ | 95 | #define read_cr2() ({ \ |
100 | unsigned int __dummy; \ | 96 | unsigned int __dummy; \ |
@@ -104,7 +100,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
104 | __dummy; \ | 100 | __dummy; \ |
105 | }) | 101 | }) |
106 | #define write_cr2(x) \ | 102 | #define write_cr2(x) \ |
107 | __asm__ __volatile__("movl %0,%%cr2": :"r" (x)); | 103 | __asm__ __volatile__("movl %0,%%cr2": :"r" (x)) |
108 | 104 | ||
109 | #define read_cr3() ({ \ | 105 | #define read_cr3() ({ \ |
110 | unsigned int __dummy; \ | 106 | unsigned int __dummy; \ |
@@ -114,7 +110,7 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
114 | __dummy; \ | 110 | __dummy; \ |
115 | }) | 111 | }) |
116 | #define write_cr3(x) \ | 112 | #define write_cr3(x) \ |
117 | __asm__ __volatile__("movl %0,%%cr3": :"r" (x)); | 113 | __asm__ __volatile__("movl %0,%%cr3": :"r" (x)) |
118 | 114 | ||
119 | #define read_cr4() ({ \ | 115 | #define read_cr4() ({ \ |
120 | unsigned int __dummy; \ | 116 | unsigned int __dummy; \ |
@@ -123,7 +119,6 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
123 | :"=r" (__dummy)); \ | 119 | :"=r" (__dummy)); \ |
124 | __dummy; \ | 120 | __dummy; \ |
125 | }) | 121 | }) |
126 | |||
127 | #define read_cr4_safe() ({ \ | 122 | #define read_cr4_safe() ({ \ |
128 | unsigned int __dummy; \ | 123 | unsigned int __dummy; \ |
129 | /* This could fault if %cr4 does not exist */ \ | 124 | /* This could fault if %cr4 does not exist */ \ |
@@ -135,15 +130,19 @@ __asm__ __volatile__ ("movw %%dx,%1\n\t" \ | |||
135 | : "=r" (__dummy): "0" (0)); \ | 130 | : "=r" (__dummy): "0" (0)); \ |
136 | __dummy; \ | 131 | __dummy; \ |
137 | }) | 132 | }) |
138 | |||
139 | #define write_cr4(x) \ | 133 | #define write_cr4(x) \ |
140 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)); | 134 | __asm__ __volatile__("movl %0,%%cr4": :"r" (x)) |
135 | |||
136 | /* | ||
137 | * Clear and set 'TS' bit respectively | ||
138 | */ | ||
139 | #define clts() __asm__ __volatile__ ("clts") | ||
141 | #define stts() write_cr0(8 | read_cr0()) | 140 | #define stts() write_cr0(8 | read_cr0()) |
142 | 141 | ||
143 | #endif /* __KERNEL__ */ | 142 | #endif /* __KERNEL__ */ |
144 | 143 | ||
145 | #define wbinvd() \ | 144 | #define wbinvd() \ |
146 | __asm__ __volatile__ ("wbinvd": : :"memory"); | 145 | __asm__ __volatile__ ("wbinvd": : :"memory") |
147 | 146 | ||
148 | static inline unsigned long get_limit(unsigned long segment) | 147 | static inline unsigned long get_limit(unsigned long segment) |
149 | { | 148 | { |
diff --git a/include/asm-m68knommu/uaccess.h b/include/asm-m68knommu/uaccess.h index 05be9515a2d2..62b29b10bc6d 100644 --- a/include/asm-m68knommu/uaccess.h +++ b/include/asm-m68knommu/uaccess.h | |||
@@ -93,7 +93,7 @@ extern int __put_user_bad(void); | |||
93 | #define get_user(x, ptr) \ | 93 | #define get_user(x, ptr) \ |
94 | ({ \ | 94 | ({ \ |
95 | int __gu_err = 0; \ | 95 | int __gu_err = 0; \ |
96 | typeof(*(ptr)) __gu_val = 0; \ | 96 | typeof(x) __gu_val = 0; \ |
97 | switch (sizeof(*(ptr))) { \ | 97 | switch (sizeof(*(ptr))) { \ |
98 | case 1: \ | 98 | case 1: \ |
99 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ | 99 | __get_user_asm(__gu_err, __gu_val, ptr, b, "=d"); \ |
@@ -105,23 +105,23 @@ extern int __put_user_bad(void); | |||
105 | __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ | 105 | __get_user_asm(__gu_err, __gu_val, ptr, l, "=r"); \ |
106 | break; \ | 106 | break; \ |
107 | case 8: \ | 107 | case 8: \ |
108 | memcpy(&__gu_val, ptr, sizeof (*(ptr))); \ | 108 | memcpy((void *) &__gu_val, ptr, sizeof (*(ptr))); \ |
109 | break; \ | 109 | break; \ |
110 | default: \ | 110 | default: \ |
111 | __gu_val = 0; \ | 111 | __gu_val = 0; \ |
112 | __gu_err = __get_user_bad(); \ | 112 | __gu_err = __get_user_bad(); \ |
113 | break; \ | 113 | break; \ |
114 | } \ | 114 | } \ |
115 | (x) = __gu_val; \ | 115 | (x) = (typeof(*(ptr))) __gu_val; \ |
116 | __gu_err; \ | 116 | __gu_err; \ |
117 | }) | 117 | }) |
118 | #define __get_user(x, ptr) get_user(x, ptr) | 118 | #define __get_user(x, ptr) get_user(x, ptr) |
119 | 119 | ||
120 | extern int __get_user_bad(void); | 120 | extern int __get_user_bad(void); |
121 | 121 | ||
122 | #define __get_user_asm(err,x,ptr,bwl,reg) \ | 122 | #define __get_user_asm(err,x,ptr,bwl,reg) \ |
123 | __asm__ ("move" #bwl " %1,%0" \ | 123 | __asm__ ("move" #bwl " %1,%0" \ |
124 | : "=d" (x) \ | 124 | : "=d" (x) \ |
125 | : "m" (*__ptr(ptr))) | 125 | : "m" (*__ptr(ptr))) |
126 | 126 | ||
127 | #define copy_from_user(to, from, n) (memcpy(to, from, n), 0) | 127 | #define copy_from_user(to, from, n) (memcpy(to, from, n), 0) |