#include <linux/trace_clock.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/kobject.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/printk.h>
#include <linux/string.h>
#include <linux/sysfs.h>
#include <linux/completion.h>
static ulong delay = …;
static char test_mode[12] = …;
static uint burst_size = …;
static int cpu_affinity = …;
module_param_named(delay, delay, ulong, 0444);
module_param_string(…);
module_param_named(burst_size, burst_size, uint, 0444);
module_param_named(cpu_affinity, cpu_affinity, int, 0444);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
static struct completion done;
static void busy_wait(ulong time)
{ … }
static __always_inline void irqoff_test(void)
{ … }
static __always_inline void preemptoff_test(void)
{ … }
static void execute_preemptirqtest(int idx)
{ … }
#define DECLARE_TESTFN(POSTFIX) … \
DECLARE_TESTFN(0)
DECLARE_TESTFN(1)
DECLARE_TESTFN(2)
DECLARE_TESTFN(3)
DECLARE_TESTFN(4)
DECLARE_TESTFN(5)
DECLARE_TESTFN(6)
DECLARE_TESTFN(7)
DECLARE_TESTFN(8)
DECLARE_TESTFN(9)
static void (*testfuncs[])(int) = …;
#define NR_TEST_FUNCS …
static int preemptirq_delay_run(void *data)
{ … }
static int preemptirq_run_test(void)
{ … }
static ssize_t trigger_store(struct kobject *kobj, struct kobj_attribute *attr,
const char *buf, size_t count)
{ … }
static struct kobj_attribute trigger_attribute = …;
static struct attribute *attrs[] = …;
static struct attribute_group attr_group = …;
static struct kobject *preemptirq_delay_kobj;
static int __init preemptirq_delay_init(void)
{ … }
static void __exit preemptirq_delay_exit(void)
{ … }
module_init(preemptirq_delay_init)
module_exit(preemptirq_delay_exit)
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;