2 * Routines and structures for signalling other processors.
4 * Copyright IBM Corp. 1999,2010
5 * Author(s): Denis Joseph Barrow,
6 * Martin Schwidefsky <schwidefsky@de.ibm.com>,
7 * Heiko Carstens <heiko.carstens@de.ibm.com>,
13 #include <asm/system.h>
15 /* Get real cpu address from logical cpu number. */
16 extern unsigned short __cpu_logical_map
[];
18 static inline int cpu_logical_map(int cpu
)
21 return __cpu_logical_map
[cpu
];
31 sigp_emergency_signal
,
37 sigp_stop_and_store_status
,
39 sigp_initial_cpu_reset
,
42 sigp_store_status_at_address
,
43 sigp_store_extended_status_at_address
47 sigp_order_code_accepted
=0,
54 * Definitions for external call.
59 ec_call_function_single
,
66 static inline int raw_sigp(u16 cpu
, int order
)
68 register unsigned long reg1
asm ("1") = 0;
76 : "d" (reg1
), "d" (cpu
),
77 "a" (order
) : "cc" , "memory");
82 * Signal processor with parameter.
84 static inline int raw_sigp_p(u32 parameter
, u16 cpu
, int order
)
86 register unsigned int reg1
asm ("1") = parameter
;
94 : "d" (reg1
), "d" (cpu
),
95 "a" (order
) : "cc" , "memory");
100 * Signal processor with parameter and return status.
102 static inline int raw_sigp_ps(u32
*status
, u32 parm
, u16 cpu
, int order
)
104 register unsigned int reg1
asm ("1") = parm
;
108 " sigp %1,%2,0(%3)\n"
111 : "=d" (ccode
), "+d" (reg1
)
112 : "d" (cpu
), "a" (order
)
118 static inline int sigp(int cpu
, int order
)
120 return raw_sigp(cpu_logical_map(cpu
), order
);
123 static inline int sigp_p(u32 parameter
, int cpu
, int order
)
125 return raw_sigp_p(parameter
, cpu_logical_map(cpu
), order
);
128 static inline int sigp_ps(u32
*status
, u32 parm
, int cpu
, int order
)
130 return raw_sigp_ps(status
, parm
, cpu_logical_map(cpu
), order
);
133 #endif /* __ASM_SIGP_H */