Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm32 Add a machdep.unaligned_sigbus sysctl (ju...



details:   https://anonhg.NetBSD.org/src/rev/dd886dde7505
branches:  trunk
changeset: 333851:dd886dde7505
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 19 10:01:50 2014 +0000

description:
Add a machdep.unaligned_sigbus sysctl (just like alpha does), but on
arm it is readonly (depends on architecture version).

diffstat:

 sys/arch/arm/arm32/arm32_machdep.c |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 8827fd84eb15 -r dd886dde7505 sys/arch/arm/arm32/arm32_machdep.c
--- a/sys/arch/arm/arm32/arm32_machdep.c        Wed Nov 19 08:10:01 2014 +0000
+++ b/sys/arch/arm/arm32/arm32_machdep.c        Wed Nov 19 10:01:50 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_machdep.c,v 1.107 2014/10/29 14:14:14 skrll Exp $        */
+/*     $NetBSD: arm32_machdep.c,v 1.108 2014/11/19 10:01:50 martin Exp $       */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.107 2014/10/29 14:14:14 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.108 2014/11/19 10:01:50 martin Exp $");
 
 #include "opt_modular.h"
 #include "opt_md.h"
@@ -108,6 +108,7 @@
 int cpu_simdex_present;
 int cpu_umull_present;
 int cpu_synchprim_present;
+int cpu_unaligned_sigbus;
 const char *cpu_arch = "";
 
 int cpu_instruction_set_attributes[6];
@@ -504,6 +505,13 @@
                       CTLTYPE_INT, "printfataltraps", NULL,
                       NULL, 0, &cpu_printfataltraps, 0,
                       CTL_MACHDEP, CTL_CREATE, CTL_EOL);
+       cpu_unaligned_sigbus = !CPU_IS_ARMV6_P() && !CPU_IS_ARMV7_P();
+       sysctl_createv(clog, 0, NULL, NULL,
+                      CTLFLAG_PERMANENT|CTLFLAG_READONLY,
+                      CTLTYPE_INT, "unaligned_sigbus",
+                      SYSCTL_DESCR("Do SIGBUS for fixed unaligned accesses"),
+                      NULL, 0, &cpu_unaligned_sigbus, 0,
+                      CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 
 
        /*



Home | Main Index | Thread Index | Old Index