aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r--arch/powerpc/lib/Makefile6
-rw-r--r--arch/powerpc/lib/checksum_32.S (renamed from arch/powerpc/lib/checksum.S)0
-rw-r--r--arch/powerpc/lib/checksum_64.S (renamed from arch/powerpc/lib/checksum64.S)0
-rw-r--r--arch/powerpc/lib/copy_32.S (renamed from arch/powerpc/lib/copy32.S)0
-rw-r--r--arch/powerpc/lib/copypage_64.S (renamed from arch/powerpc/lib/copypage.S)0
-rw-r--r--arch/powerpc/lib/copyuser_64.S (renamed from arch/powerpc/lib/copyuser.S)0
-rw-r--r--arch/powerpc/lib/mem_64.S119
-rw-r--r--arch/powerpc/lib/memcpy_64.S (renamed from arch/powerpc/lib/memcpy.S)0
-rw-r--r--arch/powerpc/lib/usercopy_64.c (renamed from arch/powerpc/lib/usercopy.c)0
9 files changed, 122 insertions, 3 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 347f9798e433..a8cedb96de5f 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5obj-y := strcase.o string.o 5obj-y := strcase.o string.o
6obj-$(CONFIG_PPC32) += div64.o copy32.o checksum.o 6obj-$(CONFIG_PPC32) += div64.o copy_32.o checksum_32.o
7obj-$(CONFIG_PPC64) += copypage.o copyuser.o memcpy.o usercopy.o \ 7obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o memcpy_64.o \
8 sstep.o checksum64.o 8 usercopy_64.o sstep.o checksum_64.o mem_64.o
9obj-$(CONFIG_PPC_ISERIES) += e2a.o 9obj-$(CONFIG_PPC_ISERIES) += e2a.o
diff --git a/arch/powerpc/lib/checksum.S b/arch/powerpc/lib/checksum_32.S
index 7874e8a80455..7874e8a80455 100644
--- a/arch/powerpc/lib/checksum.S
+++ b/arch/powerpc/lib/checksum_32.S
diff --git a/arch/powerpc/lib/checksum64.S b/arch/powerpc/lib/checksum_64.S
index ef96c6c58efc..ef96c6c58efc 100644
--- a/arch/powerpc/lib/checksum64.S
+++ b/arch/powerpc/lib/checksum_64.S
diff --git a/arch/powerpc/lib/copy32.S b/arch/powerpc/lib/copy_32.S
index 420a912198a2..420a912198a2 100644
--- a/arch/powerpc/lib/copy32.S
+++ b/arch/powerpc/lib/copy_32.S
diff --git a/arch/powerpc/lib/copypage.S b/arch/powerpc/lib/copypage_64.S
index 733d61618bbf..733d61618bbf 100644
--- a/arch/powerpc/lib/copypage.S
+++ b/arch/powerpc/lib/copypage_64.S
diff --git a/arch/powerpc/lib/copyuser.S b/arch/powerpc/lib/copyuser_64.S
index a0b3fbbd6fb1..a0b3fbbd6fb1 100644
--- a/arch/powerpc/lib/copyuser.S
+++ b/arch/powerpc/lib/copyuser_64.S
diff --git a/arch/powerpc/lib/mem_64.S b/arch/powerpc/lib/mem_64.S
new file mode 100644
index 000000000000..68df20283ff5
--- /dev/null
+++ b/arch/powerpc/lib/mem_64.S
@@ -0,0 +1,119 @@
1/*
2 * String handling functions for PowerPC.
3 *
4 * Copyright (C) 1996 Paul Mackerras.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 */
11#include <asm/processor.h>
12#include <asm/errno.h>
13#include <asm/ppc_asm.h>
14
15_GLOBAL(memset)
16 neg r0,r3
17 rlwimi r4,r4,8,16,23
18 andi. r0,r0,7 /* # bytes to be 8-byte aligned */
19 rlwimi r4,r4,16,0,15
20 cmplw cr1,r5,r0 /* do we get that far? */
21 rldimi r4,r4,32,0
22 mtcrf 1,r0
23 mr r6,r3
24 blt cr1,8f
25 beq+ 3f /* if already 8-byte aligned */
26 subf r5,r0,r5
27 bf 31,1f
28 stb r4,0(r6)
29 addi r6,r6,1
301: bf 30,2f
31 sth r4,0(r6)
32 addi r6,r6,2
332: bf 29,3f
34 stw r4,0(r6)
35 addi r6,r6,4
363: srdi. r0,r5,6
37 clrldi r5,r5,58
38 mtctr r0
39 beq 5f
404: std r4,0(r6)
41 std r4,8(r6)
42 std r4,16(r6)
43 std r4,24(r6)
44 std r4,32(r6)
45 std r4,40(r6)
46 std r4,48(r6)
47 std r4,56(r6)
48 addi r6,r6,64
49 bdnz 4b
505: srwi. r0,r5,3
51 clrlwi r5,r5,29
52 mtcrf 1,r0
53 beq 8f
54 bf 29,6f
55 std r4,0(r6)
56 std r4,8(r6)
57 std r4,16(r6)
58 std r4,24(r6)
59 addi r6,r6,32
606: bf 30,7f
61 std r4,0(r6)
62 std r4,8(r6)
63 addi r6,r6,16
647: bf 31,8f
65 std r4,0(r6)
66 addi r6,r6,8
678: cmpwi r5,0
68 mtcrf 1,r5
69 beqlr+
70 bf 29,9f
71 stw r4,0(r6)
72 addi r6,r6,4
739: bf 30,10f
74 sth r4,0(r6)
75 addi r6,r6,2
7610: bflr 31
77 stb r4,0(r6)
78 blr
79
80_GLOBAL(memmove)
81 cmplw 0,r3,r4
82 bgt .backwards_memcpy
83 b .memcpy
84
85_GLOBAL(backwards_memcpy)
86 rlwinm. r7,r5,32-3,3,31 /* r0 = r5 >> 3 */
87 add r6,r3,r5
88 add r4,r4,r5
89 beq 2f
90 andi. r0,r6,3
91 mtctr r7
92 bne 5f
931: lwz r7,-4(r4)
94 lwzu r8,-8(r4)
95 stw r7,-4(r6)
96 stwu r8,-8(r6)
97 bdnz 1b
98 andi. r5,r5,7
992: cmplwi 0,r5,4
100 blt 3f
101 lwzu r0,-4(r4)
102 subi r5,r5,4
103 stwu r0,-4(r6)
1043: cmpwi 0,r5,0
105 beqlr
106 mtctr r5
1074: lbzu r0,-1(r4)
108 stbu r0,-1(r6)
109 bdnz 4b
110 blr
1115: mtctr r0
1126: lbzu r7,-1(r4)
113 stbu r7,-1(r6)
114 bdnz 6b
115 subf r5,r0,r5
116 rlwinm. r7,r5,32-3,3,31
117 beq 2b
118 mtctr r7
119 b 1b
diff --git a/arch/powerpc/lib/memcpy.S b/arch/powerpc/lib/memcpy_64.S
index 9ccacdf5bcb9..9ccacdf5bcb9 100644
--- a/arch/powerpc/lib/memcpy.S
+++ b/arch/powerpc/lib/memcpy_64.S
diff --git a/arch/powerpc/lib/usercopy.c b/arch/powerpc/lib/usercopy_64.c
index 5eea6f3c1e03..5eea6f3c1e03 100644
--- a/arch/powerpc/lib/usercopy.c
+++ b/arch/powerpc/lib/usercopy_64.c