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