mirror of
https://github.com/torvalds/linux
synced 2024-09-20 02:57:25 +00:00
s390/smp: use call_on_stack() macro
Reviewed-by: Sven Schnelle <svens@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
845370f47f
commit
0f541cc201
|
@ -300,24 +300,28 @@ static void pcpu_start_fn(struct pcpu *pcpu, void (*func)(void *), void *data)
|
||||||
pcpu_sigp_retry(pcpu, SIGP_RESTART, 0);
|
pcpu_sigp_retry(pcpu, SIGP_RESTART, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef void (pcpu_delegate_fn)(void *);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call function via PSW restart on pcpu and stop the current cpu.
|
* Call function via PSW restart on pcpu and stop the current cpu.
|
||||||
*/
|
*/
|
||||||
static void __pcpu_delegate(void (*func)(void*), void *data)
|
static void __pcpu_delegate(pcpu_delegate_fn *func, void *data)
|
||||||
{
|
{
|
||||||
func(data); /* should not return */
|
func(data); /* should not return */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __no_sanitize_address pcpu_delegate(struct pcpu *pcpu,
|
static void __no_sanitize_address pcpu_delegate(struct pcpu *pcpu,
|
||||||
void (*func)(void *),
|
pcpu_delegate_fn *func,
|
||||||
void *data, unsigned long stack)
|
void *data, unsigned long stack)
|
||||||
{
|
{
|
||||||
struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices];
|
struct lowcore *lc = lowcore_ptr[pcpu - pcpu_devices];
|
||||||
unsigned long source_cpu = stap();
|
unsigned long source_cpu = stap();
|
||||||
|
|
||||||
__load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_DAT);
|
__load_psw_mask(PSW_KERNEL_BITS | PSW_MASK_DAT);
|
||||||
if (pcpu->address == source_cpu)
|
if (pcpu->address == source_cpu) {
|
||||||
CALL_ON_STACK(__pcpu_delegate, stack, 2, func, data);
|
call_on_stack(2, stack, void, __pcpu_delegate,
|
||||||
|
pcpu_delegate_fn *, func, void *, data);
|
||||||
|
}
|
||||||
/* Stop target cpu (if func returns this stops the current cpu). */
|
/* Stop target cpu (if func returns this stops the current cpu). */
|
||||||
pcpu_sigp_retry(pcpu, SIGP_STOP, 0);
|
pcpu_sigp_retry(pcpu, SIGP_STOP, 0);
|
||||||
/* Restart func on the target cpu and stop the current cpu. */
|
/* Restart func on the target cpu and stop the current cpu. */
|
||||||
|
|
Loading…
Reference in a new issue