Time to get rid of these #ifdef __XSCALE__ bits.  No binary change.

ok?


Index: arch/arm/arm/bcopy_page.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/bcopy_page.S,v
retrieving revision 1.1
diff -u -p -r1.1 bcopy_page.S
--- arch/arm/arm/bcopy_page.S   1 Feb 2004 05:09:48 -0000       1.1
+++ arch/arm/arm/bcopy_page.S   3 Jun 2018 17:54:36 -0000
@@ -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__ */
Index: arch/arm/arm/bcopyinout.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/bcopyinout.S,v
retrieving revision 1.7
diff -u -p -r1.7 bcopyinout.S
--- arch/arm/arm/bcopyinout.S   6 Jan 2017 00:06:02 -0000       1.7
+++ arch/arm/arm/bcopyinout.S   3 Jun 2018 17:54:36 -0000
@@ -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)
Index: arch/arm/arm/exception.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/exception.S,v
retrieving revision 1.7
diff -u -p -r1.7 exception.S
--- arch/arm/arm/exception.S    26 Jan 2018 16:22:19 -0000      1.7
+++ arch/arm/arm/exception.S    3 Jun 2018 17:54:36 -0000
@@ -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 */
Index: arch/arm/arm/fault.c
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/fault.c,v
retrieving revision 1.33
diff -u -p -r1.33 fault.c
--- arch/arm/arm/fault.c        12 Apr 2018 17:13:43 -0000      1.33
+++ arch/arm/arm/fault.c        3 Jun 2018 17:54:36 -0000
@@ -509,52 +509,6 @@ dab_buserr(trapframe_t *tf, u_int fsr, u
 {
        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;
Index: arch/arm/arm/in_cksum_arm.S
===================================================================
RCS file: /cvs/src/sys/arch/arm/arm/in_cksum_arm.S,v
retrieving revision 1.5
diff -u -p -r1.5 in_cksum_arm.S
--- arch/arm/arm/in_cksum_arm.S 8 Jun 2015 14:22:05 -0000       1.5
+++ arch/arm/arm/in_cksum_arm.S 3 Jun 2018 17:54:36 -0000
@@ -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

Reply via email to