summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
commit03ba4131783cc9e872f8bb26a03f15bc11f27564 (patch)
tree88db8dba75ae06ba3bad08e42c5e52efc162535c /arch/arm/lib
parent257730f99381dd26e10b832fce4c94cae7ac1176 (diff)
- Merge with Linux 2.1.121.
- Bugfixes.
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/Makefile6
-rw-r--r--arch/arm/lib/checksum.S22
-rw-r--r--arch/arm/lib/fp_support.c22
-rw-r--r--arch/arm/lib/getconsdata.c2
-rw-r--r--arch/arm/lib/io-acorn.S7
-rw-r--r--arch/arm/lib/io.c1
-rw-r--r--arch/arm/lib/system.S2
-rw-r--r--arch/arm/lib/testm.c81
-rw-r--r--arch/arm/lib/uaccess.S18
9 files changed, 43 insertions, 118 deletions
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 5d0974ab3..d47a092cb 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -5,15 +5,15 @@
#
L_TARGET := lib.a
-L_OBJS := backtrace.o bitops.o checksum.o delay.o fp_support.o \
- loaders.o memcpy.o system.o string.o uaccess.o io.o
+L_OBJS := backtrace.o bitops.o checksum.o delay.o io.o memcpy.o \
+ system.o string.o uaccess.o
ifeq ($(PROCESSOR),armo)
L_OBJS += uaccess-armo.o
endif
ifdef CONFIG_ARCH_ACORN
- L_OBJS += ll_char_wr.o io-acorn.o
+ L_OBJS += loaders.o ll_char_wr.o io-acorn.o
ifdef CONFIG_ARCH_A5K
L_OBJS += floppydma.o
endif
diff --git a/arch/arm/lib/checksum.S b/arch/arm/lib/checksum.S
index 06eb98edd..bd5c78d34 100644
--- a/arch/arm/lib/checksum.S
+++ b/arch/arm/lib/checksum.S
@@ -1,5 +1,5 @@
/*
- * linux/arch/arm/lib/iputils.S
+ * linux/arch/arm/lib/checksum.S
*
* Copyright (C) 1995, 1996, 1997, 1998 Russell King
*/
@@ -71,11 +71,11 @@ ENTRY(csum_partial)
#if defined(CONFIG_CPU_32)
.macro save_regs
- stmfd sp!, {r4 - r8, fp, ip, lr, pc}
+ stmfd sp!, {r1 - r2, r4 - r8, fp, ip, lr, pc}
.endm
#define LOAD_REGS(cond) \
- LOADREGS(##cond##ea,fp,{r4 - r8, fp, sp, pc})
+ LOADREGS(##cond##ea,fp,{r1 - r2, r4 - r8, fp, sp, pc})
.macro load1b, reg1
9999: ldrbt \reg1, [r0], $1
@@ -127,7 +127,7 @@ ENTRY(csum_partial)
#elif defined(CONFIG_CPU_26)
.macro save_regs
- stmfd sp!, {r4 - r9, fp, ip, lr, pc}
+ stmfd sp!, {r1 - r2, r4 - r9, fp, ip, lr, pc}
mov r9, sp, lsr #13
mov r9, r9, lsl #13
ldr r9, [r9, #TSK_ADDR_LIMIT]
@@ -135,7 +135,7 @@ ENTRY(csum_partial)
.endm
#define LOAD_REGS(cond) \
- LOADREGS(##cond##ea,fp,{r4 - r9, fp, sp, pc})
+ LOADREGS(##cond##ea,fp,{r1 - r2, r4 - r9, fp, sp, pc})
.macro load1b, reg1
tst r9, #0x01
@@ -448,13 +448,23 @@ ENTRY(csum_partial_copy_from_user)
mov r4, r4, lsr #8
b .exit
+#if defined(CONFIG_CPU_32)
.section .fixup,"ax"
+#endif
.align 4
6001: mov r4, #-EFAULT
ldr r5, [fp, #4]
str r4, [r5]
+ ldmia sp, {r1, r2} @ retrieve original arguments
+ add r2, r2, r1
+ mov r3, #0 @ zero the buffer
+6002: teq r2, r1
+ strneb r3, [r1], #1
+ bne 6002b
LOAD_REGS(al)
+#if defined(CONFIG_CPU_32)
.previous
+#endif
/* Function: __u32 csum_partial_copy (const char *src, char *dst, int len, __u32 sum)
* Params : r0 = src, r1 = dst, r2 = len, r3 = checksum
@@ -701,7 +711,7 @@ Lsrc3_aligned: mov r4, r4, lsr #24
mov r4, r4, lsr #8
b Lexit
-ENTRY(csum_ipv6_magic)
+ENTRY(__csum_ipv6_magic)
stmfd sp!, {lr}
adds ip, r2, r3
ldmia r1, {r1 - r3, lr}
diff --git a/arch/arm/lib/fp_support.c b/arch/arm/lib/fp_support.c
deleted file mode 100644
index aaac3c766..000000000
--- a/arch/arm/lib/fp_support.c
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * linux/arch/arm/lib/fp_support.c
- *
- * Copyright (C) 1995, 1996 Russell King
- */
-
-#include <linux/sched.h>
-#include <linux/linkage.h>
-
-extern void (*fp_save)(struct fp_soft_struct *);
-
-asmlinkage void fp_setup(void)
-{
- struct task_struct *p;
-
- p = &init_task;
- do {
- fp_save(&p->tss.fpstate.soft);
- p = p->next_task;
- }
- while (p != &init_task);
-}
diff --git a/arch/arm/lib/getconsdata.c b/arch/arm/lib/getconsdata.c
index 59f989cfb..ba145eaff 100644
--- a/arch/arm/lib/getconsdata.c
+++ b/arch/arm/lib/getconsdata.c
@@ -24,8 +24,10 @@ unsigned long DOM_USERDOMAIN = USER_DOMAIN;
unsigned long TSK_STATE = OFF_TSK(state);
unsigned long TSK_FLAGS = OFF_TSK(flags);
+unsigned long TSK_NEED_RESCHED = OFF_TSK(need_resched);
unsigned long TSK_SIGPENDING = OFF_TSK(sigpending);
unsigned long TSK_ADDR_LIMIT = OFF_TSK(addr_limit);
+unsigned long TSK_USED_MATH = OFF_TSK(used_math);
unsigned long MM = OFF_TSK(mm);
unsigned long PGD = OFF_MM(pgd);
diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index d7769eef3..6baa4cd50 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -166,6 +166,13 @@ ENTRY(outswb)
bgt 3b
LOADREGS(ea, fp, {r4 - r8, fp, sp, pc})
+/*
+ * These make no sense on Acorn machines atm.
+ */
+ENTRY(insl)
+ENTRY(outsl)
+ RETINSTR(mov,pc,lr)
+
@ Purpose: write a memc register
@ Proto : void memc_write(int register, int value);
@ Returns: nothing
diff --git a/arch/arm/lib/io.c b/arch/arm/lib/io.c
index ba2f9efd0..d01877934 100644
--- a/arch/arm/lib/io.c
+++ b/arch/arm/lib/io.c
@@ -40,4 +40,3 @@ void _memset_io(unsigned long dst, int c, unsigned long count)
dst++;
}
}
-
diff --git a/arch/arm/lib/system.S b/arch/arm/lib/system.S
index 54ea4d9a4..f037d56ff 100644
--- a/arch/arm/lib/system.S
+++ b/arch/arm/lib/system.S
@@ -16,5 +16,5 @@ ENTRY(abort)
b SYMBOL_NAME(panic)
.abort_msg: .ascii "Eek! Got to an abort() from %p! "
- .ascii "(Please report to rmk@ecs.soton.ac.uk)\n\0"
+ .ascii "(Please report to rmk@arm.uk.linux.org)\n\0"
.align
diff --git a/arch/arm/lib/testm.c b/arch/arm/lib/testm.c
deleted file mode 100644
index 88e815605..000000000
--- a/arch/arm/lib/testm.c
+++ /dev/null
@@ -1,81 +0,0 @@
-char buffer[1036];
-char buffer2[1036];
-
-int main ()
-{
- char *p;
- int i, o, o2, l;
-
- printf ("Testing memset\n");
- for (l = 1; l < 1020; l ++) {
- for (o = 0; o < 4; o++) {
- p = buffer + o + 4;
- for (i = 0; i < l + 12; i++)
- buffer[i] = 0x55;
-
- memset (p, 0xaa, l);
-
- for (i = 0; i < l; i++)
- if (p[i] != 0xaa)
- printf ("Error: %X+%d\n", p, i);
- if (p[-1] != 0x55 || p[-2] != 0x55 || p[-3] != 0x55 || p[-4] != 0x55)
- printf ("Error before %X\n", p);
- if (p[l] != 0x55 || p[l+1] != 0x55 || p[l+2] != 0x55 || p[l+3] != 0x55)
- printf ("Error at end: %p: %02X %02X %02X %02X\n", p+l, p[l], p[l+1], p[l+2], p[l+3]);
- }
- }
-
- printf ("Testing memcpy s > d\n");
- for (l = 1; l < 1020; l++) {
- for (o = 0; o < 4; o++) {
- for (o2 = 0; o2 < 4; o2++) {
- char *d, *s;
-
- for (i = 0; i < l + 12; i++)
- buffer[i] = (i & 0x3f) + 0x40;
- for (i = 0; i < 1036; i++)
- buffer2[i] = 0;
-
- s = buffer + o;
- d = buffer2 + o2 + 4;
-
- memcpy (d, s, l);
-
- for (i = 0; i < l; i++)
- if (s[i] != d[i])
- printf ("Error at %X+%d -> %X+%d (%02X != %02X)\n", s, i, d, i, s[i], d[i]);
- if (d[-1] || d[-2] || d[-3] || d[-4])
- printf ("Error before %X\n", d);
- if (d[l] || d[l+1] || d[l+2] || d[l+3])
- printf ("Error after %X\n", d+l);
- }
- }
- }
-
- printf ("Testing memcpy s < d\n");
- for (l = 1; l < 1020; l++) {
- for (o = 0; o < 4; o++) {
- for (o2 = 0; o2 < 4; o2++) {
- char *d, *s;
-
- for (i = 0; i < l + 12; i++)
- buffer2[i] = (i & 0x3f) + 0x40;
- for (i = 0; i < 1036; i++)
- buffer[i] = 0;
-
- s = buffer2 + o;
- d = buffer + o2 + 4;
-
- memcpy (d, s, l);
-
- for (i = 0; i < l; i++)
- if (s[i] != d[i])
- printf ("Error at %X+%d -> %X+%d (%02X != %02X)\n", s, i, d, i, s[i], d[i]);
- if (d[-1] || d[-2] || d[-3] || d[-4])
- printf ("Error before %X\n", d);
- if (d[l] || d[l+1] || d[l+2] || d[l+3])
- printf ("Error after %X\n", d+l);
- }
- }
- }
-}
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S
index c9d729e85..67684cb1a 100644
--- a/arch/arm/lib/uaccess.S
+++ b/arch/arm/lib/uaccess.S
@@ -312,7 +312,7 @@ USER( ldrgtbt r3, [r1], #1) // May fault
b .cfu_dest_aligned
ENTRY(__arch_copy_from_user)
- stmfd sp!, {r2, r4 - r7, lr}
+ stmfd sp!, {r0, r2, r4 - r7, lr}
cmp r2, #4
blt .cfu_not_enough
ands ip, r0, #3
@@ -375,7 +375,8 @@ USER( ldrgtbt r3, [r1], #1) // May fault
movs ip, r2
bne .cfu_nowords
.cfu_finished: mov r0, #0
- LOADREGS(fd,sp!,{r2, r4 - r7, pc})
+ add sp, sp, #8
+ LOADREGS(fd,sp!,{r4 - r7, pc})
.cfu_src_not_aligned:
bic r1, r1, #3
@@ -548,7 +549,12 @@ USER( ldrget r3, [r1], #0) // May fault
#ifndef TESTING
.section .fixup,"ax"
.align 0
-9001: LOADREGS(fd,sp!, {r0, r4 - r7, pc})
+ /* We took an exception. Zero out the buffer and pretend no
+ data was copied. */
+9001: ldr r0, [sp], #4
+ ldr r1, [sp]
+ bl SYMBOL_NAME(memzero)
+ LOADREGS(fd,sp!, {r0, r4 - r7, pc})
.previous
#endif
@@ -636,7 +642,11 @@ USER( ldrbt r3, [r1], #1)
.section .fixup,"ax"
.align 0
-9001: mov r0, #-EFAULT
+9001: mov ip, #0
+1: strb ip, [r0], #1
+ subs r2, r2, #1
+ bpl 1b
+ mov r0, #-EFAULT
LOADREGS(fd, sp!, {pc})
.previous