11 #include <linux/module.h>
12 #include <linux/kernel.h>
18 #include <asm/processor.h>
20 static unsigned long se_user;
21 static unsigned long se_sys;
22 static unsigned long se_half;
23 static unsigned long se_word;
24 static unsigned long se_dword;
25 static unsigned long se_multi;
30 static int se_kernmode_warn;
70 unsigned int action = se_usermode;
86 (
unsigned int __user *)addr);
101 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
102 tsk->
comm, task_pid_nr(tsk),
104 else if (se_kernmode_warn)
106 "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n",
107 tsk->
comm, task_pid_nr(tsk),
111 static const char *se_usermode_action[] = {
120 static int alignment_proc_show(
struct seq_file *
m,
void *
v)
128 seq_printf(m,
"User faults:\t%i (%s)\n", se_usermode,
129 se_usermode_action[se_usermode]);
130 seq_printf(m,
"Kernel faults:\t%i (fixup%s)\n", se_kernmode_warn,
131 se_kernmode_warn ?
"+warn" :
"");
143 int *
data = PDE(file->
f_path.dentry->d_inode)->data;
149 if (mode >=
'0' && mode <=
'5')
157 .open = alignment_proc_open,
161 .write = alignment_proc_write,
170 static int __init alignment_init(
void)
179 &alignment_proc_fops, &se_usermode);
184 &alignment_proc_fops, &se_kernmode_warn);