]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sysctl: Enable PARISC "unaligned-trap" to be used cross-arch
authorVineet Gupta <vgupta@synopsys.com>
Fri, 18 Jan 2013 09:42:24 +0000 (15:12 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Fri, 15 Feb 2013 17:46:05 +0000 (23:16 +0530)
PARISC defines /proc/sys/kernel/unaligned-trap to runtime toggle
unaligned access emulation.

The exact mechanics of enablig/disabling are still arch specific, we can
make the sysctl usable by other arches.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Helge Deller <deller@gmx.de>
Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
Cc: Helge Deller <deller@gmx.de>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Serge Hallyn <serge.hallyn@canonical.com>
arch/parisc/Kconfig
init/Kconfig
kernel/sysctl.c

index b77feffbadea9b91f46d85be47d35a0f49d4b2f4..8c7609539717b866ad5683b37319698eabff1901 100644 (file)
@@ -20,6 +20,7 @@ config PARISC
        select ARCH_HAVE_NMI_SAFE_CMPXCHG
        select GENERIC_SMP_IDLE_THREAD
        select GENERIC_STRNCPY_FROM_USER
+       select SYSCTL_ARCH_UNALIGN_ALLOW
        select HAVE_MOD_ARCH_SPECIFIC
        select MODULES_USE_ELF_RELA
        select CLONE_BACKWARDS
index be8b7f55312d1f0ea3cbb64c342eb5b456ea34a1..01180da49addd1a13dc43470bab3858368b1da49 100644 (file)
@@ -1232,6 +1232,14 @@ config SYSCTL_EXCEPTION_TRACE
        help
          Enable support for /proc/sys/debug/exception-trace.
 
+config SYSCTL_ARCH_UNALIGN_ALLOW
+       bool
+       help
+         Enable support for /proc/sys/kernel/unaligned-trap
+         Allows arches to define/use @unaligned_enabled to runtime toggle
+         the unaligned access emulation.
+         see arch/parisc/kernel/unaligned.c for reference
+
 config KALLSYMS
         bool "Load all symbols for debugging/ksymoops" if EXPERT
         default y
index c88878db491e44bd2b5a5ea7f381fc7242187727..878b4c41cfb741734f2962b0ab07ae90aceed711 100644 (file)
@@ -157,6 +157,9 @@ extern int sysctl_tsb_ratio;
 
 #ifdef __hppa__
 extern int pwrsw_enabled;
+#endif
+
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
 extern int unaligned_enabled;
 #endif
 
@@ -545,6 +548,8 @@ static struct ctl_table kern_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_dointvec,
        },
+#endif
+#ifdef CONFIG_SYSCTL_ARCH_UNALIGN_ALLOW
        {
                .procname       = "unaligned-trap",
                .data           = &unaligned_enabled,