summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-06-03 18:58:12 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-06-03 18:58:12 +0000
commit5bf69eac949c9ee5429900f0db0795c4ff9bd4f6 (patch)
tree712f2d3ab6ccea1bd6e2623445c169ad7e5df227 /sys/arch
parentc2522df442667b079639dc09920a073b571de0ec (diff)
Remove #ifdef __XSCALE__ bits. No binary change.
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/arm/arm/bcopy_page.S100
-rw-r--r--sys/arch/arm/arm/bcopyinout.S32
-rw-r--r--sys/arch/arm/arm/exception.S10
-rw-r--r--sys/arch/arm/arm/fault.c48
-rw-r--r--sys/arch/arm/arm/in_cksum_arm.S94
5 files changed, 5 insertions, 279 deletions
diff --git a/sys/arch/arm/arm/bcopy_page.S b/sys/arch/arm/arm/bcopy_page.S
index 3c8f1ae2ce6..d49d313165a 100644
--- a/sys/arch/arm/arm/bcopy_page.S
+++ b/sys/arch/arm/arm/bcopy_page.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcopy_page.S,v 1.1 2004/02/01 05:09:48 drahn Exp $ */
+/* $OpenBSD: bcopy_page.S,v 1.2 2018/06/03 18:58:11 kettenis Exp $ */
/* $NetBSD: bcopy_page.S,v 1.7 2003/10/13 21:03:13 scw Exp $ */
@@ -44,8 +44,6 @@
#include "assym.h"
-#ifndef __XSCALE__
-
/* #define BIG_LOOPS */
/*
@@ -178,99 +176,3 @@ ENTRY(bzero_page)
bne 1b
ldmfd sp!, {r4-r8, pc}
-
-#else /* __XSCALE__ */
-
-/*
- * XSCALE version of bcopy_page
- */
-ENTRY(bcopy_page)
- pld [r0]
- stmfd sp!, {r4, r5}
- mov ip, #32
- ldr r2, [r0], #0x04 /* 0x00 */
- ldr r3, [r0], #0x04 /* 0x04 */
-1: pld [r0, #0x18] /* Prefetch 0x20 */
- ldr r4, [r0], #0x04 /* 0x08 */
- ldr r5, [r0], #0x04 /* 0x0c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x10 */
- ldr r3, [r0], #0x04 /* 0x14 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x18 */
- ldr r5, [r0], #0x04 /* 0x1c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x20 */
- ldr r3, [r0], #0x04 /* 0x24 */
- pld [r0, #0x18] /* Prefetch 0x40 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x28 */
- ldr r5, [r0], #0x04 /* 0x2c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x30 */
- ldr r3, [r0], #0x04 /* 0x34 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x38 */
- ldr r5, [r0], #0x04 /* 0x3c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x40 */
- ldr r3, [r0], #0x04 /* 0x44 */
- pld [r0, #0x18] /* Prefetch 0x60 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x48 */
- ldr r5, [r0], #0x04 /* 0x4c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x50 */
- ldr r3, [r0], #0x04 /* 0x54 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x58 */
- ldr r5, [r0], #0x04 /* 0x5c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x60 */
- ldr r3, [r0], #0x04 /* 0x64 */
- pld [r0, #0x18] /* Prefetch 0x80 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x68 */
- ldr r5, [r0], #0x04 /* 0x6c */
- strd r2, [r1], #0x08
- ldr r2, [r0], #0x04 /* 0x70 */
- ldr r3, [r0], #0x04 /* 0x74 */
- strd r4, [r1], #0x08
- ldr r4, [r0], #0x04 /* 0x78 */
- ldr r5, [r0], #0x04 /* 0x7c */
- strd r2, [r1], #0x08
- subs ip, ip, #0x01
- ldrgt r2, [r0], #0x04 /* 0x80 */
- ldrgt r3, [r0], #0x04 /* 0x84 */
- strd r4, [r1], #0x08
- bgt 1b
- ldmfd sp!, {r4, r5}
- mov pc, lr
-
-/*
- * XSCALE version of bzero_page
- */
-ENTRY(bzero_page)
- mov r1, #PAGE_SIZE
- mov r2, #0
- mov r3, #0
-1: strd r2, [r0], #8 /* 32 */
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8 /* 64 */
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8 /* 96 */
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8 /* 128 */
- strd r2, [r0], #8
- strd r2, [r0], #8
- strd r2, [r0], #8
- subs r1, r1, #128
- bne 1b
- mov pc, lr
-#endif /* __XSCALE__ */
diff --git a/sys/arch/arm/arm/bcopyinout.S b/sys/arch/arm/arm/bcopyinout.S
index 9a7d11865c0..4834083a73d 100644
--- a/sys/arch/arm/arm/bcopyinout.S
+++ b/sys/arch/arm/arm/bcopyinout.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcopyinout.S,v 1.7 2017/01/06 00:06:02 jsg Exp $ */
+/* $OpenBSD: bcopyinout.S,v 1.8 2018/06/03 18:58:11 kettenis Exp $ */
/* $NetBSD: bcopyinout.S,v 1.13 2003/10/31 16:54:05 scw Exp $ */
/*
@@ -41,10 +41,6 @@
#include <machine/asm.h>
#include <arm/sysreg.h>
-#ifdef __XSCALE__
-#include "bcopyinout_xscale.S"
-#else
-
.text
.align 2
@@ -59,13 +55,6 @@
#define SAVE_REGS stmfd sp!, {r4-r11}
#define RESTORE_REGS ldmfd sp!, {r4-r11}
-#if defined(__XSCALE__)
-#define HELLOCPP #
-#define PREFETCH(rx,o) pld [ rx , HELLOCPP (o) ]
-#else
-#define PREFETCH(rx,o)
-#endif
-
/*
* r0 = user space address
* r1 = kernel space address
@@ -92,9 +81,6 @@ ENTRY(copyin)
adr r3, .Lcopyfault
str r3, [r4, #PCB_ONFAULT]
- PREFETCH(r0, 0)
- PREFETCH(r1, 0)
-
/*
* If not too many bytes, take the slow path.
*/
@@ -191,9 +177,6 @@ ENTRY(copyin)
* copy cacheline
*/
.Licaligned:
- PREFETCH(r0, 32)
- PREFETCH(r1, 32)
-
sub r2, r2, #0x20
/* Copy a cacheline */
@@ -307,9 +290,6 @@ ENTRY(copyout)
adr r3, .Lcopyfault
str r3, [r4, #PCB_ONFAULT]
- PREFETCH(r0, 0)
- PREFETCH(r1, 0)
-
/*
* If not too many bytes, take the slow path.
*/
@@ -403,9 +383,6 @@ ENTRY(copyout)
* copy cacheline
*/
.Lcaligned:
- PREFETCH(r0, 32)
- PREFETCH(r1, 32)
-
sub r2, r2, #0x20
/* Copy a cacheline */
@@ -512,9 +489,6 @@ ENTRY(kcopy)
adr r3, .Lcopyfault
str r3, [r4, #PCB_ONFAULT]
- PREFETCH(r0, 0)
- PREFETCH(r1, 0)
-
/*
* If not too many bytes, take the slow path.
*/
@@ -608,9 +582,6 @@ ENTRY(kcopy)
* copy cacheline
*/
.Lkcaligned:
- PREFETCH(r0, 32)
- PREFETCH(r1, 32)
-
sub r2, r2, #0x20
/* Copy a cacheline */
@@ -679,7 +650,6 @@ ENTRY(kcopy)
RESTORE_REGS
mov pc, lr
-#endif /* !__XSCALE__ */
/*
* int badaddr_read_1(const uint8_t *src, uint8_t *dest)
diff --git a/sys/arch/arm/arm/exception.S b/sys/arch/arm/arm/exception.S
index 3cf4e2c266c..0d34cad7c3d 100644
--- a/sys/arch/arm/arm/exception.S
+++ b/sys/arch/arm/arm/exception.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: exception.S,v 1.7 2018/01/26 16:22:19 kettenis Exp $ */
+/* $OpenBSD: exception.S,v 1.8 2018/06/03 18:58:11 kettenis Exp $ */
/* $NetBSD: exception.S,v 1.13 2003/10/31 16:30:15 scw Exp $ */
/*
@@ -99,10 +99,6 @@ ASENTRY_NP(swi_entry)
* Handler for the Prefetch Abort exception.
*/
ASENTRY_NP(prefetch_abort_entry)
-#ifdef __XSCALE__
- nop /* Make absolutely sure any pending */
- nop /* imprecise aborts have occurred. */
-#endif
sub lr, lr, #0x00000004 /* Adjust the lr */
PUSHFRAMEINSVC
@@ -136,10 +132,6 @@ abortprefetchmsg:
* Handler for the Data Abort exception.
*/
ASENTRY_NP(data_abort_entry)
-#ifdef __XSCALE__
- nop /* Make absolutely sure any pending */
- nop /* imprecise aborts have occurred. */
-#endif
sub lr, lr, #0x00000008 /* Adjust the lr */
PUSHFRAMEINSVC /* Push trap frame and switch */
diff --git a/sys/arch/arm/arm/fault.c b/sys/arch/arm/arm/fault.c
index c69f5ea9439..8fc4836d47c 100644
--- a/sys/arch/arm/arm/fault.c
+++ b/sys/arch/arm/arm/fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fault.c,v 1.33 2018/04/12 17:13:43 deraadt Exp $ */
+/* $OpenBSD: fault.c,v 1.34 2018/06/03 18:58:11 kettenis Exp $ */
/* $NetBSD: fault.c,v 1.46 2004/01/21 15:39:21 skrll Exp $ */
/*
@@ -509,52 +509,6 @@ dab_buserr(trapframe_t *tf, u_int fsr, u_int far, struct proc *p,
{
struct pcb *pcb = &p->p_addr->u_pcb;
-#ifdef __XSCALE__
- if ((fsr & FAULT_IMPRECISE) != 0 &&
- (tf->tf_spsr & PSR_MODE) == PSR_ABT32_MODE) {
- /*
- * Oops, an imprecise, double abort fault. We've lost the
- * r14_abt/spsr_abt values corresponding to the original
- * abort, and the spsr saved in the trapframe indicates
- * ABT mode.
- */
- tf->tf_spsr &= ~PSR_MODE;
-
- /*
- * We use a simple heuristic to determine if the double abort
- * happened as a result of a kernel or user mode access.
- * If the current trapframe is at the top of the kernel stack,
- * the fault _must_ have come from user mode.
- */
- if (tf != ((trapframe_t *)pcb->pcb_un.un_32.pcb32_sp) - 1) {
- /*
- * Kernel mode. We're either about to die a
- * spectacular death, or pcb_onfault will come
- * to our rescue. Either way, the current value
- * of tf->tf_pc is irrelevant.
- */
- tf->tf_spsr |= PSR_SVC32_MODE;
- if (pcb->pcb_onfault == NULL)
- printf("\nKernel mode double abort!\n");
- } else {
- /*
- * User mode. We've lost the program counter at the
- * time of the fault (not that it was accurate anyway;
- * it's not called an imprecise fault for nothing).
- * About all we can do is copy r14_usr to tf_pc and
- * hope for the best. The process is about to get a
- * SIGBUS, so it's probably history anyway.
- */
- tf->tf_spsr |= PSR_USR32_MODE;
- tf->tf_pc = tf->tf_usr_lr;
- }
- }
-
- /* FAR is invalid for imprecise exceptions */
- if ((fsr & FAULT_IMPRECISE) != 0)
- far = 0;
-#endif /* __XSCALE__ */
-
if (pcb->pcb_onfault) {
KDASSERT(TRAP_USERMODE(tf) == 0);
tf->tf_r0 = EFAULT;
diff --git a/sys/arch/arm/arm/in_cksum_arm.S b/sys/arch/arm/arm/in_cksum_arm.S
index 02140c9605d..3de8a7c38f0 100644
--- a/sys/arch/arm/arm/in_cksum_arm.S
+++ b/sys/arch/arm/arm/in_cksum_arm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: in_cksum_arm.S,v 1.5 2015/06/08 14:22:05 jsg Exp $ */
+/* $OpenBSD: in_cksum_arm.S,v 1.6 2018/06/03 18:58:11 kettenis Exp $ */
/* $NetBSD: in_cksum_arm.S,v 1.3 2003/11/26 10:31:53 rearnsha Exp $ */
/*
@@ -111,9 +111,6 @@ ENTRY(in4_cksum)
cmp r1, #0x00
beq .Lin4_cksum_skip_entry
-#ifdef __XSCALE__
- pld [r6, #(IP_SRC)]
-#endif
add r4, r6, #(IP_SRC)
ands r4, r4, #0x03
add r8, r1, r3 /* sum = nxt + len */
@@ -141,16 +138,6 @@ ENTRY(in4_cksum)
b .Lin4_cksum_add_ips
/* 0x02: Data 16-bit aligned */
-#ifdef __XSCALE__
- ldrh r5, [r6, #(IP_SRC)] /* BE:r5 = ..01 LE:r5 = ..10 */
- ldrh r7, [r6, #(IP_DST + 2)] /* BE:r7 = ..67 LE:r7 = ..76 */
- ldr r4, [r6, #(IP_SRC + 2)] /* BE:r4 = 2345 LE:r4 = 5432 */
- orr r5, r7, r5, lsl #16 /* BE:r5 = 0167 LE:r5 = 1076 */
- b .Lin4_cksum_add_ips
- nop
- nop
- nop
-#else
ldr r4, [r6, #(IP_SRC - 2)] /* r4 = 10xx */
ldr r7, [r6, #(IP_DST - 2)] /* r7 = xx76 */
ldr r5, [r6, #(IP_SRC + 2)] /* r5 = 5432 */
@@ -159,7 +146,6 @@ ENTRY(in4_cksum)
b .Lin4_cksum_add_ips
nop
nop
-#endif
/* 0x03: Data 8-bit aligned */
ldrb r4, [r6, #(IP_SRC)] /* r4 = ...0 */
@@ -220,9 +206,6 @@ ENTRY(in4_cksum)
*/
/* LINTSTUB: Ignore */
ASENTRY_NP(L_cksumdata)
-#ifdef __XSCALE__
- pld [r0] /* Pre-fetch the start of the buffer */
-#endif
mov r2, #0
/* We first have to word-align the buffer. */
@@ -247,63 +230,6 @@ ASENTRY_NP(L_cksumdata)
/* Buffer is now word aligned */
.Lcksumdata_wordaligned:
-#ifdef __XSCALE__
- cmp r1, #0x04 /* Less than 4 bytes left? */
- blt .Lcksumdata_endgame /* Yup */
-
- /* Now quad-align, if necessary */
- ands r7, r0, #0x04
- ldrne r7, [r0], #0x04
- subne r1, r1, #0x04
- subs r1, r1, #0x40
- blt .Lcksumdata_bigloop_end /* Note: C flag clear if branch taken */
-
- /*
- * Buffer is now quad aligned. Sum 64 bytes at a time.
- * Note: First ldrd is hoisted above the loop, together with
- * setting r6 to zero to avoid stalling for results in the
- * loop. (r7 is live, from above).
- */
- ldrd r4, [r0], #0x08
- mov r6, #0x00
-.Lcksumdata_bigloop:
- pld [r0, #0x18]
- adds r2, r2, r6
- adcs r2, r2, r7
- ldrd r6, [r0], #0x08
- adcs r2, r2, r4
- adcs r2, r2, r5
- ldrd r4, [r0], #0x08
- adcs r2, r2, r6
- adcs r2, r2, r7
- ldrd r6, [r0], #0x08
- adcs r2, r2, r4
- adcs r2, r2, r5
- ldrd r4, [r0], #0x08
- adcs r2, r2, r6
- adcs r2, r2, r7
- pld [r0, #0x18]
- ldrd r6, [r0], #0x08
- adcs r2, r2, r4
- adcs r2, r2, r5
- ldrd r4, [r0], #0x08
- adcs r2, r2, r6
- adcs r2, r2, r7
- ldrd r6, [r0], #0x08
- adcs r2, r2, r4
- adcs r2, r2, r5
- adc r2, r2, #0x00
- subs r1, r1, #0x40
- ldrged r4, [r0], #0x08
- bge .Lcksumdata_bigloop
-
- adds r2, r2, r6 /* r6/r7 still need summing */
-.Lcksumdata_bigloop_end:
- adcs r2, r2, r7
- adc r2, r2, #0x00
-
-#else /* !__XSCALE__ */
-
subs r1, r1, #0x40
blt .Lcksumdata_bigloop_end
@@ -332,28 +258,11 @@ ASENTRY_NP(L_cksumdata)
subs r1, r1, #0x40
bge .Lcksumdata_bigloop
.Lcksumdata_bigloop_end:
-#endif
adds r1, r1, #0x40
moveq pc, lr
cmp r1, #0x20
-#ifdef __XSCALE__
- ldrged r4, [r0], #0x08 /* Avoid stalling pld and result */
- blt .Lcksumdata_less_than_32
- pld [r0, #0x18]
- ldrd r6, [r0], #0x08
- adds r2, r2, r4
- adcs r2, r2, r5
- ldrd r4, [r0], #0x08
- adcs r2, r2, r6
- adcs r2, r2, r7
- ldrd r6, [r0], #0x08
- adcs r2, r2, r4
- adcs r2, r2, r5
- adcs r2, r2, r6 /* XXX: Unavoidable result stall */
- adcs r2, r2, r7
-#else
blt .Lcksumdata_less_than_32
ldmia r0!, {r3, r4, r5, r6}
adds r2, r2, r3
@@ -365,7 +274,6 @@ ASENTRY_NP(L_cksumdata)
adcs r2, r2, r4
adcs r2, r2, r5
adcs r2, r2, r7
-#endif
adc r2, r2, #0x00
subs r1, r1, #0x20
moveq pc, lr