2 * include/asm-s390/sigp.h
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com),
7 * Martin Schwidefsky (schwidefsky@de.ibm.com)
9 * sigp.h by D.J. Barrow (c) IBM 1999
10 * contains routines / structures for signalling other S/390 processors in an
17 #include <asm/ptrace.h>
18 #include <asm/atomic.h>
20 /* get real cpu address from logical cpu number */
21 extern volatile int __cpu_logical_map[];
28 sigp_emergency_signal,
34 sigp_stop_and_store_status,
36 sigp_initial_cpu_reset,
39 sigp_store_status_at_address,
40 sigp_store_extended_status_at_address
43 typedef __u32 sigp_status_word;
47 sigp_order_code_accepted=0,
55 * Definitions for the external call
58 /* 'Bit' signals, asynchronous */
69 extern __inline__ sigp_ccode
70 signal_processor(__u16 cpu_addr, sigp_order_code order_code)
76 " sr 1,1\n" /* parameter=0 in gpr 1 */
81 " sgr 1,1\n" /* parameter=0 in gpr 1 */
85 #endif /* __s390x__ */
87 : "d" (__cpu_logical_map[cpu_addr]), "a" (order_code)
88 : "cc" , "memory", "1" );
93 * Signal processor with parameter
95 extern __inline__ sigp_ccode
96 signal_processor_p(unsigned long parameter,__u16 cpu_addr,
97 sigp_order_code order_code)
101 __asm__ __volatile__(
103 " lr 1,%1\n" /* parameter in gpr 1 */
107 #else /* __s390x__ */
108 " lgr 1,%1\n" /* parameter in gpr 1 */
112 #endif /* __s390x__ */
114 : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]),
116 : "cc" , "memory", "1" );
121 * Signal processor with parameter and return status
123 extern __inline__ sigp_ccode
124 signal_processor_ps(unsigned long *statusptr, unsigned long parameter,
125 __u16 cpu_addr, sigp_order_code order_code)
129 __asm__ __volatile__(
131 " sr 2,2\n" /* clear status so it doesn't contain rubbish if not saved. */
132 " lr 3,%2\n" /* parameter in gpr 3 */
137 #else /* __s390x__ */
138 " sgr 2,2\n" /* clear status so it doesn't contain rubbish if not saved. */
139 " lgr 3,%2\n" /* parameter in gpr 3 */
144 #endif /* __s390x__ */
145 : "=d" (ccode), "=m" (*statusptr)
146 : "d" (parameter), "d" (__cpu_logical_map[cpu_addr]),
148 : "cc" , "memory", "2" , "3"
153 #endif /* __SIGP__ */