summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-01-09 22:27:13 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-01-09 22:27:13 +0000
commit332a483dedd5c976b45635d3ef8337dfdd377f08 (patch)
treebcd0800a8732b7099fd64ce366155836b0f6e6ce /sys/arch/mvme88k
parentc88cb37963768d4ddbf78335478986b31599e25a (diff)
Remove fetch(9) and store(9) functions from the kernel, and replace the few
remaining instances of them with appropriate copy(9) usage. ok art@, tested on all arches unless my memory is non-ECC
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/mvme88k/locore_asm_routines.S177
-rw-r--r--sys/arch/mvme88k/mvme88k/trap.c34
2 files changed, 4 insertions, 207 deletions
diff --git a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
index 73b31afa46b..7838389e6cb 100644
--- a/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
+++ b/sys/arch/mvme88k/mvme88k/locore_asm_routines.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore_asm_routines.S,v 1.20 2002/01/21 20:35:51 miod Exp $ */
+/* $OpenBSD: locore_asm_routines.S,v 1.21 2003/01/09 22:27:09 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1992 Carnegie Mellon University
@@ -182,181 +182,6 @@ GLOBAL(FAULT_ERROR)
jmp r1
/*
- * Fetch from user space
- * r2 == address in user space
- */
-
-ENTRY(fuword)
-ENTRY(fuiword)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(fusu_fault)
- or r5, r5, lo16(fusu_fault)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#ifdef ERRATA__XXX_USR
- NOP
- ld.usr r5, r0, r2
- NOP
- NOP
- NOP
-#else
- ld.usr r5, r0, r2
-#endif
- or r2, r0, r5
- br fusu_ret
-fusu_fault:
- subu r2, r0, 1
-fusu_ret:
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- st r0, r6, PCB_ONFAULT /* pcb_onfault = 0 */
-
- jmp r1
-
-ENTRY(fusword)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(fusu_fault)
- or r5, r5, lo16(fusu_fault)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#ifdef ERRATA__XXX_USR
- NOP
- ld.h.usr r5, r0, r2
- NOP
- NOP
- NOP
-#else
- ld.h.usr r5, r0, r2
-#endif
- or r2, r0, r5
- br fusu_ret
-
-ENTRY(fubyte)
-ENTRY(fuibyte)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(fusu_fault)
- or r5, r5, lo16(fusu_fault)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#ifdef ERRATA__XXX_USR
- NOP
- ld.b.usr r5, r0, r2
- NOP
- NOP
- NOP
-#else
- ld.b.usr r5, r0, r2
-#endif
- or r2, r0, r5
- br fusu_ret
-
-ENTRY(fuswintr)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(_fubail)
- or r5, r5, lo16(_fubail)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fubail */
-#ifdef ERRATA__XXX_USR
- NOP
- ld.h.usr r5, r2, r0
- NOP
- NOP
- NOP
-#else
- ld.h.usr r5, r2, r0
-#endif
- or r2, r0, r5
- br fusu_ret
-
-ENTRY(fubail)
- subu r2, r0, 1
- br fusu_ret
-
-/*
- * store to user space.
- * r2 == address in user space
- * r3 == byte/short/word
- */
-
-ENTRY(suword)
-ENTRY(suiword)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(fusu_fault)
- or r5, r5, lo16(fusu_fault)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#ifdef ERRATA__XXX_USR
- NOP
- st.usr r3, r2, r0
- NOP
- NOP
- NOP
-#else
- st.usr r3, r2, r0
-#endif
- or r2, r0, r0 /* return success */
- br fusu_ret
-
-ENTRY(susword)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(fusu_fault)
- or r5, r5, lo16(fusu_fault)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#ifdef ERRATA__XXX_USR
- NOP
- st.h.usr r3, r2, r0
- NOP
- NOP
- NOP
-#else
- st.h.usr r3, r2, r0
-#endif
- or r2, r0, r0 /* return success */
- br fusu_ret
-
-ENTRY(subyte)
-ENTRY(suibyte)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(fusu_fault)
- or r5, r5, lo16(fusu_fault)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = fusu_fault */
-#ifdef ERRATA__XXX_USR
- NOP
- st.b.usr r3, r2, r0
- NOP
- NOP
- NOP
-#else
- st.b.usr r3, r2, r0
-#endif
- or r2, r0, r0 /* return success */
- br fusu_ret
-
-ENTRY(suswintr)
- or.u r5, r0, hi16(_curpcb)
- ld r6, r5, lo16(_curpcb)
- or.u r5, r0, hi16(_subail)
- or r5, r5, lo16(_subail)
- st r5, r6, PCB_ONFAULT /* pcb_onfault = subail */
-#ifdef ERRATA__XXX_USR
- NOP
- st.h.usr r3, r2, r0
- NOP
- NOP
- NOP
-#else
- st.h.usr r3, r2, r0
-#endif
- or r2, r0, r0 /* return success */
- br fusu_ret
-
-ENTRY(subail)
- subu r2, r0, 1
- br fusu_ret
-
-/*
* Copy specified amount of data from user space into the kernel
* copyin(from, to, len)
* r2 == from (user source address)
diff --git a/sys/arch/mvme88k/mvme88k/trap.c b/sys/arch/mvme88k/mvme88k/trap.c
index 5a20d6eab0b..350a6d2ff6d 100644
--- a/sys/arch/mvme88k/mvme88k/trap.c
+++ b/sys/arch/mvme88k/mvme88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.37 2003/01/03 23:17:43 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.38 2003/01/09 22:27:10 miod Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -337,19 +337,6 @@ m88100_trap(unsigned type, struct m88100_saved_state *frame)
if (frame->dmt0 & DMT_DAS)
map = kernel_map;
- /*
- * We don't want to call vm_fault() if it is fuwintr() or
- * suwintr(). These routines are for copying from interrupt
- * context and vm_fault() can potentially sleep. You may
- * wonder if it isn't bad karma for an interrupt handler to
- * touch the current process. Indeed it is, but clock interrupt
- * does it while doing profiling. It is OK in that context.
- */
-
- if (p->p_addr->u_pcb.pcb_onfault == (int)fubail ||
- p->p_addr->u_pcb.pcb_onfault == (int)subail)
- goto outtahere;
-
/* data fault on the user address */
if (type == T_DATAFLT && (frame->dmt0 & DMT_DAS) == 0) {
type = T_DATAFLT + T_USER;
@@ -452,7 +439,6 @@ m88100_trap(unsigned type, struct m88100_saved_state *frame)
if (!p->p_addr->u_pcb.pcb_onfault)
panictrap(frame->vector, frame);
-outtahere:
frame->snip = ((unsigned)p->p_addr->u_pcb.pcb_onfault ) | FIP_V;
frame->sfip = ((unsigned)p->p_addr->u_pcb.pcb_onfault + 4) | FIP_V;
frame->sxip = 0;
@@ -591,7 +577,7 @@ outtahere:
va = pc;
/* read break instruction */
- instr = fuiword((caddr_t)pc);
+ copyin((caddr_t)pc, &instr, sizeof(unsigned));
#if 0
printf("trap: %s (%d) breakpoint %x at %x: (adr %x ins %x)\n",
p->p_comm, p->p_pid, instr, pc,
@@ -867,19 +853,6 @@ m88110_trap(unsigned type, struct m88100_saved_state *frame)
}
}
- /*
- * We don't want to call vm_fault() if it is fuwintr() or
- * suwintr(). These routines are for copying from interrupt
- * context and vm_fault() can potentially sleep. You may
- * wonder if it isn't bad karma for an interrupt handler to
- * touch the current process. Indeed it is, but clock interrupt
- * does it while doing profiling. It is OK in that context.
- */
-
- if (p->p_addr->u_pcb.pcb_onfault == (int)fubail ||
- p->p_addr->u_pcb.pcb_onfault == (int)subail)
- goto m88110_outtahere;
-
/* data fault on the user address */
if (type == T_DATAFLT && (frame->dsr & CMMU_DSR_SU) == 0) {
type = T_DATAFLT + T_USER;
@@ -941,7 +914,6 @@ m88110_trap(unsigned type, struct m88100_saved_state *frame)
if (!p->p_addr->u_pcb.pcb_onfault)
panictrap(frame->vector, frame);
-m88110_outtahere:
frame->exip = ((unsigned)p->p_addr->u_pcb.pcb_onfault);
return;
case T_INSTFLT+T_USER:
@@ -1095,7 +1067,7 @@ m88110_user_fault:
va = pc;
/* read break instruction */
- instr = fuiword((caddr_t)pc);
+ copyin((caddr_t)pc, &instr, sizeof(unsigned));
#if 1
printf("trap: %s (%d) breakpoint %x at %x: (adr %x ins %x)\n",
p->p_comm, p->p_pid, instr, pc,