Debian Codegraph @

src/queuelat/targeted-ipi/targeted-ipi.c

raw symbols SCIP
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2018 Marcelo Tosatti <[email protected]>
4 * Copyright (C) 2019 John Kacur <[email protected]>
5 * Copyright (C) 2019 Clark Williams <[email protected]>
6 */
7
8 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
9
10 #include <linux/module.h>
11 #include <linux/kernel.h>
12 #include <linux/smp.h>
13 #include <asm-generic/delay.h>
14
15 static int ipidest;
16 module_param(ipidest, int, S_IRUGO);
17
18 /* number of ipis */
19 static int nripis;
20 module_param(nripis, int, S_IRUGO);
21
22 /* interval between consecutive IPI calls */
23 static int interval;
24 module_param(interval, int, S_IRUGO);
25
26 /* how many microseconds to delay in IPI handler */
27 static int delay;
28 module_param(delay, int, S_IRUGO);
29
30 static void ipi_handler(void *info)
31 {
32 udelay(interval);
33 }
34
35 static int targeted_ipi_init(void)
36 {
37 int ret, i;
38
39 for (i=0; i < nripis; i++)
40 {
41 ret = smp_call_function_single(ipidest, ipi_handler, NULL, 1);
42 if (ret) {
43 printk(KERN_ERR "i=%d smp_call_function_single ret=%d\n", i, ret);
44 return 0;
45 }
46 udelay(interval);
47 }
48
49 return 0;
50 }
51
52 static void targeted_ipi_exit(void)
53 {
54 }
55
56 module_init(targeted_ipi_init);
57 module_exit(targeted_ipi_exit);
58 MODULE_LICENSE("GPL");