diff options
-rw-r--r-- | arch/powerpc/Makefile | 4 | ||||
-rw-r--r-- | arch/powerpc/lib/Makefile | 4 | ||||
-rw-r--r-- | arch/powerpc/lib/crtsavres.S | 129 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 5 |
4 files changed, 138 insertions, 4 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 42dcd3f4ad7b..77cfe7a29e25 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile | |||
@@ -92,10 +92,10 @@ endif | |||
92 | else | 92 | else |
93 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) | 93 | KBUILD_CFLAGS += $(call cc-option,-mtune=power4) |
94 | endif | 94 | endif |
95 | else | ||
96 | LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | ||
97 | endif | 95 | endif |
98 | 96 | ||
97 | LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o | ||
98 | |||
99 | ifeq ($(CONFIG_TUNE_CELL),y) | 99 | ifeq ($(CONFIG_TUNE_CELL),y) |
100 | KBUILD_CFLAGS += $(call cc-option,-mtune=cell) | 100 | KBUILD_CFLAGS += $(call cc-option,-mtune=cell) |
101 | endif | 101 | endif |
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile index 3040dac18a37..111da1c03a11 100644 --- a/arch/powerpc/lib/Makefile +++ b/arch/powerpc/lib/Makefile | |||
@@ -12,8 +12,8 @@ CFLAGS_REMOVE_code-patching.o = -pg | |||
12 | CFLAGS_REMOVE_feature-fixups.o = -pg | 12 | CFLAGS_REMOVE_feature-fixups.o = -pg |
13 | 13 | ||
14 | obj-y := string.o alloc.o \ | 14 | obj-y := string.o alloc.o \ |
15 | checksum_$(CONFIG_WORD_SIZE).o | 15 | checksum_$(CONFIG_WORD_SIZE).o crtsavres.o |
16 | obj-$(CONFIG_PPC32) += div64.o copy_32.o crtsavres.o | 16 | obj-$(CONFIG_PPC32) += div64.o copy_32.o |
17 | obj-$(CONFIG_HAS_IOMEM) += devres.o | 17 | obj-$(CONFIG_HAS_IOMEM) += devres.o |
18 | 18 | ||
19 | obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ | 19 | obj-$(CONFIG_PPC64) += copypage_64.o copyuser_64.o \ |
diff --git a/arch/powerpc/lib/crtsavres.S b/arch/powerpc/lib/crtsavres.S index 70a9cd8a3008..1c893f05d224 100644 --- a/arch/powerpc/lib/crtsavres.S +++ b/arch/powerpc/lib/crtsavres.S | |||
@@ -6,6 +6,7 @@ | |||
6 | * Written By Michael Meissner | 6 | * Written By Michael Meissner |
7 | * | 7 | * |
8 | * Based on gcc/config/rs6000/crtsavres.asm from gcc | 8 | * Based on gcc/config/rs6000/crtsavres.asm from gcc |
9 | * 64 bit additions from reading the PPC elf64abi document. | ||
9 | * | 10 | * |
10 | * This file is free software; you can redistribute it and/or modify it | 11 | * This file is free software; you can redistribute it and/or modify it |
11 | * under the terms of the GNU General Public License as published by the | 12 | * under the terms of the GNU General Public License as published by the |
@@ -44,6 +45,8 @@ | |||
44 | 45 | ||
45 | #ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE | 46 | #ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE |
46 | 47 | ||
48 | #ifndef CONFIG_PPC64 | ||
49 | |||
47 | /* Routines for saving integer registers, called by the compiler. */ | 50 | /* Routines for saving integer registers, called by the compiler. */ |
48 | /* Called with r11 pointing to the stack header word of the caller of the */ | 51 | /* Called with r11 pointing to the stack header word of the caller of the */ |
49 | /* function, just beyond the end of the integer save area. */ | 52 | /* function, just beyond the end of the integer save area. */ |
@@ -226,4 +229,130 @@ _GLOBAL(_rest32gpr_31_x) | |||
226 | mtlr 0 | 229 | mtlr 0 |
227 | mr 1,11 | 230 | mr 1,11 |
228 | blr | 231 | blr |
232 | |||
233 | #else /* CONFIG_PPC64 */ | ||
234 | |||
235 | .globl _savegpr0_14 | ||
236 | _savegpr0_14: | ||
237 | std r14,-144(r1) | ||
238 | .globl _savegpr0_15 | ||
239 | _savegpr0_15: | ||
240 | std r15,-136(r1) | ||
241 | .globl _savegpr0_16 | ||
242 | _savegpr0_16: | ||
243 | std r16,-128(r1) | ||
244 | .globl _savegpr0_17 | ||
245 | _savegpr0_17: | ||
246 | std r17,-120(r1) | ||
247 | .globl _savegpr0_18 | ||
248 | _savegpr0_18: | ||
249 | std r18,-112(r1) | ||
250 | .globl _savegpr0_19 | ||
251 | _savegpr0_19: | ||
252 | std r19,-104(r1) | ||
253 | .globl _savegpr0_20 | ||
254 | _savegpr0_20: | ||
255 | std r20,-96(r1) | ||
256 | .globl _savegpr0_21 | ||
257 | _savegpr0_21: | ||
258 | std r21,-88(r1) | ||
259 | .globl _savegpr0_22 | ||
260 | _savegpr0_22: | ||
261 | std r22,-80(r1) | ||
262 | .globl _savegpr0_23 | ||
263 | _savegpr0_23: | ||
264 | std r23,-72(r1) | ||
265 | .globl _savegpr0_24 | ||
266 | _savegpr0_24: | ||
267 | std r24,-64(r1) | ||
268 | .globl _savegpr0_25 | ||
269 | _savegpr0_25: | ||
270 | std r25,-56(r1) | ||
271 | .globl _savegpr0_26 | ||
272 | _savegpr0_26: | ||
273 | std r26,-48(r1) | ||
274 | .globl _savegpr0_27 | ||
275 | _savegpr0_27: | ||
276 | std r27,-40(r1) | ||
277 | .globl _savegpr0_28 | ||
278 | _savegpr0_28: | ||
279 | std r28,-32(r1) | ||
280 | .globl _savegpr0_29 | ||
281 | _savegpr0_29: | ||
282 | std r29,-24(r1) | ||
283 | .globl _savegpr0_30 | ||
284 | _savegpr0_30: | ||
285 | std r30,-16(r1) | ||
286 | .globl _savegpr0_31 | ||
287 | _savegpr0_31: | ||
288 | std r31,-8(r1) | ||
289 | std r0,16(r1) | ||
290 | blr | ||
291 | |||
292 | .globl _restgpr0_14 | ||
293 | _restgpr0_14: | ||
294 | ld r14,-144(r1) | ||
295 | .globl _restgpr0_15 | ||
296 | _restgpr0_15: | ||
297 | ld r15,-136(r1) | ||
298 | .globl _restgpr0_16 | ||
299 | _restgpr0_16: | ||
300 | ld r16,-128(r1) | ||
301 | .globl _restgpr0_17 | ||
302 | _restgpr0_17: | ||
303 | ld r17,-120(r1) | ||
304 | .globl _restgpr0_18 | ||
305 | _restgpr0_18: | ||
306 | ld r18,-112(r1) | ||
307 | .globl _restgpr0_19 | ||
308 | _restgpr0_19: | ||
309 | ld r19,-104(r1) | ||
310 | .globl _restgpr0_20 | ||
311 | _restgpr0_20: | ||
312 | ld r20,-96(r1) | ||
313 | .globl _restgpr0_21 | ||
314 | _restgpr0_21: | ||
315 | ld r21,-88(r1) | ||
316 | .globl _restgpr0_22 | ||
317 | _restgpr0_22: | ||
318 | ld r22,-80(r1) | ||
319 | .globl _restgpr0_23 | ||
320 | _restgpr0_23: | ||
321 | ld r23,-72(r1) | ||
322 | .globl _restgpr0_24 | ||
323 | _restgpr0_24: | ||
324 | ld r24,-64(r1) | ||
325 | .globl _restgpr0_25 | ||
326 | _restgpr0_25: | ||
327 | ld r25,-56(r1) | ||
328 | .globl _restgpr0_26 | ||
329 | _restgpr0_26: | ||
330 | ld r26,-48(r1) | ||
331 | .globl _restgpr0_27 | ||
332 | _restgpr0_27: | ||
333 | ld r27,-40(r1) | ||
334 | .globl _restgpr0_28 | ||
335 | _restgpr0_28: | ||
336 | ld r28,-32(r1) | ||
337 | .globl _restgpr0_29 | ||
338 | _restgpr0_29: | ||
339 | ld r0,16(r1) | ||
340 | ld r29,-24(r1) | ||
341 | mtlr r0 | ||
342 | ld r30,-16(r1) | ||
343 | ld r31,-8(r1) | ||
344 | blr | ||
345 | |||
346 | .globl _restgpr0_30 | ||
347 | _restgpr0_30: | ||
348 | ld r30,-16(r1) | ||
349 | .globl _restgpr0_31 | ||
350 | _restgpr0_31: | ||
351 | ld r0,16(r1) | ||
352 | ld r31,-8(r1) | ||
353 | mtlr r0 | ||
354 | blr | ||
355 | |||
356 | #endif /* CONFIG_PPC64 */ | ||
357 | |||
229 | #endif | 358 | #endif |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index f8779006986d..f6127b9f5aca 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -503,6 +503,11 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) | |||
503 | strncmp(symname, "_rest32gpr_", sizeof("_rest32gpr_") - 1) == 0 || | 503 | strncmp(symname, "_rest32gpr_", sizeof("_rest32gpr_") - 1) == 0 || |
504 | strncmp(symname, "_save32gpr_", sizeof("_save32gpr_") - 1) == 0) | 504 | strncmp(symname, "_save32gpr_", sizeof("_save32gpr_") - 1) == 0) |
505 | return 1; | 505 | return 1; |
506 | if (info->hdr->e_machine == EM_PPC64) | ||
507 | /* Special register function linked on all modules during final link of .ko */ | ||
508 | if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 || | ||
509 | strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0) | ||
510 | return 1; | ||
506 | /* Do not ignore this symbol */ | 511 | /* Do not ignore this symbol */ |
507 | return 0; | 512 | return 0; |
508 | } | 513 | } |