summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/include/linux/stop_machine.h
blob: 0f3def34a1f2805795c524b3157682af2d5a0271 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Public domain. */

#ifndef _LINUX_STOP_MACHINE_H
#define _LINUX_STOP_MACHINE_H

#include <machine/intr.h>

typedef int (*cpu_stop_fn_t)(void *arg);

static inline int
stop_machine(cpu_stop_fn_t fn, void *arg, void *cpus)
{
	int r;
	u_long s = intr_disable();
	r = (*fn)(arg);
	intr_restore(s);
	return r;
}

#endif