Lines 14-19
Link Here
|
14 |
#include <linux/delay.h> |
14 |
#include <linux/delay.h> |
15 |
#include <linux/smp_lock.h> |
15 |
#include <linux/smp_lock.h> |
16 |
#include <linux/module.h> |
16 |
#include <linux/module.h> |
|
|
17 |
#include <linux/sysctl.h> |
17 |
#include <linux/init.h> |
18 |
#include <linux/init.h> |
18 |
#include <linux/kallsyms.h> |
19 |
#include <linux/kallsyms.h> |
19 |
|
20 |
|
Lines 102-107
static char * ireg_name[] = {"v0", "t0",
Link Here
|
102 |
"t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"}; |
103 |
"t10", "t11", "ra", "pv", "at", "gp", "sp", "zero"}; |
103 |
#endif |
104 |
#endif |
104 |
|
105 |
|
|
|
106 |
#ifdef CONFIG_ALPHA_UAC_SYSCTL |
107 |
/* /proc/sys/kernel/uac */ |
108 |
enum |
109 |
{ |
110 |
/* UAC policy on Alpha */ |
111 |
KERN_UAC_NOPRINT=1, /* int: printk() on unaligned access */ |
112 |
KERN_UAC_SIGBUS=2, /* int: send SIGBUS on unaligned access */ |
113 |
KERN_UAC_NOFIX=3, /* int: don't fix the unaligned access */ |
114 |
}; |
115 |
|
116 |
static int enabled_noprint = 0; |
117 |
static int enabled_sigbus = 0; |
118 |
static int enabled_nofix = 0; |
119 |
|
120 |
ctl_table uac_table[] = { |
121 |
{KERN_UAC_NOPRINT, "noprint", &enabled_noprint, sizeof (int), 0644, NULL, NULL, &proc_dointvec}, |
122 |
{KERN_UAC_SIGBUS, "sigbus", &enabled_sigbus, sizeof (int), 0644, NULL, NULL, &proc_dointvec}, |
123 |
{KERN_UAC_NOFIX, "nofix", &enabled_nofix, sizeof (int), 0644, NULL, NULL, &proc_dointvec}, |
124 |
{0} |
125 |
}; |
126 |
|
127 |
static int __init init_uac_sysctl(void) |
128 |
{ |
129 |
/* Initialize sysctls with the #defined UAC policy */ |
130 |
enabled_noprint = (test_thread_flag (TIF_UAC_NOPRINT)) ? 1 : 0; |
131 |
enabled_sigbus = (test_thread_flag (TIF_UAC_SIGBUS)) ? 1 : 0; |
132 |
enabled_nofix = (test_thread_flag (TIF_UAC_NOFIX)) ? 1 : 0; |
133 |
return 0; |
134 |
} |
135 |
#endif |
136 |
|
105 |
static void |
137 |
static void |
106 |
dik_show_code(unsigned int *pc) |
138 |
dik_show_code(unsigned int *pc) |
107 |
{ |
139 |
{ |
Lines 780-786
do_entUnaUser(void __user * va, unsigned
Link Here
|
780 |
/* Check the UAC bits to decide what the user wants us to do |
812 |
/* Check the UAC bits to decide what the user wants us to do |
781 |
with the unaliged access. */ |
813 |
with the unaliged access. */ |
782 |
|
814 |
|
|
|
815 |
#ifndef CONFIG_ALPHA_UAC_SYSCTL |
783 |
if (!test_thread_flag (TIF_UAC_NOPRINT)) { |
816 |
if (!test_thread_flag (TIF_UAC_NOPRINT)) { |
|
|
817 |
#else /* CONFIG_ALPHA_UAC_SYSCTL */ |
818 |
if (!(enabled_noprint)) { |
819 |
#endif /* CONFIG_ALPHA_UAC_SYSCTL */ |
784 |
if (cnt >= 5 && jiffies - last_time > 5*HZ) { |
820 |
if (cnt >= 5 && jiffies - last_time > 5*HZ) { |
785 |
cnt = 0; |
821 |
cnt = 0; |
786 |
} |
822 |
} |
Lines 791-800
do_entUnaUser(void __user * va, unsigned
Link Here
|
791 |
} |
827 |
} |
792 |
last_time = jiffies; |
828 |
last_time = jiffies; |
793 |
} |
829 |
} |
|
|
830 |
#ifndef CONFIG_ALPHA_UAC_SYSCTL |
794 |
if (test_thread_flag (TIF_UAC_SIGBUS)) |
831 |
if (test_thread_flag (TIF_UAC_SIGBUS)) |
|
|
832 |
#else /* CONFIG_ALPHA_UAC_SYSCTL */ |
833 |
if (enabled_sigbus) |
834 |
#endif /* CONFIG_ALPHA_UAC_SYSCTL */ |
795 |
goto give_sigbus; |
835 |
goto give_sigbus; |
796 |
/* Not sure why you'd want to use this, but... */ |
836 |
/* Not sure why you'd want to use this, but... */ |
|
|
837 |
#ifndef CONFIG_ALPHA_UAC_SYSCTL |
797 |
if (test_thread_flag (TIF_UAC_NOFIX)) |
838 |
if (test_thread_flag (TIF_UAC_NOFIX)) |
|
|
839 |
#else /* CONFIG_ALPHA_UAC_SYSCTL */ |
840 |
if (enabled_nofix) |
841 |
#endif /* CONFIG_ALPHA_UAC_SYSCTL */ |
798 |
return; |
842 |
return; |
799 |
|
843 |
|
800 |
/* Don't bother reading ds in the access check since we already |
844 |
/* Don't bother reading ds in the access check since we already |
Lines 1089-1091
trap_init(void)
Link Here
|
1089 |
wrent(entSys, 5); |
1133 |
wrent(entSys, 5); |
1090 |
wrent(entDbg, 6); |
1134 |
wrent(entDbg, 6); |
1091 |
} |
1135 |
} |
|
|
1136 |
|
1137 |
#ifdef CONFIG_ALPHA_UAC_SYSCTL |
1138 |
__initcall(init_uac_sysctl); |
1139 |
#endif |