summaryrefslogtreecommitdiff
path: root/sys/arch/atari
diff options
context:
space:
mode:
authorad <ad@NetBSD.org>2007-02-09 21:55:00 +0000
committerad <ad@NetBSD.org>2007-02-09 21:55:00 +0000
commitb07ec3fc388a5aeae51e8871aa89eefea3ce1e53 (patch)
treec93d3b23a29f98ac0e26c9d43afb509219d0ea42 /sys/arch/atari
parent5c1aad3ad0b9d2403784bd52128e8e8399e22254 (diff)
Merge newlock2 to head.
Diffstat (limited to 'sys/arch/atari')
-rw-r--r--sys/arch/atari/atari/genassym.cf4
-rw-r--r--sys/arch/atari/atari/machdep.c5
-rw-r--r--sys/arch/atari/atari/trap.c32
-rw-r--r--sys/arch/atari/include/Makefile6
-rw-r--r--sys/arch/atari/include/cpu.h12
-rw-r--r--sys/arch/atari/include/mutex.h3
-rw-r--r--sys/arch/atari/include/rwlock.h3
7 files changed, 32 insertions, 33 deletions
diff --git a/sys/arch/atari/atari/genassym.cf b/sys/arch/atari/atari/genassym.cf
index dba6018ffa1..002f85d995a 100644
--- a/sys/arch/atari/atari/genassym.cf
+++ b/sys/arch/atari/atari/genassym.cf
@@ -1,4 +1,4 @@
-# $NetBSD: genassym.cf,v 1.23 2005/12/11 12:16:54 christos Exp $
+# $NetBSD: genassym.cf,v 1.24 2007/02/09 21:55:02 ad Exp $
#-
# Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -65,8 +65,6 @@ include <machine/pte.h>
include <machine/iomap.h>
include <machine/scu.h>
-include <m68k/saframe.h>
-
define _XXX_CIRCUMVENT_BUG 1
# CPU options
diff --git a/sys/arch/atari/atari/machdep.c b/sys/arch/atari/atari/machdep.c
index 5827ec4109b..9171b6f0259 100644
--- a/sys/arch/atari/atari/machdep.c
+++ b/sys/arch/atari/atari/machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.140 2006/10/21 05:54:31 mrg Exp $ */
+/* $NetBSD: machdep.c,v 1.141 2007/02/09 21:55:02 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.140 2006/10/21 05:54:31 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.141 2007/02/09 21:55:02 ad Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -101,7 +101,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.140 2006/10/21 05:54:31 mrg Exp $");
#include <sys/vnode.h>
#include <sys/queue.h>
#include <sys/mount.h>
-#include <sys/sa.h>
#include <sys/syscallargs.h>
#include <sys/ksyms.h>
diff --git a/sys/arch/atari/atari/trap.c b/sys/arch/atari/atari/trap.c
index ec0f8214809..78dac42fdf0 100644
--- a/sys/arch/atari/atari/trap.c
+++ b/sys/arch/atari/atari/trap.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.84 2006/07/23 22:06:04 ad Exp $ */
+/* $NetBSD: trap.c,v 1.85 2007/02/09 21:55:02 ad Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2006/07/23 22:06:04 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.85 2007/02/09 21:55:02 ad Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -94,8 +94,6 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.84 2006/07/23 22:06:04 ad Exp $");
#include <sys/resourcevar.h>
#include <sys/syslog.h>
#include <sys/syscall.h>
-#include <sys/sa.h>
-#include <sys/savar.h>
#include <sys/user.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@@ -240,10 +238,10 @@ again:
/*
* If profiling, charge system time to the trapped pc.
*/
- if (p->p_flag & P_PROFIL) {
+ if (p->p_stflag & PST_PROFIL) {
extern int psratio;
- addupc_task(p, fp->f_pc,
+ addupc_task(l, fp->f_pc,
(int)(p->p_sticks - oticks) * psratio);
}
#ifdef M68040
@@ -446,10 +444,13 @@ trap(type, code, v, frame)
printf("pid %d: kernel %s exception\n", p->p_pid,
type==T_COPERR ? "coprocessor" : "format");
#endif
+ mutex_enter(&p->p_smutex);
SIGACTION(p, SIGILL).sa_handler = SIG_DFL;
sigdelset(&p->p_sigctx.ps_sigignore, SIGILL);
sigdelset(&p->p_sigctx.ps_sigcatch, SIGILL);
- sigdelset(&p->p_sigctx.ps_sigmask, SIGILL);
+ sigdelset(&l->l_sigmask, SIGILL);
+ mutex_exit(&p->p_smutex);
+
ksi.ksi_signo = SIGILL;
ksi.ksi_addr = (void *)(int)frame.f_format;
/* XXX was ILL_RESAD_FAULT */
@@ -608,12 +609,12 @@ trap(type, code, v, frame)
return;
}
spl0();
- if (p->p_flag & P_OWEUPC) {
- p->p_flag &= ~P_OWEUPC;
- ADDUPROF(p);
+ if (l->l_pflag & LP_OWEUPC) {
+ l->l_pflag &= ~LP_OWEUPC;
+ ADDUPROF(l);
}
if (want_resched)
- preempt(0);
+ preempt();
goto out;
/*
* Kernel/User page fault
@@ -654,13 +655,8 @@ trap(type, code, v, frame)
if (type == T_MMUFLT &&
((l->l_addr->u_pcb.pcb_onfault == 0) || KDFAULT(code)))
map = kernel_map;
- else {
+ else
map = vm ? &vm->vm_map : kernel_map;
- if (l->l_flag & L_SA) {
- l->l_savp->savp_faultaddr = (vaddr_t)v;
- l->l_flag |= L_SA_PAGEFAULT;
- }
- }
if (WRFAULT(code))
ftype = VM_PROT_WRITE;
@@ -697,7 +693,6 @@ trap(type, code, v, frame)
#endif
return;
}
- l->l_flag &= ~L_SA_PAGEFAULT;
goto out;
}
if (rv == EACCES) {
@@ -716,7 +711,6 @@ trap(type, code, v, frame)
type, code);
panictrap(type, code, v, &frame);
}
- l->l_flag &= ~L_SA_PAGEFAULT;
ksi.ksi_addr = (void *)v;
if (rv == ENOMEM) {
printf("UVM: pid %d (%s), uid %d killed: out of swap\n",
diff --git a/sys/arch/atari/include/Makefile b/sys/arch/atari/include/Makefile
index a9eb39d1e05..03293c9ab4a 100644
--- a/sys/arch/atari/include/Makefile
+++ b/sys/arch/atari/include/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2006/07/26 19:54:56 drochner Exp $
+# $NetBSD: Makefile,v 1.24 2007/02/09 21:55:02 ad Exp $
INCSDIR= /usr/include/atari
@@ -12,9 +12,9 @@ INCS= ahdilabel.h ansi.h aout_machdep.h asm.h \
int_const.h int_fmtio.h int_limits.h int_mwgwtypes.h int_types.h \
kcore.h \
limits.h lock.h \
- math.h mcontext.h msioctl.h mtpr.h \
+ math.h mcontext.h msioctl.h mtpr.h mutex.h \
param.h pcb.h pmap.h pmc.h proc.h profile.h psl.h pte.h ptrace.h \
- reg.h \
+ reg.h rwlock.h \
setjmp.h signal.h stdarg.h \
trap.h types.h \
varargs.h vmparam.h \
diff --git a/sys/arch/atari/include/cpu.h b/sys/arch/atari/include/cpu.h
index 0e71da8d9c6..5723559c762 100644
--- a/sys/arch/atari/include/cpu.h
+++ b/sys/arch/atari/include/cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.48 2006/12/22 18:00:19 jdc Exp $ */
+/* $NetBSD: cpu.h,v 1.49 2007/02/09 21:55:02 ad Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -98,6 +98,8 @@
#include <sys/cpu_data.h>
struct cpu_info {
struct cpu_data ci_data; /* MI per-cpu data */
+ int ci_mtx_count;
+ int ci_mtx_oldspl;
};
extern struct cpu_info cpu_info_store;
@@ -142,21 +144,21 @@ struct clockframe {
* Preempt the current process if in interrupt from user mode,
* or after the current trap/syscall if in system mode.
*/
-#define need_resched(ci) {want_resched = 1; setsoftast();}
+#define cpu_need_resched(ci) {want_resched = 1; setsoftast();}
/*
* Give a profiling tick to the current process from the softclock
* interrupt. On hp300, request an ast to send us through trap(),
* marking the proc as needing a profiling tick.
*/
-#define profile_tick(p, framep) ((p)->p_flag |= P_OWEUPC, setsoftast())
-#define need_proftick(p) ((p)->p_flag |= P_OWEUPC, setsoftast())
+#define profile_tick(l, framep) ((l)->l_pflag |= LP_OWEUPC, setsoftast())
+#define cpu_need_proftick(l) ((l)->l_pflag |= LP_OWEUPC, setsoftast())
/*
* Notify the current process (p) that it has a signal pending,
* process as soon as possible.
*/
-#define signotify(p) setsoftast()
+#define cpu_signotify(l) setsoftast()
#define setsoftast() (astpending = 1)
diff --git a/sys/arch/atari/include/mutex.h b/sys/arch/atari/include/mutex.h
new file mode 100644
index 00000000000..3a7204284b4
--- /dev/null
+++ b/sys/arch/atari/include/mutex.h
@@ -0,0 +1,3 @@
+/* $NetBSD: mutex.h,v 1.2 2007/02/09 21:55:02 ad Exp $ */
+
+#include <m68k/mutex.h>
diff --git a/sys/arch/atari/include/rwlock.h b/sys/arch/atari/include/rwlock.h
new file mode 100644
index 00000000000..6910f8b6fc4
--- /dev/null
+++ b/sys/arch/atari/include/rwlock.h
@@ -0,0 +1,3 @@
+/* $NetBSD: rwlock.h,v 1.2 2007/02/09 21:55:02 ad Exp $ */
+
+#include <m68k/rwlock.h>