summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-08 14:21:28 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-08 14:21:28 +0000
commitbadf9a5ca2736f560550a0544450d6a099cf391b (patch)
tree9099dca89beca21d45cf37b237c0f436bf4a5234
parent6ef5a56a66746c2c514430bfc93f651cc3e8a5ef (diff)
Various fixes and cleanups from miod@, tested and OK.
-rw-r--r--sys/arch/mips64/include/trap.h6
-rw-r--r--sys/arch/mips64/mips64/lcore_access.S111
-rw-r--r--sys/arch/mips64/mips64/process_machdep.c7
-rw-r--r--sys/arch/mips64/mips64/trap.c9
-rw-r--r--sys/arch/sgi/sgi/genassym.cf41
5 files changed, 33 insertions, 141 deletions
diff --git a/sys/arch/mips64/include/trap.h b/sys/arch/mips64/include/trap.h
index d752a78c156..0f2459456f7 100644
--- a/sys/arch/mips64/include/trap.h
+++ b/sys/arch/mips64/include/trap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.h,v 1.1 2004/08/06 20:56:02 pefo Exp $ */
+/* $OpenBSD: trap.h,v 1.2 2004/08/08 14:21:27 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -77,9 +77,7 @@
#define KT_BADERR 1 /* Bad address */
#define KT_COPYERR 2 /* User space copy error */
#define KT_KCOPYERR 3 /* Kernel space copy error */
-#define KT_FSWBERR 4 /* Access error */
-#define KT_FSWINTRBERR 5 /* Access error, non sleep */
-#define KT_DDBERR 6 /* DDB access error */
+#define KT_DDBERR 4 /* DDB access error */
#ifndef _LOCORE
diff --git a/sys/arch/mips64/mips64/lcore_access.S b/sys/arch/mips64/mips64/lcore_access.S
index 0eeb4b9bb15..05c4df8e454 100644
--- a/sys/arch/mips64/mips64/lcore_access.S
+++ b/sys/arch/mips64/mips64/lcore_access.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: lcore_access.S,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: lcore_access.S,v 1.2 2004/08/08 14:21:27 pefo Exp $ */
/*
* Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -67,8 +67,6 @@ onfault_table:
PTR_VAL baderr
PTR_VAL copyerr
PTR_VAL copyerr
- PTR_VAL fswberr
- PTR_VAL fswintrberr
#if defined(DDB) || defined(DEBUG)
PTR_VAL kt_ddberr
#else
@@ -472,110 +470,3 @@ NON_LEAF(kcopy, FRAMESZ(CF_SZ), ra)
j ra
move v0, zero
END(kcopy)
-
-/*
- * {fu,su},{byte,sword,word}, fetch or store a byte, short or word to
- * user space.
- */
-LEAF(fuword)
- blt a0, zero, fswberr # make sure address is in user space
- li v0, KT_FSWBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- lw v0, 0(a0) # fetch word
- j ra
- sw zero, U_PCB_ONFAULT(t3)
-END(fuword)
-
-LEAF(fusword)
- blt a0, zero, fswberr # make sure address is in user space
- li v0, KT_FSWBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- lhu v0, 0(a0) # fetch short
- j ra
- sw zero, U_PCB_ONFAULT(t3)
-END(fusword)
-
-LEAF(fubyte)
- blt a0, zero, fswberr # make sure address is in user space
- li v0, KT_FSWBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- lbu v0, 0(a0) # fetch byte
- j ra
- sw zero, U_PCB_ONFAULT(t3)
-END(fubyte)
-
-LEAF(suword)
- blt a0, zero, fswberr # make sure address is in user space
- li v0, KT_FSWBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- sw a1, 0(a0) # store word
- sw zero, U_PCB_ONFAULT(t3)
- j ra
- move v0, zero
-END(suword)
-
-/*
- * Will have to flush the instruction cache if byte merging is done in hardware.
- */
-LEAF(susword)
- blt a0, zero, fswberr # make sure address is in user space
- li v0, KT_FSWBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- sh a1, 0(a0) # store short
- sw zero, U_PCB_ONFAULT(t3)
- j ra
- move v0, zero
-END(susword)
-
-LEAF(subyte)
- blt a0, zero, fswberr # make sure address is in user space
- li v0, KT_FSWBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- sb a1, 0(a0) # store byte
- sw zero, U_PCB_ONFAULT(t3)
- j ra
- move v0, zero
-END(subyte)
-
-LEAF(fswberr)
- j ra
- li v0, -1
-END(fswberr)
-
-/*
- * fuswintr and suswintr are just like fusword and susword except that if
- * the page is not in memory or would cause a trap, then we return an error.
- * The important thing is to prevent sleep() and switch().
- */
-LEAF(fuswintr)
- blt a0, zero, fswintrberr # make sure address is in user space
- li v0, KT_FSWINTRBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- lhu v0, 0(a0) # fetch short
- sw zero, U_PCB_ONFAULT(t3)
- j ra
- move v0, zero
-END(fuswintr)
-
-LEAF(suswintr)
- blt a0, zero, fswintrberr # make sure address is in user space
- li v0, KT_FSWINTRBERR
- PTR_L t3, curprocpaddr
- sw v0, U_PCB_ONFAULT(t3)
- sh a1, 0(a0) # store short
- sw zero, U_PCB_ONFAULT(t3)
- j ra
- move v0, zero
-END(suswintr)
-
-LEAF(fswintrberr)
- j ra
- li v0, -1
-END(fswintrberr)
diff --git a/sys/arch/mips64/mips64/process_machdep.c b/sys/arch/mips64/mips64/process_machdep.c
index eb0347314fc..e12f9e3a85a 100644
--- a/sys/arch/mips64/mips64/process_machdep.c
+++ b/sys/arch/mips64/mips64/process_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process_machdep.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.2 2004/08/08 14:21:27 pefo Exp $ */
/*
* Copyright (c) 1994 Adam Glass
* Copyright (c) 1993 The Regents of the University of California.
@@ -39,7 +39,7 @@
* From:
* Id: procfs_i386.c,v 4.1 1993/12/17 10:47:45 jsp Rel
*
- * $Id: process_machdep.c,v 1.1 2004/08/06 20:56:03 pefo Exp $
+ * $Id: process_machdep.c,v 1.2 2004/08/08 14:21:27 pefo Exp $
*/
/*
@@ -88,6 +88,8 @@ process_read_regs(p, regs)
return (0);
}
+#ifdef PTRACE
+
int
process_write_regs(p, regs)
struct proc *p;
@@ -116,3 +118,4 @@ process_set_pc(p, addr)
return (0);
}
+#endif /* PTRACE */
diff --git a/sys/arch/mips64/mips64/trap.c b/sys/arch/mips64/mips64/trap.c
index 23758f7148e..958c17fb4b1 100644
--- a/sys/arch/mips64/mips64/trap.c
+++ b/sys/arch/mips64/mips64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.1 2004/08/06 20:56:03 pefo Exp $ */
+/* $OpenBSD: trap.c,v 1.2 2004/08/08 14:21:27 pefo Exp $ */
/* tracked to 1.23 */
/*
@@ -183,7 +183,7 @@ trap(trapframe)
* enable it when doing a spllower().
*/
/*XXX do in locore? */
- if(trapframe->sr & SR_INT_ENAB) {
+ if (trapframe->sr & SR_INT_ENAB) {
#ifndef IMASK_EXTERNAL
updateimask(trapframe->cpl);
#endif
@@ -291,9 +291,6 @@ trap(trapframe)
goto dofault;
}
#undef szsigcode
- /* check for fuswintr() or suswintr() getting a page fault */
- if (i == 5)
- return (onfault_table[i]);
goto dofault;
case T_TLB_LD_MISS+T_USER:
@@ -556,7 +553,7 @@ printf("SIG-BUSB @%p pc %p, ra %p\n", trapframe->badvaddr, trapframe->pc, trapfr
locr0->v0 = i;
locr0->a3 = 1;
}
- if(code == SYS_ptrace)
+ if (code == SYS_ptrace)
Mips_SyncCache();
#ifdef SYSCALL_DEBUG
scdebug_ret(p, code, i, rval);
diff --git a/sys/arch/sgi/sgi/genassym.cf b/sys/arch/sgi/sgi/genassym.cf
index cc590c68b3e..4c8cb4cc8ef 100644
--- a/sys/arch/sgi/sgi/genassym.cf
+++ b/sys/arch/sgi/sgi/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.1 2004/08/06 21:12:19 pefo Exp $ */
+# $OpenBSD: genassym.cf,v 1.2 2004/08/08 14:21:27 pefo Exp $ */
#
# Copyright (c) 1997 Per Fogelstrom / Opsycon AB
#
@@ -33,22 +33,25 @@ include <sys/user.h>
export SONPROC
-define P_FORW offsetof(struct proc, p_forw)
-define P_BACK offsetof(struct proc, p_back)
-define P_PRIORITY offsetof(struct proc, p_priority)
-define P_STAT offsetof(struct proc, p_stat)
-define P_ADDR offsetof(struct proc, p_addr)
-#define P_UPTE offsetof(struct proc, p_md.md_upte)
-define P_PC_CTRL offsetof(struct proc, p_md.md_pc_ctrl)
-define P_PC_COUNT offsetof(struct proc, p_md.md_pc_count)
-define P_WATCH_1 offsetof(struct proc, p_md.md_watch_1)
-define P_WATCH_2 offsetof(struct proc, p_md.md_watch_2)
-define P_WATCH_M offsetof(struct proc, p_md.md_watch_m)
-define U_PCB_REGS offsetof(struct user, u_pcb.pcb_regs.zero)
-define U_PCB_FPREGS offsetof(struct user, u_pcb.pcb_regs.f0)
-define U_PCB_CONTEXT offsetof(struct user, u_pcb.pcb_context)
-define U_PCB_ONFAULT offsetof(struct user, u_pcb.pcb_onfault)
-define U_PCB_SEGTAB offsetof(struct user, u_pcb.pcb_segtab)
+struct proc
+member p_forw
+member p_back
+member p_priority
+member p_stat
+member p_addr
+#member P_UPTE p_md.md_upte
+member P_PC_CTRL p_md.md_pc_ctrl
+member P_PC_COUNT p_md.md_pc_count
+member P_WATCH_1 p_md.md_watch_1
+member P_WATCH_2 p_md.md_watch_2
+member P_WATCH_M p_md.md_watch_m
-define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS
-define SIGFPE SIGFPE
+struct user
+member U_PCB_REGS u_pcb.pcb_regs.zero
+member U_PCB_FPREGS u_pcb.pcb_regs.f0
+member U_PCB_CONTEXT u_pcb.pcb_context
+member U_PCB_ONFAULT u_pcb.pcb_onfault
+member U_PCB_SEGTAB u_pcb.pcb_segtab
+
+export VM_MIN_KERNEL_ADDRESS
+export SIGFPE