Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch <arm/locore.h> fallout (fixes some include ordering...
details: https://anonhg.NetBSD.org/src/rev/4e40e929deda
branches: trunk
changeset: 789412:4e40e929deda
user: matt <matt%NetBSD.org@localhost>
date: Sun Aug 18 15:58:19 2013 +0000
description:
<arm/locore.h> fallout (fixes some include ordering errors)
diffstat:
sys/arch/arm/arm/cpu_in_cksum.S | 140 ++++++++++++++---------
sys/arch/arm/at91/at91bus.c | 19 +-
sys/arch/arm/ep93xx/ep93xx_intr.c | 8 +-
sys/arch/arm/gemini/gemini_pci.c | 27 ++--
sys/arch/arm/include/cpu.h | 4 +
sys/arch/arm/ixp12x0/ixp12x0_intr.c | 11 +-
sys/arch/arm/ixp12x0/ixp12x0_pci.c | 10 +-
sys/arch/arm/omap/omap_intr.h | 4 +-
sys/arch/arm/s3c2xx0/s3c2800_pci.c | 19 +-
sys/arch/arm/xscale/becc_pci.c | 20 +-
sys/arch/arm/xscale/i80312_pci.c | 20 +-
sys/arch/arm/xscale/i80321_pci.c | 22 ++-
sys/arch/evbarm/adi_brh/brh_machdep.c | 10 +-
sys/arch/evbarm/armadillo/armadillo9_machdep.c | 10 +-
sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c | 8 +-
sys/arch/evbarm/gemini/gemini_machdep.c | 16 +-
sys/arch/evbarm/gumstix/gumstix_machdep.c | 10 +-
sys/arch/evbarm/gumstix/gumstix_start.S | 6 +-
sys/arch/evbarm/hdl_g/hdlg_machdep.c | 10 +-
sys/arch/evbarm/ifpga/ifpgavar.h | 3 +-
sys/arch/evbarm/imx31/imx31lk_machdep.c | 10 +-
sys/arch/evbarm/integrator/integrator_machdep.c | 12 +-
sys/arch/evbarm/iq80310/iq80310_machdep.c | 10 +-
sys/arch/evbarm/iq80321/iq80321_machdep.c | 15 +-
sys/arch/evbarm/iq80321/iq80321_pci.c | 14 +-
sys/arch/evbarm/ixdp425/ixdp425_machdep.c | 10 +-
sys/arch/evbarm/ixm1200/ixm1200_machdep.c | 10 +-
sys/arch/evbarm/lubbock/lubbock_machdep.c | 12 +-
sys/arch/evbarm/mpcsa/mpcsa_machdep.c | 22 +-
sys/arch/evbarm/netwalker/netwalker_machdep.c | 12 +-
sys/arch/evbarm/osk5912/osk5912_machdep.c | 12 +-
sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c | 12 +-
sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c | 12 +-
sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c | 11 +-
sys/arch/evbarm/tsarm/tsarm_machdep.c | 10 +-
sys/arch/evbarm/viper/viper_machdep.c | 10 +-
36 files changed, 304 insertions(+), 267 deletions(-)
diffs (truncated from 1624 to 300 lines):
diff -r 9bffa12faf7f -r 4e40e929deda sys/arch/arm/arm/cpu_in_cksum.S
--- a/sys/arch/arm/arm/cpu_in_cksum.S Sun Aug 18 10:40:06 2013 +0000
+++ b/sys/arch/arm/arm/cpu_in_cksum.S Sun Aug 18 15:58:19 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_in_cksum.S,v 1.5 2013/08/18 05:54:16 matt Exp $ */
+/* $NetBSD: cpu_in_cksum.S,v 1.6 2013/08/18 15:58:19 matt Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
*/
#include <machine/asm.h>
-RCSID("$NetBSD: cpu_in_cksum.S,v 1.5 2013/08/18 05:54:16 matt Exp $")
+RCSID("$NetBSD: cpu_in_cksum.S,v 1.6 2013/08/18 15:58:19 matt Exp $")
#include "assym.h"
@@ -91,26 +91,44 @@
ldr ip, [ip, #(M_NEXT)]
.Lin_cksum_entry:
cmp r9, r1
+#ifdef __thumb__
+ bge 1f
+ mov r1, r9
+#else
movlt r1, r9
- sub r9, r9, r1
+#endif
+1: sub r9, r9, r1
eor r11, r10, r0
add r10, r10, r1
adds r2, r1, #0x00
+#ifdef __thumb__
+ it ne
+#endif
blne _ASM_LABEL(.L_cksumdata)
tst r11, #0x01
+#ifdef __thumb__
+ it ne
+#endif
movne r2, r2, ror #8
adds r8, r8, r2
adc r8, r8, #0x00
cmp ip, #00
bne .Lin_cksum_loop
-
- mov r1, #0xff
- orr r1, r1, #0xff00
- and r0, r8, r1
- add r0, r0, r8, lsr #16
- add r0, r0, r0, lsr #16
- and r0, r0, r1
- eor r0, r0, r1
+
+#ifdef __thumb__
+ mov r0, r8
+ lsls r2, r0, #16
+ adds r0, r0, r2
+ bcc 1f
+ adds r0, r0, #65536
+1: mvns r0, r0
+ lsrs r0, r0, #16
+#else
+ adds r8, r8, r8, lsl #16
+ addcs r8, r8, #65536
+ mvn r0, r8
+ lsr r0, r0, #16
+#endif
pop {r4-r11, lr}
RET
@@ -145,37 +163,49 @@
#ifdef __XSCALE__
pld [r0] /* Pre-fetch the start of the buffer */
#endif
- mov r2, #0
+ movs r2, #0
/* We first have to word-align the buffer. */
ands r7, r0, #0x03
beq .Lcksumdata_wordaligned
+ eors r0, r0, r7 /* r0 is word aligned */
+ ldr r2, [r0], #0x04
+#ifdef __thumb__
+ movs r4, r7
+ lsls r4, r4, #3
+#else
+ lsl r4, r7, #3
+#endif
+#if defined(__ARMEB__)
+ lsls r2, r2, r4
+ lsrs r2, r2, r4
+#else
+ lsrs r2, r2, r4
+ lsls r2, r2, r4
+#endif
rsb r7, r7, #0x04
- cmp r1, r7 /* Enough bytes left to make it? */
- blt .Lcksumdata_endgame
- cmp r7, #0x02
- ldrb r4, [r0], #0x01 /* Fetch 1st byte */
- ldrbge r5, [r0], #0x01 /* Fetch 2nd byte */
- movlt r5, #0x00
- ldrbgt r6, [r0], #0x01 /* Fetch 3rd byte */
- movle r6, #0x00
- /* Combine the three bytes depending on endianness and alignment */
-#ifdef __ARMEB__
- orreq r2, r5, r4, lsl #8
- orreq r2, r2, r6, lsl #24
- orrne r2, r4, r5, lsl #8
- orrne r2, r2, r6, lsl #16
+ subs r1, r1, r7 /* Enough bytes left to make it? */
+ bgt .Lcksumdata_wordaligned
+#ifdef __PROG26
+ ldreq pc, [sp], #4 /* done */
#else
- orreq r2, r4, r5, lsl #8
- orreq r2, r2, r6, lsl #16
- orrne r2, r5, r4, lsl #8
- orrne r2, r2, r6, lsl #24
+ RETc(eq) /* done */
#endif
- subs r1, r1, r7 /* Update length */
+ adds r7, r7, r1 /* undo sub */
+ adds r7, r7, r1 /* r7 = offset + len */
+ rsb r7, r7, #4
+ lsls r7, r7, #3
+#if defined(__ARMEB__)
+ lsrs r2, r2, r7
+ lsls r2, r2, r7
+#else
+ lsls r2, r2, r7
+ lsrs r2, r2, r7
+#endif
#ifdef __PROG26
- ldreq pc, [sp], #4 /* All done? */
+ ldr pc, [sp], #4 /* done */
#else
- RETc(eq) /* All done? */
+ RET /* done */
#endif
/* Buffer is now word aligned */
@@ -225,7 +255,7 @@
ldrd r6, [r0], #0x08
adcs r2, r2, r4
adcs r2, r2, r5
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
subs r1, r1, #0x40
ldrdge r4, [r0], #0x08
bge .Lcksumdata_bigloop
@@ -233,7 +263,7 @@
adds r2, r2, r6 /* r6/r7 still need summing */
.Lcksumdata_bigloop_end:
adcs r2, r2, r7
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
#else /* !__XSCALE__ */
@@ -261,7 +291,7 @@
adcs r2, r2, r4
adcs r2, r2, r5
adcs r2, r2, r7
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
subs r1, r1, #0x40
bge .Lcksumdata_bigloop
.Lcksumdata_bigloop_end:
@@ -303,7 +333,7 @@
adcs r2, r2, r5
adcs r2, r2, r7
#endif
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
subs r1, r1, #0x20
#ifdef __PROG26
ldreq pc, [sp], #4
@@ -315,8 +345,11 @@
/* There are less than 32 bytes left */
and r3, r1, #0x18
rsb r4, r3, #0x18
- sub r1, r1, r3
+ subs r1, r1, r3
adds r4, r4, r4, lsr #1 /* Side effect: Clear carry flag */
+#ifdef __thumb__
+ it ne
+#endif
addne pc, pc, r4
/*
@@ -340,14 +373,14 @@
adcs r2, r2, r5
/* Less than 8 bytes remaining... */
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
subs r1, r1, #0x04
blt .Lcksumdata_lessthan4
ldr r4, [r0], #0x04
- sub r1, r1, #0x04
+ subs r1, r1, #0x04
adds r2, r2, r4
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
/* Deal with < 4 bytes remaining */
.Lcksumdata_lessthan4:
@@ -360,27 +393,18 @@
/* Deal with 1 to 3 remaining bytes, possibly misaligned */
.Lcksumdata_endgame:
- ldrb r3, [r0] /* Fetch first byte */
- cmp r1, #0x02
- ldrbge r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */
- movlt r4, #0x00
- ldrbgt r5, [r0, #0x02]
- movle r5, #0x00
- /* Combine the three bytes depending on endianness and alignment */
- tst r0, #0x01
+ ldr r3, [r0] /* Fetch last word */
+ rsb r1, r1, #4 /* get discard amount */
+ lsl r1, r1, #3 /* turn it into bits */
#ifdef __ARMEB__
- orreq r3, r4, r3, lsl #8
- orreq r3, r3, r5, lsl #24
- orrne r3, r3, r4, lsl #8
- orrne r3, r3, r5, lsl #16
+ lsr r3, r3, r1 /* discard least significant bits */
+ lsl r3, r3, r1 /* shift back filling with zeros */
#else
- orreq r3, r3, r4, lsl #8
- orreq r3, r3, r5, lsl #16
- orrne r3, r4, r3, lsl #8
- orrne r3, r3, r5, lsl #24
+ lsl r3, r3, r1 /* discard least significant bits */
+ lsr r3, r3, r1 /* shift back filling with zeros */
#endif
adds r2, r2, r3
- adc r2, r2, #0x00
+ adcs r2, r2, #0x00
#ifdef __PROG26
ldr pc, [sp], #4
#else
diff -r 9bffa12faf7f -r 4e40e929deda sys/arch/arm/at91/at91bus.c
--- a/sys/arch/arm/at91/at91bus.c Sun Aug 18 10:40:06 2013 +0000
+++ b/sys/arch/arm/at91/at91bus.c Sun Aug 18 15:58:19 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: at91bus.c,v 1.16 2012/11/12 18:00:36 skrll Exp $ */
+/* $NetBSD: at91bus.c,v 1.17 2013/08/18 15:58:19 matt Exp $ */
/*
* Copyright (c) 2007 Embedtronics Oy
@@ -27,11 +27,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91bus.c,v 1.16 2012/11/12 18:00:36 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91bus.c,v 1.17 2013/08/18 15:58:19 matt Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
#include "opt_pmap_debug.h"
+#include "locators.h"
/* Define various stack sizes in pages */
#define IRQ_STACK_SIZE 8
@@ -52,8 +53,10 @@
#include <sys/reboot.h>
#include <sys/termios.h>
#include <sys/ksyms.h>
+#include <sys/bus.h>
+#include <sys/cpu.h>
+#include <sys/termios.h>
-#include <machine/bootconfig.h>
#include <uvm/uvm_extern.h>
#include <dev/cons.h>
@@ -62,22 +65,16 @@
#include <ddb/db_sym.h>
#include <ddb/db_extern.h>
-#include <sys/bus.h>
-#include <machine/cpu.h>
-#include <machine/frame.h>
+#include <arm/locore.h>
#include <arm/undefined.h>
#include <arm/arm32/machdep.h>
-#include <arm/cpufunc.h>
#include <arm/at91/at91var.h>
#include <arm/at91/at91busvar.h>
#include <arm/at91/at91dbgureg.h>
-//#include <dev/cons.h>
Home |
Main Index |
Thread Index |
Old Index