diff options
Diffstat (limited to 'include/asm-s390/system.h')
-rw-r--r-- | include/asm-s390/system.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/include/asm-s390/system.h b/include/asm-s390/system.h index 81514d76edcf..b4a9f05a93d6 100644 --- a/include/asm-s390/system.h +++ b/include/asm-s390/system.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <asm/types.h> | 16 | #include <asm/types.h> |
17 | #include <asm/ptrace.h> | 17 | #include <asm/ptrace.h> |
18 | #include <asm/setup.h> | 18 | #include <asm/setup.h> |
19 | #include <asm/processor.h> | ||
19 | 20 | ||
20 | #ifdef __KERNEL__ | 21 | #ifdef __KERNEL__ |
21 | 22 | ||
@@ -103,29 +104,18 @@ static inline void restore_access_regs(unsigned int *acrs) | |||
103 | prev = __switch_to(prev,next); \ | 104 | prev = __switch_to(prev,next); \ |
104 | } while (0) | 105 | } while (0) |
105 | 106 | ||
106 | #define prepare_arch_switch(rq, next) do { } while(0) | ||
107 | #define task_running(rq, p) ((rq)->curr == (p)) | ||
108 | |||
109 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | 107 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING |
110 | extern void account_user_vtime(struct task_struct *); | 108 | extern void account_user_vtime(struct task_struct *); |
111 | extern void account_system_vtime(struct task_struct *); | 109 | extern void account_system_vtime(struct task_struct *); |
112 | |||
113 | #define finish_arch_switch(rq, prev) do { \ | ||
114 | set_fs(current->thread.mm_segment); \ | ||
115 | spin_unlock(&(rq)->lock); \ | ||
116 | account_system_vtime(prev); \ | ||
117 | local_irq_enable(); \ | ||
118 | } while (0) | ||
119 | |||
120 | #else | 110 | #else |
111 | #define account_system_vtime(prev) do { } while (0) | ||
112 | #endif | ||
121 | 113 | ||
122 | #define finish_arch_switch(rq, prev) do { \ | 114 | #define finish_arch_switch(rq, prev) do { \ |
123 | set_fs(current->thread.mm_segment); \ | 115 | set_fs(current->thread.mm_segment); \ |
124 | spin_unlock_irq(&(rq)->lock); \ | 116 | account_system_vtime(prev); \ |
125 | } while (0) | 117 | } while (0) |
126 | 118 | ||
127 | #endif | ||
128 | |||
129 | #define nop() __asm__ __volatile__ ("nop") | 119 | #define nop() __asm__ __volatile__ ("nop") |
130 | 120 | ||
131 | #define xchg(ptr,x) \ | 121 | #define xchg(ptr,x) \ |
@@ -331,9 +321,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
331 | 321 | ||
332 | #ifdef __s390x__ | 322 | #ifdef __s390x__ |
333 | 323 | ||
334 | #define __load_psw(psw) \ | ||
335 | __asm__ __volatile__("lpswe 0(%0)" : : "a" (&psw), "m" (psw) : "cc" ); | ||
336 | |||
337 | #define __ctl_load(array, low, high) ({ \ | 324 | #define __ctl_load(array, low, high) ({ \ |
338 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 325 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
339 | __asm__ __volatile__ ( \ | 326 | __asm__ __volatile__ ( \ |
@@ -390,9 +377,6 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
390 | 377 | ||
391 | #else /* __s390x__ */ | 378 | #else /* __s390x__ */ |
392 | 379 | ||
393 | #define __load_psw(psw) \ | ||
394 | __asm__ __volatile__("lpsw 0(%0)" : : "a" (&psw) : "cc" ); | ||
395 | |||
396 | #define __ctl_load(array, low, high) ({ \ | 380 | #define __ctl_load(array, low, high) ({ \ |
397 | typedef struct { char _[sizeof(array)]; } addrtype; \ | 381 | typedef struct { char _[sizeof(array)]; } addrtype; \ |
398 | __asm__ __volatile__ ( \ | 382 | __asm__ __volatile__ ( \ |
@@ -451,6 +435,20 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
451 | /* For spinlocks etc */ | 435 | /* For spinlocks etc */ |
452 | #define local_irq_save(x) ((x) = local_irq_disable()) | 436 | #define local_irq_save(x) ((x) = local_irq_disable()) |
453 | 437 | ||
438 | /* | ||
439 | * Use to set psw mask except for the first byte which | ||
440 | * won't be changed by this function. | ||
441 | */ | ||
442 | static inline void | ||
443 | __set_psw_mask(unsigned long mask) | ||
444 | { | ||
445 | local_save_flags(mask); | ||
446 | __load_psw_mask(mask); | ||
447 | } | ||
448 | |||
449 | #define local_mcck_enable() __set_psw_mask(PSW_KERNEL_BITS) | ||
450 | #define local_mcck_disable() __set_psw_mask(PSW_KERNEL_BITS & ~PSW_MASK_MCHECK) | ||
451 | |||
454 | #ifdef CONFIG_SMP | 452 | #ifdef CONFIG_SMP |
455 | 453 | ||
456 | extern void smp_ctl_set_bit(int cr, int bit); | 454 | extern void smp_ctl_set_bit(int cr, int bit); |