RAS support for i386.
This commit is contained in:
parent
3fc3b75dad
commit
14b302311d
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: genassym.cf,v 1.30 2002/06/23 22:18:49 thorpej Exp $
|
||||
# $NetBSD: genassym.cf,v 1.31 2002/08/28 09:47:15 gmcgarry Exp $
|
||||
|
||||
#
|
||||
# Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -146,6 +146,7 @@ define P_PRIORITY offsetof(struct proc, p_priority)
|
|||
define P_STAT offsetof(struct proc, p_stat)
|
||||
define P_WCHAN offsetof(struct proc, p_wchan)
|
||||
define P_FLAG offsetof(struct proc, p_flag)
|
||||
define P_NRAS offsetof(struct proc, p_nras)
|
||||
define P_MD_TSS_SEL offsetof(struct proc, p_md.md_tss_sel)
|
||||
define P_MD_REGS offsetof(struct proc, p_md.md_regs)
|
||||
define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: locore.s,v 1.257 2002/07/10 05:56:44 kent Exp $ */
|
||||
/* $NetBSD: locore.s,v 1.258 2002/08/28 09:47:16 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -1983,6 +1983,25 @@ switch_restored:
|
|||
/* Interrupts are okay again. */
|
||||
sti
|
||||
|
||||
/*
|
||||
* Check for restartable atomic sequences (RAS)
|
||||
*/
|
||||
movl _C_LABEL(curproc),%edi
|
||||
cmpl $0,P_NRAS(%edi)
|
||||
je 1f
|
||||
movl P_MD_REGS(%edi),%edx
|
||||
movl TF_EIP(%edx),%eax
|
||||
pushl %eax
|
||||
pushl %edi
|
||||
call _C_LABEL(ras_lookup)
|
||||
addl $8,%esp
|
||||
cmpl $-1,%eax
|
||||
je 1f
|
||||
movl _C_LABEL(curproc),%edi
|
||||
movl P_MD_REGS(%edi),%edx
|
||||
movl %eax,TF_EIP(%edx)
|
||||
1:
|
||||
|
||||
switch_return:
|
||||
/*
|
||||
* Restore old cpl from stack. Note that this is always an increase,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: trap.c,v 1.167 2002/07/07 13:24:36 drochner Exp $ */
|
||||
/* $NetBSD: trap.c,v 1.168 2002/08/28 09:47:17 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -79,7 +79,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.167 2002/07/07 13:24:36 drochner Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.168 2002/08/28 09:47:17 gmcgarry Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_kgdb.h"
|
||||
|
@ -95,6 +95,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.167 2002/07/07 13:24:36 drochner Exp $");
|
|||
#include <sys/user.h>
|
||||
#include <sys/acct.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/ras.h>
|
||||
#include <sys/signal.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
|
@ -525,7 +526,13 @@ copyfault:
|
|||
#ifdef MATH_EMULATE
|
||||
trace:
|
||||
#endif
|
||||
(*p->p_emul->e_trapsignal)(p, SIGTRAP, type & ~T_USER);
|
||||
/*
|
||||
* Don't go single-stepping into a RAS.
|
||||
*/
|
||||
if ((p->p_nras == 0) ||
|
||||
(ras_lookup(p, (caddr_t)frame.tf_eip) == (caddr_t)-1)) {
|
||||
(*p->p_emul->e_trapsignal)(p, SIGTRAP, type & ~T_USER);
|
||||
}
|
||||
break;
|
||||
|
||||
#if NISA > 0 || NMCA > 0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: types.h,v 1.33 2002/08/07 09:45:49 tron Exp $ */
|
||||
/* $NetBSD: types.h,v 1.34 2002/08/28 09:47:18 gmcgarry Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
|
@ -69,5 +69,6 @@ typedef int register_t;
|
|||
#define __HAVE_MINIMAL_EMUL
|
||||
#define __HAVE_OLD_DISKLABEL
|
||||
#define __HAVE_GENERIC_SOFT_INTERRUPTS
|
||||
#define __HAVE_RAS
|
||||
|
||||
#endif /* _MACHTYPES_H_ */
|
||||
|
|
Loading…
Reference in New Issue