Skip to content

Commit

Permalink
SMP branch resync. Mostly RAS support.
Browse files Browse the repository at this point in the history
  • Loading branch information
sommerfeld committed Aug 31, 2002
1 parent f70dd32 commit 4dfc1dc
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 16 deletions.
9 changes: 5 additions & 4 deletions sys/arch/i386/MP-UPDATING
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,8 @@
Last Synchronized: Sat Aug 31 12:58:28 EDT 2002

merged with -current as of today.
merged in restartable atomic sequence support.

Last Synchronized: Sun Aug 18 19:21:52 EDT 2002 Last Synchronized: Sun Aug 18 19:21:52 EDT 2002


merged with -current as of today. merged with -current as of today.
Expand Down Expand Up @@ -54,7 +59,3 @@ Last Synchronized: Sun Sep 23 21:12:12 EDT 2001
Now using new toolchain. Most (but not all) of the new assembler Now using new toolchain. Most (but not all) of the new assembler
warnings are now fixed. Has all the ubcperf, new-dirpref, poolified warnings are now fixed. Has all the ubcperf, new-dirpref, poolified
softdeps, and assorted other goodness. softdeps, and assorted other goodness.




2 changes: 1 addition & 1 deletion sys/arch/i386/conf/GENERIC_PS2TINY
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: GENERIC_PS2TINY,v 1.12.2.4 2002/08/19 01:22:18 sommerfeld Exp $ # $NetBSD: GENERIC_PS2TINY,v 1.12.2.5 2002/08/31 20:31:33 sommerfeld Exp $
# #
# GENERIC-style kernel config for IBM PS/2 with MCA bus. It only contains # GENERIC-style kernel config for IBM PS/2 with MCA bus. It only contains
# IBM PS/2 related stuff and has been generally trimmed down somewhat, # IBM PS/2 related stuff and has been generally trimmed down somewhat,
Expand Down
2 changes: 1 addition & 1 deletion sys/arch/i386/conf/GENERIC_TINY
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: GENERIC_TINY,v 1.22.2.13 2002/08/19 01:22:18 sommerfeld Exp $ # $NetBSD: GENERIC_TINY,v 1.22.2.14 2002/08/31 20:31:33 sommerfeld Exp $
# #
# GENERIC_TINY -- suitable default for 4M machines # GENERIC_TINY -- suitable default for 4M machines
# No EISA, PCI, or SCSI. # No EISA, PCI, or SCSI.
Expand Down
3 changes: 2 additions & 1 deletion sys/arch/i386/i386/genassym.cf
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.17.10.17 2002/06/25 15:44:50 sommerfeld Exp $ # $NetBSD: genassym.cf,v 1.17.10.18 2002/08/31 20:31:34 sommerfeld Exp $


# #
# Copyright (c) 1998 The NetBSD Foundation, Inc. # Copyright (c) 1998 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -154,6 +154,7 @@ define P_STAT offsetof(struct proc, p_stat)
define P_WCHAN offsetof(struct proc, p_wchan) define P_WCHAN offsetof(struct proc, p_wchan)
define P_FLAG offsetof(struct proc, p_flag) define P_FLAG offsetof(struct proc, p_flag)
define P_CPU offsetof(struct proc, p_cpu) define P_CPU offsetof(struct proc, p_cpu)
define P_NRAS offsetof(struct proc, p_nras)
define P_MD_TSS_SEL offsetof(struct proc, p_md.md_tss_sel) 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_REGS offsetof(struct proc, p_md.md_regs)
define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall) define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
Expand Down
22 changes: 21 additions & 1 deletion sys/arch/i386/i386/locore.s
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.215.2.34 2002/08/19 01:22:28 sommerfeld Exp $ */ /* $NetBSD: locore.s,v 1.215.2.35 2002/08/31 20:31:34 sommerfeld Exp $ */


/*- /*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -2119,6 +2119,26 @@ switch_restored:
/* Interrupts are okay again. */ /* Interrupts are okay again. */
sti sti


/*
* Check for restartable atomic sequences (RAS)
* XXX %edi reloads are not necessary here as %edi is callee-saved!
*/
movl CPUVAR(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 CPUVAR(CURPROC),%edi
movl P_MD_REGS(%edi),%edx
movl %eax,TF_EIP(%edx)
1:

switch_return: switch_return:
#if defined(MULTIPROCESSOR) || defined(LOCKDEBUG) #if defined(MULTIPROCESSOR) || defined(LOCKDEBUG)
call _C_LABEL(sched_unlock_idle) call _C_LABEL(sched_unlock_idle)
Expand Down
4 changes: 2 additions & 2 deletions sys/arch/i386/i386/machdep.c
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.376.2.40 2002/08/19 01:22:29 sommerfeld Exp $ */ /* $NetBSD: machdep.c,v 1.376.2.41 2002/08/31 20:31:34 sommerfeld Exp $ */


/*- /*-
* Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1996, 1997, 1998, 2000 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -76,7 +76,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.376.2.40 2002/08/19 01:22:29 sommerfeld Exp $"); __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.376.2.41 2002/08/31 20:31:34 sommerfeld Exp $");


#include "opt_cputype.h" #include "opt_cputype.h"
#include "opt_ddb.h" #include "opt_ddb.h"
Expand Down
17 changes: 12 additions & 5 deletions sys/arch/i386/i386/trap.c
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.134.2.23 2002/08/19 01:32:44 sommerfeld Exp $ */ /* $NetBSD: trap.c,v 1.134.2.24 2002/08/31 20:31:35 sommerfeld Exp $ */


/*- /*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -79,7 +79,7 @@
*/ */


#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.134.2.23 2002/08/19 01:32:44 sommerfeld Exp $"); __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.134.2.24 2002/08/31 20:31:35 sommerfeld Exp $");


#include "opt_ddb.h" #include "opt_ddb.h"
#include "opt_kgdb.h" #include "opt_kgdb.h"
Expand All @@ -95,6 +95,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.134.2.23 2002/08/19 01:32:44 sommerfeld E
#include <sys/user.h> #include <sys/user.h>
#include <sys/acct.h> #include <sys/acct.h>
#include <sys/kernel.h> #include <sys/kernel.h>
#include <sys/ras.h>
#include <sys/signal.h> #include <sys/signal.h>
#include <sys/syscall.h> #include <sys/syscall.h>


Expand Down Expand Up @@ -573,9 +574,15 @@ trap(frame)
#ifdef MATH_EMULATE #ifdef MATH_EMULATE
trace: trace:
#endif #endif
KERNEL_PROC_LOCK(p); /*
(*p->p_emul->e_trapsignal)(p, SIGTRAP, type & ~T_USER); * Don't go single-stepping into a RAS.
KERNEL_PROC_UNLOCK(p); */
if ((p->p_nras == 0) ||
(ras_lookup(p, (caddr_t)frame.tf_eip) == (caddr_t)-1)) {
KERNEL_PROC_LOCK(p);
(*p->p_emul->e_trapsignal)(p, SIGTRAP, type & ~T_USER);
KERNEL_PROC_UNLOCK(p);
}
break; break;


#if NISA > 0 || NMCA > 0 #if NISA > 0 || NMCA > 0
Expand Down
2 changes: 1 addition & 1 deletion sys/arch/i386/include/types.h
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: types.h,v 1.24.4.6 2002/08/19 01:22:37 sommerfeld Exp $ */ /* $NetBSD: types.h,v 1.24.4.7 2002/08/31 20:31:36 sommerfeld Exp $ */


/*- /*-
* Copyright (c) 1990 The Regents of the University of California. * Copyright (c) 1990 The Regents of the University of California.
Expand Down

0 comments on commit 4dfc1dc

Please sign in to comment.