diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-08-04 20:20:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-08-04 20:20:20 +0000 |
commit | 3e4150b9cb58bf6291606eea117fa2deb9f7e687 (patch) | |
tree | e7b9016c91961672c56eb2c1729d63752bea5619 /sys/arch/arm | |
parent | c2bb29e827f83c9033545e3d3e0e445a4fc6a077 (diff) |
Remove the old fetch(9)/store(9) functions, since they are not used in
OpenBSD. This gives us a simpler and faster cpu_switch() as a bonus.
ok drahn@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/arm/cpufunc_asm_sa1.S | 22 | ||||
-rw-r--r-- | sys/arch/arm/arm/cpuswitch.S | 30 | ||||
-rw-r--r-- | sys/arch/arm/arm/fault.c | 11 | ||||
-rw-r--r-- | sys/arch/arm/arm/fusu.S | 398 | ||||
-rw-r--r-- | sys/arch/arm/conf/files.arm | 3 |
5 files changed, 6 insertions, 458 deletions
diff --git a/sys/arch/arm/arm/cpufunc_asm_sa1.S b/sys/arch/arm/arm/cpufunc_asm_sa1.S index 01db708e61c..e58ee067827 100644 --- a/sys/arch/arm/arm/cpufunc_asm_sa1.S +++ b/sys/arch/arm/arm/cpufunc_asm_sa1.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cpufunc_asm_sa1.S,v 1.1 2004/02/01 05:09:48 drahn Exp $ */ +/* $OpenBSD: cpufunc_asm_sa1.S,v 1.2 2004/08/04 20:20:18 miod Exp $ */ /* $NetBSD: cpufunc_asm_sa1.S,v 1.8 2002/08/17 16:36:32 thorpej Exp $ */ /* @@ -39,9 +39,6 @@ #include <machine/cpu.h> #include <machine/asm.h> -.Lblock_userspace_access: - .word _C_LABEL(block_userspace_access) - /* * Functions to set the MMU Translation Table Base register * @@ -53,11 +50,6 @@ ENTRY(sa1_setttb) mrs r3, cpsr_all orr r1, r3, #(I32_bit | F32_bit) msr cpsr_all, r1 -#else - ldr r3, .Lblock_userspace_access - ldr r2, [r3] - orr r1, r2, #1 - str r1, [r3] #endif stmfd sp!, {r0-r3, lr} bl _C_LABEL(sa1_cache_cleanID) @@ -79,8 +71,6 @@ ENTRY(sa1_setttb) mov r0, r0 #ifdef CACHE_CLEAN_BLOCK_INTR msr cpsr_all, r3 -#else - str r2, [r3] #endif mov pc, lr @@ -151,14 +141,8 @@ _C_LABEL(sa1_cache_clean_size): #define SA1_CACHE_CLEAN_UNBLOCK \ msr cpsr_all, r3 #else -#define SA1_CACHE_CLEAN_BLOCK \ - ldr r3, .Lblock_userspace_access ; \ - ldr ip, [r3] ; \ - orr r0, ip, #1 ; \ - str r0, [r3] - -#define SA1_CACHE_CLEAN_UNBLOCK \ - str ip, [r3] +#define SA1_CACHE_CLEAN_BLOCK +#define SA1_CACHE_CLEAN_UNBLOCK #endif /* CACHE_CLEAN_BLOCK_INTR */ #ifdef DOUBLE_CACHE_CLEAN_BANK diff --git a/sys/arch/arm/arm/cpuswitch.S b/sys/arch/arm/arm/cpuswitch.S index 813bb1c813f..4eb6a6093f2 100644 --- a/sys/arch/arm/arm/cpuswitch.S +++ b/sys/arch/arm/arm/cpuswitch.S @@ -1,4 +1,4 @@ -/* $OpenBSD: cpuswitch.S,v 1.3 2004/06/13 21:49:13 niklas Exp $ */ +/* $OpenBSD: cpuswitch.S,v 1.4 2004/08/04 20:20:18 miod Exp $ */ /* $NetBSD: cpuswitch.S,v 1.41 2003/11/15 08:44:18 scw Exp $ */ /* @@ -283,9 +283,6 @@ _C_LABEL(curpcb): .text #endif -.Lblock_userspace_access: - .word _C_LABEL(block_userspace_access) - .Lcpu_do_powersave: .word _C_LABEL(cpu_do_powersave) @@ -672,7 +669,6 @@ ENTRY(cpu_switch) cmpeq r0, r1 /* Same DACR? */ beq .Lcs_context_switched /* yes! */ - ldr r3, .Lblock_userspace_access mov r12, #0 cmp r5, #0 /* No last vm? (switch_exit) */ beq .Lcs_cache_purge_skipped /* No, we can skip cache flsh */ @@ -702,12 +698,6 @@ ENTRY(cpu_switch) strb r2, [r5, #(CS_CACHE_ID)] strb r2, [r5, #(CS_CACHE_D)] - /* - * Don't allow user space access between the purge and the switch. - */ - mov r2, #0x00000001 - str r2, [r3] - stmfd sp!, {r0-r3} ldr r1, .Lcpufuncs mov lr, pc @@ -716,7 +706,6 @@ ENTRY(cpu_switch) .Lcs_cache_purge_skipped: /* rem: r1 = new DACR */ - /* rem: r3 = &block_userspace_access */ /* rem: r4 = return value */ /* rem: r5 = &old_pmap->pm_cstate (or NULL) */ /* rem: r6 = new proc */ @@ -725,7 +714,6 @@ ENTRY(cpu_switch) /* rem: r10 = old L1 */ /* rem: r11 = new L1 */ - mov r2, #0x00000000 ldr r7, [r9, #(PCB_PL1VEC)] /* @@ -736,13 +724,6 @@ ENTRY(cpu_switch) IRQdisableALL /* - * Interrupts are disabled so we can allow user space accesses again - * as none will occur until interrupts are re-enabled after the - * switch. - */ - str r2, [r3] - - /* * Ensure the vector table is accessible by fixing up the L1 */ cmp r7, #0 /* No need to fixup vector table? */ @@ -913,7 +894,6 @@ ENTRY(cpu_switch) * Userpsace access already blocked by switch_exit(). */ ldr r9, [r6, #(P_ADDR)] /* r9 = new PCB */ - ldr r3, .Lblock_userspace_access mrc p15, 0, r10, c2, c0, 0 /* r10 = old L1 */ mov r5, #0 /* No previous cache state */ ldr r1, [r9, #(PCB_DACR)] /* r1 = new DACR */ @@ -984,8 +964,6 @@ ENTRY(switch_exit) ldr r0, .Lcurproc mov r5, r1 - ldr r1, .Lblock_userspace_access - mov r6, r2 /* @@ -1014,12 +992,6 @@ ENTRY(switch_exit) mov r2, #-1 str r2, [r3, #(CS_ALL)] /* proc0 is in da cache! */ - /* - * Don't allow user space access between the purge and the switch. - */ - mov r2, #0x00000001 - str r2, [r1] - /* Switch to proc0 context */ ldr r9, .Lcpufuncs diff --git a/sys/arch/arm/arm/fault.c b/sys/arch/arm/arm/fault.c index 9c55bb25bf7..387417b9f9a 100644 --- a/sys/arch/arm/arm/fault.c +++ b/sys/arch/arm/arm/fault.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fault.c,v 1.4 2004/02/23 19:09:57 drahn Exp $ */ +/* $OpenBSD: fault.c,v 1.5 2004/08/04 20:20:18 miod Exp $ */ /* $NetBSD: fault.c,v 1.46 2004/01/21 15:39:21 skrll Exp $ */ /* @@ -108,8 +108,6 @@ #include <arch/arm/arm/disassem.h> #include <arm/machdep.h> -extern char fusubailout[]; - #ifdef DEBUG int last_fault_code; /* For the benefit of pmap_fault_fixup() */ #endif @@ -254,13 +252,6 @@ data_abort_handler(trapframe_t *tf) * the MMU. */ - /* fusubailout is used by [fs]uswintr to avoid page faulting */ - if (__predict_false(pcb->pcb_onfault == fusubailout)) { - tf->tf_r0 = EFAULT; - tf->tf_pc = (register_t)pcb->pcb_onfault; - return; - } - if (user) p->p_addr->u_pcb.pcb_tf = tf; diff --git a/sys/arch/arm/arm/fusu.S b/sys/arch/arm/arm/fusu.S deleted file mode 100644 index 277e5ad72d9..00000000000 --- a/sys/arch/arm/arm/fusu.S +++ /dev/null @@ -1,398 +0,0 @@ -/* $OpenBSD: fusu.S,v 1.2 2004/02/01 06:10:33 drahn Exp $ */ -/* $NetBSD: exception.S,v 1.13 2003/10/31 16:30:15 scw Exp $ */ - - -/* - * Copyright (c) 1996-1998 Mark Brinicombe. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Mark Brinicombe - * 4. The name of the company nor the name of the author may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "assym.h" -#include <machine/asm.h> - -#ifdef MULTIPROCESSOR -.Lcpu_info: - .word _C_LABEL(cpu_info) -#else -.Lcurpcb: - .word _C_LABEL(curpcb) -#endif - -/* - * fuword(caddr_t uaddr); - * Fetch an int from the user's address space. - */ - -ENTRY(fuword) -#ifdef MULTIPROCESSOR - /* XXX Probably not appropriate for non-Hydra SMPs */ - stmfd sp!, {r0, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r1, .Lfusufault - str r1, [r2, #PCB_ONFAULT] - - ldrt r3, [r0] - - mov r1, #0x00000000 - str r1, [r2, #PCB_ONFAULT] - mov r0, r3 - mov pc, lr - -/* - * fusword(caddr_t uaddr); - * Fetch a short from the user's address space. - */ - -ENTRY(fusword) -#ifdef MULTIPROCESSOR - /* XXX Probably not appropriate for non-Hydra SMPs */ - stmfd sp!, {r0, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r1, .Lfusufault - str r1, [r2, #PCB_ONFAULT] - - ldrbt r3, [r0], #1 - ldrbt ip, [r0] -#ifdef __ARMEB__ - orr r0, ip, r3, asl #8 -#else - orr r0, r3, ip, asl #8 -#endif - mov r1, #0x00000000 - str r1, [r2, #PCB_ONFAULT] - mov pc, lr - -/* - * fuswintr(caddr_t uaddr); - * Fetch a short from the user's address space. Can be called during an - * interrupt. - */ - -ENTRY(fuswintr) - ldr r2, Lblock_userspace_access - ldr r2, [r2] - teq r2, #0 - mvnne r0, #0x00000000 - movne pc, lr - -#ifdef MULTIPROCESSOR - /* XXX Probably not appropriate for non-Hydra SMPs */ - stmfd sp!, {r0, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r1, _C_LABEL(fusubailout) - str r1, [r2, #PCB_ONFAULT] - - ldrbt r3, [r0], #1 - ldrbt ip, [r0] -#ifdef __ARMEB__ - orr r0, ip, r3, asl #8 -#else - orr r0, r3, ip, asl #8 -#endif - - mov r1, #0x00000000 - str r1, [r2, #PCB_ONFAULT] - mov pc, lr - -Lblock_userspace_access: - .word _C_LABEL(block_userspace_access) - - .data - .align 0 - .global _C_LABEL(block_userspace_access) -_C_LABEL(block_userspace_access): - .word 0 - .text - -/* - * fubyte(caddr_t uaddr); - * Fetch a byte from the user's address space. - */ - -ENTRY(fubyte) -#ifdef MULTIPROCESSOR - /* XXX Probably not appropriate for non-Hydra SMPs */ - stmfd sp!, {r0, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r1, .Lfusufault - str r1, [r2, #PCB_ONFAULT] - - ldrbt r3, [r0] - - mov r1, #0x00000000 - str r1, [r2, #PCB_ONFAULT] - mov r0, r3 - mov pc, lr - -/* - * Handle faults from [fs]u*(). Clean up and return -1. - */ - -.Lfusufault: - mov r0, #0x00000000 - str r0, [r2, #PCB_ONFAULT] - mvn r0, #0x00000000 - mov pc, lr - -/* - * Handle faults from [fs]u*(). Clean up and return -1. This differs from - * fusufault() in that trap() will recognise it and return immediately rather - * than trying to page fault. - */ - -/* label must be global as fault.c references it */ - .global _C_LABEL(fusubailout) -_C_LABEL(fusubailout): - mov r0, #0x00000000 - str r0, [r2, #PCB_ONFAULT] - mvn r0, #0x00000000 - mov pc, lr - -#ifdef DIAGNOSTIC -/* - * Handle earlier faults from [fs]u*(), due to no pcb - */ - -.Lfusupcbfault: - mov r1, r0 - adr r0, fusupcbfaulttext - b _C_LABEL(panic) - -fusupcbfaulttext: - .asciz "Yikes - no valid PCB during fusuxxx() addr=%08x\n" - .align 0 -#endif - -/* - * suword(caddr_t uaddr, int x); - * Store an int in the user's address space. - */ - -ENTRY(suword) -#ifdef MULTIPROCESSOR - /* XXX Probably not appropriate for non-Hydra SMPs */ - stmfd sp!, {r0, r1, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r1, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r3, .Lfusufault - str r3, [r2, #PCB_ONFAULT] - - strt r1, [r0] - - mov r0, #0x00000000 - str r0, [r2, #PCB_ONFAULT] - mov pc, lr - -/* - * suswintr(caddr_t uaddr, short x); - * Store a short in the user's address space. Can be called during an - * interrupt. - */ - -ENTRY(suswintr) - ldr r2, Lblock_userspace_access - ldr r2, [r2] - teq r2, #0 - mvnne r0, #0x00000000 - movne pc, lr - -#ifdef MULTIPROCESSOR - stmfd sp!, {r0, r1, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r1, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r3, _C_LABEL(fusubailout) - str r3, [r2, #PCB_ONFAULT] - -#ifdef __ARMEB__ - mov ip, r1, lsr #8 - strbt ip, [r0], #1 -#else - strbt r1, [r0], #1 - mov r1, r1, lsr #8 -#endif - strbt r1, [r0] - - mov r0, #0x00000000 - str r0, [r2, #PCB_ONFAULT] - mov pc, lr - -/* - * susword(caddr_t uaddr, short x); - * Store a short in the user's address space. - */ - -ENTRY(susword) -#ifdef MULTIPROCESSOR - stmfd sp!, {r0, r1, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r1, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r3, .Lfusufault - str r3, [r2, #PCB_ONFAULT] - -#ifdef __ARMEB__ - mov ip, r1, lsr #8 - strbt ip, [r0], #1 -#else - strbt r1, [r0], #1 - mov r1, r1, lsr #8 -#endif - strbt r1, [r0] - - mov r0, #0x00000000 - str r0, [r2, #PCB_ONFAULT] - mov pc, lr - -/* - * subyte(caddr_t uaddr, char x); - * Store a byte in the user's address space. - */ - -ENTRY(subyte) -#ifdef MULTIPROCESSOR - stmfd sp!, {r0, r1, r14} - bl _C_LABEL(cpu_number) - ldr r2, .Lcpu_info - ldr r2, [r2, r0, lsl #2] - ldr r2, [r2, #CI_CURPCB] - ldmfd sp!, {r0, r1, r14} -#else - ldr r2, .Lcurpcb - ldr r2, [r2] -#endif - - -#ifdef DIAGNOSTIC - teq r2, #0x00000000 - beq .Lfusupcbfault -#endif - - adr r3, .Lfusufault - str r3, [r2, #PCB_ONFAULT] - - strbt r1, [r0] - - mov r0, #0x00000000 - str r0, [r2, #PCB_ONFAULT] - mov pc, lr diff --git a/sys/arch/arm/conf/files.arm b/sys/arch/arm/conf/files.arm index f3196ad4742..eea8b3b798e 100644 --- a/sys/arch/arm/conf/files.arm +++ b/sys/arch/arm/conf/files.arm @@ -1,4 +1,4 @@ -# $OpenBSD: files.arm,v 1.1 2004/02/01 05:09:48 drahn Exp $ +# $OpenBSD: files.arm,v 1.2 2004/08/04 20:20:19 miod Exp $ # $NetBSD: files.arm,v 1.76 2003/11/05 12:53:15 scw Exp $ # CPU types. Make sure to update <arm/cpuconf.h> if you change this list. @@ -119,7 +119,6 @@ file arch/arm/arm/cpu.c file arch/arm/arm/cpuswitch.S file arch/arm/arm/exception.S file arch/arm/arm/fault.c -file arch/arm/arm/fusu.S file arch/arm/arm/mem.c file arch/arm/arm/pmap.c file arch/arm/arm/setcpsr.S |