Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc32: switch __bzero() away from range exception table entries

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro df06c27e 5f99d338

+32 -40
+32 -40
arch/sparc/lib/memset.S
··· 27 27 .text; \ 28 28 .align 4 29 29 30 - #define EXT(start,end,handler) \ 30 + #define STORE(source, base, offset, n) \ 31 + 98: std source, [base + offset + n]; \ 32 + .section .fixup,ALLOC,EXECINSTR; \ 33 + .align 4; \ 34 + 99: ba 30f; \ 35 + sub %o3, n - offset, %o3; \ 31 36 .section __ex_table,ALLOC; \ 32 37 .align 4; \ 33 - .word start, 0, end, handler; \ 38 + .word 98b, 99b; \ 34 39 .text; \ 35 - .align 4 40 + .align 4; 41 + 42 + #define STORE_LAST(source, base, offset, n) \ 43 + EX(std source, [base - offset - n], \ 44 + add %o1, offset + n); 36 45 37 46 /* Please don't change these macros, unless you change the logic 38 47 * in the .fixup section below as well. 39 48 * Store 64 bytes at (BASE + OFFSET) using value SOURCE. */ 40 - #define ZERO_BIG_BLOCK(base, offset, source) \ 41 - std source, [base + offset + 0x00]; \ 42 - std source, [base + offset + 0x08]; \ 43 - std source, [base + offset + 0x10]; \ 44 - std source, [base + offset + 0x18]; \ 45 - std source, [base + offset + 0x20]; \ 46 - std source, [base + offset + 0x28]; \ 47 - std source, [base + offset + 0x30]; \ 48 - std source, [base + offset + 0x38]; 49 + #define ZERO_BIG_BLOCK(base, offset, source) \ 50 + STORE(source, base, offset, 0x00); \ 51 + STORE(source, base, offset, 0x08); \ 52 + STORE(source, base, offset, 0x10); \ 53 + STORE(source, base, offset, 0x18); \ 54 + STORE(source, base, offset, 0x20); \ 55 + STORE(source, base, offset, 0x28); \ 56 + STORE(source, base, offset, 0x30); \ 57 + STORE(source, base, offset, 0x38); 49 58 50 59 #define ZERO_LAST_BLOCKS(base, offset, source) \ 51 - std source, [base - offset - 0x38]; \ 52 - std source, [base - offset - 0x30]; \ 53 - std source, [base - offset - 0x28]; \ 54 - std source, [base - offset - 0x20]; \ 55 - std source, [base - offset - 0x18]; \ 56 - std source, [base - offset - 0x10]; \ 57 - std source, [base - offset - 0x08]; \ 58 - std source, [base - offset - 0x00]; 60 + STORE_LAST(source, base, offset, 0x38); \ 61 + STORE_LAST(source, base, offset, 0x30); \ 62 + STORE_LAST(source, base, offset, 0x28); \ 63 + STORE_LAST(source, base, offset, 0x20); \ 64 + STORE_LAST(source, base, offset, 0x18); \ 65 + STORE_LAST(source, base, offset, 0x10); \ 66 + STORE_LAST(source, base, offset, 0x08); \ 67 + STORE_LAST(source, base, offset, 0x00); 59 68 60 69 .text 61 70 .align 4 ··· 129 120 ZERO_BIG_BLOCK(%o0, 0x00, %g2) 130 121 subcc %o3, 128, %o3 131 122 ZERO_BIG_BLOCK(%o0, 0x40, %g2) 132 - 11: 133 - EXT(10b, 11b, 20f) 134 123 bne 10b 135 124 add %o0, 128, %o0 136 125 ··· 143 136 jmp %o4 144 137 add %o0, %o2, %o0 145 138 146 - 12: 147 139 ZERO_LAST_BLOCKS(%o0, 0x48, %g2) 148 140 ZERO_LAST_BLOCKS(%o0, 0x08, %g2) 149 141 13: ··· 188 182 189 183 .section .fixup,#alloc,#execinstr 190 184 .align 4 191 - 20: 192 - cmp %g2, 8 193 - bleu 1f 194 - and %o1, 0x7f, %o1 195 - sub %g2, 9, %g2 196 - add %o3, 64, %o3 197 - 1: 198 - sll %g2, 3, %g2 199 - add %o3, %o1, %o0 185 + 30: 186 + and %o1, 0x7f, %o1 200 187 retl 201 - sub %o0, %g2, %o0 202 - 21: 203 - mov 8, %o0 204 - and %o1, 7, %o1 205 - sub %o0, %g2, %o0 206 - sll %o0, 3, %o0 207 - retl 208 - add %o0, %o1, %o0 188 + add %o3, %o1, %o0 209 189 210 190 .globl __bzero_end 211 191 __bzero_end: