(1) Remove old trap definitions, define trap and interrupt handling
more naturally in terms of way the OSF/1 PALcode delivers traps and interrupts. Clean up fault/exception handling code and system entry points. Seperate ASTs into a seperate C function. (2) Add a boot flag ('H' and 'h') to make sure the kernel never reboots after panic. Useful for debugging kernels which panic early on after user processes have started, to fend off infinite reboot cycles. Sort boot flag switch. (3) 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.
This commit is contained in:
parent
2db316d75f
commit
b431daf1d1
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: machdep.c,v 1.35 1996/07/11 20:14:19 cgd Exp $ */
|
||||
/* $NetBSD: machdep.c,v 1.36 1996/07/14 04:21:33 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
|
||||
|
@ -186,9 +186,12 @@ char *cpu_iobus;
|
|||
char boot_flags[64];
|
||||
|
||||
/* for cpu_sysctl() */
|
||||
char root_device[17];
|
||||
char root_device[17];
|
||||
int alpha_unaligned_print = 1; /* warn about unaligned accesses */
|
||||
int alpha_unaligned_fix = 1; /* fix up unaligned accesses */
|
||||
int alpha_unaligned_sigbus = 0; /* don't SIGBUS on fixed-up accesses */
|
||||
|
||||
void identifycpu();
|
||||
void identifycpu();
|
||||
|
||||
int
|
||||
alpha_init(pfn, ptb)
|
||||
|
@ -232,12 +235,18 @@ alpha_init(pfn, ptb)
|
|||
/*
|
||||
* Point interrupt/exception vectors to our own.
|
||||
*/
|
||||
alpha_pal_wrent(XentInt, 0);
|
||||
alpha_pal_wrent(XentArith, 1);
|
||||
alpha_pal_wrent(XentMM, 2);
|
||||
alpha_pal_wrent(XentIF, 3);
|
||||
alpha_pal_wrent(XentUna, 4);
|
||||
alpha_pal_wrent(XentSys, 5);
|
||||
alpha_pal_wrent(XentInt, ALPHA_KENTRY_INT);
|
||||
alpha_pal_wrent(XentArith, ALPHA_KENTRY_ARITH);
|
||||
alpha_pal_wrent(XentMM, ALPHA_KENTRY_MM);
|
||||
alpha_pal_wrent(XentIF, ALPHA_KENTRY_IF);
|
||||
alpha_pal_wrent(XentUna, ALPHA_KENTRY_UNA);
|
||||
alpha_pal_wrent(XentSys, ALPHA_KENTRY_SYS);
|
||||
|
||||
/*
|
||||
* Disable System and Processor Correctable Error reporting.
|
||||
* Clear pending machine checks and error reports, etc.
|
||||
*/
|
||||
alpha_pal_wrmces(alpha_pal_rdmces() | ALPHA_MCES_SCE | ALPHA_MCES_PCE);
|
||||
|
||||
/*
|
||||
* Find out how much memory is available, by looking at
|
||||
|
@ -579,9 +588,9 @@ alpha_init(pfn, ptb)
|
|||
boothowto &= ~RB_SINGLE;
|
||||
break;
|
||||
|
||||
case 'n': /* askname */
|
||||
case 'N':
|
||||
boothowto |= RB_ASKNAME;
|
||||
case 'h': /* always halt, never reboot */
|
||||
case 'H':
|
||||
boothowto |= RB_HALT;
|
||||
break;
|
||||
|
||||
#if 0
|
||||
|
@ -590,6 +599,11 @@ alpha_init(pfn, ptb)
|
|||
boothowto |= RB_MINIROOT;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'n': /* askname */
|
||||
case 'N':
|
||||
boothowto |= RB_ASKNAME;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -759,6 +773,10 @@ boot(howto)
|
|||
goto haltsys;
|
||||
}
|
||||
|
||||
/* If "always halt" was specified as a boot flag, obey. */
|
||||
if ((boothowto & RB_HALT) != 0)
|
||||
howto |= RB_HALT;
|
||||
|
||||
boothowto = howto;
|
||||
if ((howto & RB_NOSYNC) == 0 && waittime < 0) {
|
||||
waittime = 0;
|
||||
|
@ -1231,6 +1249,18 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
|
|||
case CPU_ROOT_DEVICE:
|
||||
return (sysctl_rdstring(oldp, oldlenp, newp, root_device));
|
||||
|
||||
case CPU_UNALIGNED_PRINT:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
&alpha_unaligned_print));
|
||||
|
||||
case CPU_UNALIGNED_FIX:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
&alpha_unaligned_fix));
|
||||
|
||||
case CPU_UNALIGNED_SIGBUS:
|
||||
return (sysctl_int(oldp, oldlenp, newp, newlen,
|
||||
&alpha_unaligned_sigbus));
|
||||
|
||||
default:
|
||||
return (EOPNOTSUPP);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue