Move the sysctls of the misalignment handler to where they belong
and use OID_AUTO instead of fixed IDs. Approved by: re@ (blanket)
This commit is contained in:
parent
12cd60b726
commit
3a8c4f9f9c
@ -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)
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 }, \
|
||||
|
Loading…
Reference in New Issue
Block a user