summaryrefslogtreecommitdiff
path: root/packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch
diff options
context:
space:
mode:
authorSergey Lapin <slapinid@gmail.com>2008-03-03 11:19:39 +0000
committerSergey Lapin <slapinid@gmail.com>2008-03-03 11:19:39 +0000
commit07c0de10dddece15b5a88e76ec94a9abc985b9cd (patch)
tree340de59696786aaa35070e7615700bf0bb491833 /packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch
parentfd03b5166557844135feef144c2d78470f71f7e6 (diff)
parent34c6339ee471446c0231675f9fc83d4a419d53c3 (diff)
merge of '6bfc098b36170550230dc57120c75b31480dc6b3'
and 'abcca41fb7edac5318b0cb0266d5f0c167f87c2f'
Diffstat (limited to 'packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch')
-rw-r--r--packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch b/packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch
new file mode 100644
index 0000000000..e6aefb997c
--- /dev/null
+++ b/packages/linux/gumstix-kernel-2.6.21/misalignment-handling.patch
@@ -0,0 +1,38 @@
+Change the default alingment handling to not be silent failure
+Index: linux-2.6.21gum/arch/arm/mm/alignment.c
+===================================================================
+--- linux-2.6.21gum.orig/arch/arm/mm/alignment.c
++++ linux-2.6.21gum/arch/arm/mm/alignment.c
+@@ -797,6 +797,8 @@ static int __init alignment_init(void)
+ res->write_proc = proc_alignment_write;
+ #endif
+
++ ai_usermode = CONFIG_ALIGNMENT_HANDLING;
++
+ hook_fault_code(1, do_alignment, SIGILL, "alignment exception");
+ hook_fault_code(3, do_alignment, SIGILL, "alignment exception");
+
+Index: linux-2.6.21gum/arch/arm/Kconfig
+===================================================================
+--- linux-2.6.21gum.orig/arch/arm/Kconfig
++++ linux-2.6.21gum/arch/arm/Kconfig
+@@ -709,6 +709,19 @@ config ALIGNMENT_TRAP
+ correct operation of some network protocols. With an IP-only
+ configuration it is safe to say N, otherwise say Y.
+
++config ALIGNMENT_HANDLING
++ hex "Userspace alignment trap handling"
++ default "0x3"
++ depends on ALIGNMENT_TRAP
++ help
++ How should we handle alignment errors in userspace by default? This is a bitfield where:
++ 0 - silently ignore alignment errors (will lead to unexpected results)
++ 1 - report alignment errors through printk (will lead to unexpected results, but you'll know about them)
++ 2 - fix the alignment and make things work properly (performance degradation for un-aligned code)
++ 4 - raise SIGBUS on alignment traps
++ A good number to choose is probably either 3 (work slowly but log message) or 5 (log message and SIGBUS).
++ You can change the behavior at runtime through /proc/cpu/alignment if you have PROC_FS enabled.
++
+ endmenu
+
+ menu "Boot options"