From 5beb1a522c74ece76143e51420021a6c3591c427 Mon Sep 17 00:00:00 2001 From: cgd Date: Sun, 14 Jul 1996 04:15:10 +0000 Subject: [PATCH] (1) Add unaligned access fixup code to fix unaligned quad, long, and IEEE S and T floating datum loads and stores. VAX floating data types not yet supported, and in the future will only be supported if FIX_UNALIGNED_VAX_FP is defined. (No point in wasting the space when most of the time there will never be VAX FP loads and stores.) Right now, these features can be controlled only by sysctl. The (boolean) integer sysctls machdep.unaligned_print, machdep.unaligned_fix, and machdep.unaligned_sigbus control printing about unaligned accesses (defaults on), fixing up of unaligned accesses (defaults on), and forcing a SIGBUS on unaligned accesses (defaults off). If an access is not fixed up (for lack of method or explicit decision), a SIGBUS is always generated to keep programs from using bogus data. At some point, these three choices should be controlled by per-process flags, as well. --- sys/arch/alpha/include/cpu.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h index 9cd49e10ad67..36d475461b71 100644 --- a/sys/arch/alpha/include/cpu.h +++ b/sys/arch/alpha/include/cpu.h @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.11 1996/07/11 05:31:30 cgd Exp $ */ +/* $NetBSD: cpu.h,v 1.12 1996/07/14 04:15:10 cgd Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -106,12 +106,18 @@ u_int64_t want_resched; /* resched() was called */ */ #define CPU_CONSDEV 1 /* dev_t: console terminal device */ #define CPU_ROOT_DEVICE 2 /* string: root device name */ -#define CPU_MAXID 3 /* number of valid machdep ids */ +#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_MAXID 6 /* 5 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 }, \ } #endif /* _ALPHA_CPU_H_ */