aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-09 01:00:55 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-09 01:00:55 -0500
commit40bdac7dbc161639a498697f34fbd1ee800e51f4 (patch)
tree5eef654722ba36d2921cafd8440d5e346f0fbdb5 /arch/sparc
parent1c2f61d40b691789626489fa947a3e003c9a84be (diff)
sparc64: Kill .fixup section bloat.
This is an implementation of a suggestion made by Chris Torek: -------------------- Something else I noticed in passing: the EX and EX_LD/EX_ST macros scattered throughout the various .S files make a fair bit of .fixup code, all of which does the same thing. At the cost of one symbol in copy_in_user.S, you could just have one common two-instruction retl-and-mov-1 fixup that they all share. -------------------- The following is with a defconfig build: text data bss dec hex filename 3972767 344024 584449 4901240 4ac978 vmlinux.orig 3968887 344024 584449 4897360 4aba50 vmlinux Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/head_64.S31
-rw-r--r--arch/sparc/lib/GENbzero.S6
-rw-r--r--arch/sparc/lib/GENcopy_from_user.S6
-rw-r--r--arch/sparc/lib/GENcopy_to_user.S6
-rw-r--r--arch/sparc/lib/NG2copy_from_user.S7
-rw-r--r--arch/sparc/lib/NG2copy_to_user.S7
-rw-r--r--arch/sparc/lib/NGbzero.S6
-rw-r--r--arch/sparc/lib/NGcopy_from_user.S7
-rw-r--r--arch/sparc/lib/NGcopy_to_user.S7
-rw-r--r--arch/sparc/lib/U1copy_from_user.S6
-rw-r--r--arch/sparc/lib/U1copy_to_user.S6
-rw-r--r--arch/sparc/lib/U3copy_from_user.S6
-rw-r--r--arch/sparc/lib/U3copy_to_user.S6
-rw-r--r--arch/sparc/lib/bzero.S6
-rw-r--r--arch/sparc/lib/copy_in_user.S6
15 files changed, 42 insertions, 77 deletions
diff --git a/arch/sparc/kernel/head_64.S b/arch/sparc/kernel/head_64.S
index 8ffee714f932..a46c3a21e26d 100644
--- a/arch/sparc/kernel/head_64.S
+++ b/arch/sparc/kernel/head_64.S
@@ -891,10 +891,35 @@ prom_tba: .xword 0
891tlb_type: .word 0 /* Must NOT end up in BSS */ 891tlb_type: .word 0 /* Must NOT end up in BSS */
892 .section ".fixup",#alloc,#execinstr 892 .section ".fixup",#alloc,#execinstr
893 893
894 .globl __ret_efault, __retl_efault 894 .globl __ret_efault, __retl_efault, __ret_one, __retl_one
895__ret_efault: 895ENTRY(__ret_efault)
896 ret 896 ret
897 restore %g0, -EFAULT, %o0 897 restore %g0, -EFAULT, %o0
898__retl_efault: 898ENDPROC(__ret_efault)
899
900ENTRY(__retl_efault)
899 retl 901 retl
900 mov -EFAULT, %o0 902 mov -EFAULT, %o0
903ENDPROC(__retl_efault)
904
905ENTRY(__retl_one)
906 retl
907 mov 1, %o0
908ENDPROC(__retl_one)
909
910ENTRY(__ret_one_asi)
911 wr %g0, ASI_AIUS, %asi
912 ret
913 restore %g0, 1, %o0
914ENDPROC(__ret_one_asi)
915
916ENTRY(__retl_one_asi)
917 wr %g0, ASI_AIUS, %asi
918 retl
919 mov 1, %o0
920ENDPROC(__retl_one_asi)
921
922ENTRY(__retl_o1)
923 retl
924 mov %o1, %o0
925ENDPROC(__retl_o1)
diff --git a/arch/sparc/lib/GENbzero.S b/arch/sparc/lib/GENbzero.S
index 6a4f956a2f7a..8e7a843ddd88 100644
--- a/arch/sparc/lib/GENbzero.S
+++ b/arch/sparc/lib/GENbzero.S
@@ -6,13 +6,9 @@
6 6
7#define EX_ST(x,y) \ 7#define EX_ST(x,y) \
898: x,y; \ 898: x,y; \
9 .section .fixup; \
10 .align 4; \
1199: retl; \
12 mov %o1, %o0; \
13 .section __ex_table,"a";\ 9 .section __ex_table,"a";\
14 .align 4; \ 10 .align 4; \
15 .word 98b, 99b; \ 11 .word 98b, __retl_o1; \
16 .text; \ 12 .text; \
17 .align 4; 13 .align 4;
18 14
diff --git a/arch/sparc/lib/GENcopy_from_user.S b/arch/sparc/lib/GENcopy_from_user.S
index 2b9df99e87f9..9b0e58f9f970 100644
--- a/arch/sparc/lib/GENcopy_from_user.S
+++ b/arch/sparc/lib/GENcopy_from_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/GENcopy_to_user.S b/arch/sparc/lib/GENcopy_to_user.S
index bb3f7084daf9..ce79b495c65d 100644
--- a/arch/sparc/lib/GENcopy_to_user.S
+++ b/arch/sparc/lib/GENcopy_to_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/NG2copy_from_user.S b/arch/sparc/lib/NG2copy_from_user.S
index c77ef5f22102..01ac546a86f4 100644
--- a/arch/sparc/lib/NG2copy_from_user.S
+++ b/arch/sparc/lib/NG2copy_from_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 retl; \
12 mov 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __retl_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
diff --git a/arch/sparc/lib/NG2copy_to_user.S b/arch/sparc/lib/NG2copy_to_user.S
index 4bd4093acbbd..c477e1594a72 100644
--- a/arch/sparc/lib/NG2copy_to_user.S
+++ b/arch/sparc/lib/NG2copy_to_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 retl; \
12 mov 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __retl_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
diff --git a/arch/sparc/lib/NGbzero.S b/arch/sparc/lib/NGbzero.S
index 814d5f7a45e1..beab29bf419b 100644
--- a/arch/sparc/lib/NGbzero.S
+++ b/arch/sparc/lib/NGbzero.S
@@ -6,13 +6,9 @@
6 6
7#define EX_ST(x,y) \ 7#define EX_ST(x,y) \
898: x,y; \ 898: x,y; \
9 .section .fixup; \
10 .align 4; \
1199: retl; \
12 mov %o1, %o0; \
13 .section __ex_table,"a";\ 9 .section __ex_table,"a";\
14 .align 4; \ 10 .align 4; \
15 .word 98b, 99b; \ 11 .word 98b, __retl_o1; \
16 .text; \ 12 .text; \
17 .align 4; 13 .align 4;
18 14
diff --git a/arch/sparc/lib/NGcopy_from_user.S b/arch/sparc/lib/NGcopy_from_user.S
index e7f433f71b42..39bb8912c6e7 100644
--- a/arch/sparc/lib/NGcopy_from_user.S
+++ b/arch/sparc/lib/NGcopy_from_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 ret; \
12 restore %g0, 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __ret_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
diff --git a/arch/sparc/lib/NGcopy_to_user.S b/arch/sparc/lib/NGcopy_to_user.S
index 6ea01c5532a0..bf62fc1a26c7 100644
--- a/arch/sparc/lib/NGcopy_to_user.S
+++ b/arch/sparc/lib/NGcopy_to_user.S
@@ -5,14 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: wr %g0, ASI_AIUS, %asi;\
11 ret; \
12 restore %g0, 1, %o0; \
13 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
14 .align 4; \ 9 .align 4; \
15 .word 98b, 99b; \ 10 .word 98b, __ret_one_asi;\
16 .text; \ 11 .text; \
17 .align 4; 12 .align 4;
18 13
diff --git a/arch/sparc/lib/U1copy_from_user.S b/arch/sparc/lib/U1copy_from_user.S
index 3192b0bf4fab..f14efdd6d4a9 100644
--- a/arch/sparc/lib/U1copy_from_user.S
+++ b/arch/sparc/lib/U1copy_from_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/U1copy_to_user.S b/arch/sparc/lib/U1copy_to_user.S
index d1210ffb0b82..59d531b4a1a5 100644
--- a/arch/sparc/lib/U1copy_to_user.S
+++ b/arch/sparc/lib/U1copy_to_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/U3copy_from_user.S b/arch/sparc/lib/U3copy_from_user.S
index f5bfc8d9d216..b1acd1331c33 100644
--- a/arch/sparc/lib/U3copy_from_user.S
+++ b/arch/sparc/lib/U3copy_from_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_LD(x) \ 6#define EX_LD(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/U3copy_to_user.S b/arch/sparc/lib/U3copy_to_user.S
index 2334f111bb0c..b4cbfe5a97ba 100644
--- a/arch/sparc/lib/U3copy_to_user.S
+++ b/arch/sparc/lib/U3copy_to_user.S
@@ -5,13 +5,9 @@
5 5
6#define EX_ST(x) \ 6#define EX_ST(x) \
798: x; \ 798: x; \
8 .section .fixup; \
9 .align 4; \
1099: retl; \
11 mov 1, %o0; \
12 .section __ex_table,"a";\ 8 .section __ex_table,"a";\
13 .align 4; \ 9 .align 4; \
14 .word 98b, 99b; \ 10 .word 98b, __retl_one; \
15 .text; \ 11 .text; \
16 .align 4; 12 .align 4;
17 13
diff --git a/arch/sparc/lib/bzero.S b/arch/sparc/lib/bzero.S
index c7bbae8c590f..b6557297440f 100644
--- a/arch/sparc/lib/bzero.S
+++ b/arch/sparc/lib/bzero.S
@@ -88,13 +88,9 @@ __bzero_done:
88 88
89#define EX_ST(x,y) \ 89#define EX_ST(x,y) \
9098: x,y; \ 9098: x,y; \
91 .section .fixup; \
92 .align 4; \
9399: retl; \
94 mov %o1, %o0; \
95 .section __ex_table,"a";\ 91 .section __ex_table,"a";\
96 .align 4; \ 92 .align 4; \
97 .word 98b, 99b; \ 93 .word 98b, __retl_o1; \
98 .text; \ 94 .text; \
99 .align 4; 95 .align 4;
100 96
diff --git a/arch/sparc/lib/copy_in_user.S b/arch/sparc/lib/copy_in_user.S
index 650af3f21f78..884f46499d4e 100644
--- a/arch/sparc/lib/copy_in_user.S
+++ b/arch/sparc/lib/copy_in_user.S
@@ -9,13 +9,9 @@
9 9
10#define EX(x,y) \ 10#define EX(x,y) \
1198: x,y; \ 1198: x,y; \
12 .section .fixup; \
13 .align 4; \
1499: retl; \
15 mov 1, %o0; \
16 .section __ex_table,"a";\ 12 .section __ex_table,"a";\
17 .align 4; \ 13 .align 4; \
18 .word 98b, 99b; \ 14 .word 98b, __retl_one; \
19 .text; \ 15 .text; \
20 .align 4; 16 .align 4;
21 17