diff options
author | marcel <marcel@FreeBSD.org> | 2003-05-29 06:30:36 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-05-29 06:30:36 +0000 |
commit | 355d7ef9c59f170221a0182ff54a187e7297b0ac (patch) | |
tree | d4507959b586ba2265ad9dbd58ffc46c97592128 /sys | |
parent | c050190f4872533abc1c4d29dcbd7f19c42cd0ef (diff) | |
download | FreeBSD-src-355d7ef9c59f170221a0182ff54a187e7297b0ac.zip FreeBSD-src-355d7ef9c59f170221a0182ff54a187e7297b0ac.tar.gz |
Move the sysctls of the misalignment handler to where they belong
and use OID_AUTO instead of fixed IDs.
Approved by: re@ (blanket)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ia64/ia64/machdep.c | 13 | ||||
-rw-r--r-- | sys/ia64/ia64/unaligned.c | 15 | ||||
-rw-r--r-- | sys/ia64/include/cpu.h | 16 |
3 files changed, 18 insertions, 26 deletions
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 65e98ff..cc6f407 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -124,19 +124,6 @@ SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, cpu_model, 0, ""); void *ksym_start, *ksym_end; #endif -int ia64_unaligned_print = 1; /* warn about unaligned accesses */ -int ia64_unaligned_fix = 1; /* fix up unaligned accesses */ -int ia64_unaligned_sigbus = 0; /* don't SIGBUS on fixed-up accesses */ - -SYSCTL_INT(_machdep, CPU_UNALIGNED_PRINT, unaligned_print, - CTLFLAG_RW, &ia64_unaligned_print, 0, ""); - -SYSCTL_INT(_machdep, CPU_UNALIGNED_FIX, unaligned_fix, - CTLFLAG_RW, &ia64_unaligned_fix, 0, ""); - -SYSCTL_INT(_machdep, CPU_UNALIGNED_SIGBUS, unaligned_sigbus, - CTLFLAG_RW, &ia64_unaligned_sigbus, 0, ""); - static void cpu_startup(void *); SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL) diff --git a/sys/ia64/ia64/unaligned.c b/sys/ia64/ia64/unaligned.c index 0ebc2db..3b15652 100644 --- a/sys/ia64/ia64/unaligned.c +++ b/sys/ia64/ia64/unaligned.c @@ -30,6 +30,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/proc.h> +#include <sys/sysctl.h> #include <vm/vm.h> #include <vm/vm_extern.h> #include <machine/frame.h> @@ -37,8 +38,18 @@ #define sign_extend(imm, w) (((int64_t)(imm) << (64 - (w))) >> (64 - (w))) -extern int ia64_unaligned_print, ia64_unaligned_fix; -extern int ia64_unaligned_sigbus; +static int ia64_unaligned_print = 1; /* warn about unaligned accesses */ +static int ia64_unaligned_fix = 1; /* fix up unaligned accesses */ +static int ia64_unaligned_sigbus = 0; /* don't SIGBUS on fixed-up accesses */ + +SYSCTL_INT(_machdep, OID_AUTO, unaligned_print, CTLFLAG_RW, + &ia64_unaligned_print, 0, "warn about unaligned accesses"); + +SYSCTL_INT(_machdep, OID_AUTO, unaligned_fix, CTLFLAG_RW, + &ia64_unaligned_fix, 0, "fix up unaligned accesses (if possible)"); + +SYSCTL_INT(_machdep, OID_AUTO, unaligned_sigbus, CTLFLAG_RW, + &ia64_unaligned_sigbus, 0, "do not SIGBUS on fixed-up accesses"); int unaligned_fixup(struct trapframe *framep, struct thread *td); diff --git a/sys/ia64/include/cpu.h b/sys/ia64/include/cpu.h index 93c142f..da13c01 100644 --- a/sys/ia64/include/cpu.h +++ b/sys/ia64/include/cpu.h @@ -70,22 +70,16 @@ struct clockframe { */ #define CPU_CONSDEV 1 /* dev_t: console terminal device */ #define CPU_ROOT_DEVICE 2 /* string: root device name */ -#define CPU_UNALIGNED_PRINT 3 /* int: print unaligned accesses */ -#define CPU_UNALIGNED_FIX 4 /* int: fix unaligned accesses */ -#define CPU_UNALIGNED_SIGBUS 5 /* int: SIGBUS unaligned accesses */ -#define CPU_BOOTED_KERNEL 6 /* string: booted kernel name */ -#define CPU_ADJKERNTZ 7 /* int: timezone offset (seconds) */ -#define CPU_DISRTCSET 8 /* int: disable resettodr() call */ -#define CPU_WALLCLOCK 9 /* int: indicates wall CMOS clock */ -#define CPU_MAXID 10 /* valid machdep IDs */ +#define CPU_BOOTED_KERNEL 3 /* string: booted kernel name */ +#define CPU_ADJKERNTZ 4 /* int: timezone offset (seconds) */ +#define CPU_DISRTCSET 5 /* int: disable resettodr() call */ +#define CPU_WALLCLOCK 6 /* int: indicates wall CMOS clock */ +#define CPU_MAXID 7 /* valid machdep IDs */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ { "console_device", CTLTYPE_STRUCT }, \ { "root_device", CTLTYPE_STRING }, \ - { "unaligned_print", CTLTYPE_INT }, \ - { "unaligned_fix", CTLTYPE_INT }, \ - { "unaligned_sigbus", CTLTYPE_INT }, \ { "booted_kernel", CTLTYPE_STRING }, \ { "adjkerntz", CTLTYPE_INT }, \ { "disable_rtc_set", CTLTYPE_INT }, \ |