alpha: build fixes

This fixes some of the alpha-specific build problems, except a) modpost
warning about COMMON symbol "saved_config" and b) nasty final link
failure with gcc-4.x, -Os and scsi-disk driver configured built-in
(due to jump table in .rodata referencing discarded .exit.text).

- build failure with gcc-4.2.x: fix up casts in cia_io* routines to avoid
warnings ('discards qualifiers from pointer target type'), which are
failures, thanks to -Werror;
- modpost warnings: add missing __init qualifier for titan and marvel;
for non-generic build, move machine vectors from .data to .data.init.refok
section;
- unbreak CPU-specific optimization: rearrange cpuflags-y assignments
so that extended -mcpu value (ev56, pca56, ev67) overrides basic
one (ev5, ev6) and not vice versa.

Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Ivan Kokshaysky and committed by
Linus Torvalds
9548b209 b47b6f38

+17 -13
+5 -5
arch/alpha/Makefile
··· 14 CHECKFLAGS += -D__alpha__ -m64 15 cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data 16 17 - cpuflags-$(CONFIG_ALPHA_EV67) := -mcpu=ev67 18 - cpuflags-$(CONFIG_ALPHA_EV6) := -mcpu=ev6 19 cpuflags-$(CONFIG_ALPHA_POLARIS) := -mcpu=pca56 20 cpuflags-$(CONFIG_ALPHA_SX164) := -mcpu=pca56 21 - cpuflags-$(CONFIG_ALPHA_EV56) := -mcpu=ev56 22 - cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5 23 - cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4 24 # If GENERIC, make sure to turn off any instruction set extensions that 25 # the host compiler might have on by default. Given that EV4 and EV5 26 # have the same instruction set, prefer EV5 because an EV5 schedule is
··· 14 CHECKFLAGS += -D__alpha__ -m64 15 cflags-y := -pipe -mno-fp-regs -ffixed-8 -msmall-data 16 17 + cpuflags-$(CONFIG_ALPHA_EV4) := -mcpu=ev4 18 + cpuflags-$(CONFIG_ALPHA_EV5) := -mcpu=ev5 19 + cpuflags-$(CONFIG_ALPHA_EV56) := -mcpu=ev56 20 cpuflags-$(CONFIG_ALPHA_POLARIS) := -mcpu=pca56 21 cpuflags-$(CONFIG_ALPHA_SX164) := -mcpu=pca56 22 + cpuflags-$(CONFIG_ALPHA_EV6) := -mcpu=ev6 23 + cpuflags-$(CONFIG_ALPHA_EV67) := -mcpu=ev67 24 # If GENERIC, make sure to turn off any instruction set extensions that 25 # the host compiler might have on by default. Given that EV4 and EV5 26 # have the same instruction set, prefer EV5 because an EV5 schedule is
+1 -1
arch/alpha/kernel/err_ev7.c
··· 273 struct el_subpacket_handler ev7_pal_subpacket_handler = 274 SUBPACKET_HANDLER_INIT(EL_CLASS__PAL, ev7_process_pal_subpacket); 275 276 - void 277 ev7_register_error_handlers(void) 278 { 279 int i;
··· 273 struct el_subpacket_handler ev7_pal_subpacket_handler = 274 SUBPACKET_HANDLER_INIT(EL_CLASS__PAL, ev7_process_pal_subpacket); 275 276 + void __init 277 ev7_register_error_handlers(void) 278 { 279 int i;
+1 -1
arch/alpha/kernel/err_marvel.c
··· 1152 mb(); 1153 } 1154 1155 - void 1156 marvel_register_error_handlers(void) 1157 { 1158 ev7_register_error_handlers();
··· 1152 mb(); 1153 } 1154 1155 + void __init 1156 marvel_register_error_handlers(void) 1157 { 1158 ev7_register_error_handlers();
+1 -1
arch/alpha/kernel/err_titan.c
··· 564 SUBPACKET_HANDLER_INIT(EL_CLASS__REGATTA_FAMILY, 565 el_process_regatta_subpacket); 566 567 - void 568 titan_register_error_handlers(void) 569 { 570 size_t i;
··· 564 SUBPACKET_HANDLER_INIT(EL_CLASS__REGATTA_FAMILY, 565 el_process_regatta_subpacket); 566 567 + void __init 568 titan_register_error_handlers(void) 569 { 570 size_t i;
+1 -1
arch/alpha/kernel/machvec_impl.h
··· 134 #define __initmv __initdata 135 #define ALIAS_MV(x) 136 #else 137 - #define __initmv 138 139 /* GCC actually has a syntax for defining aliases, but is under some 140 delusion that you shouldn't be able to declare it extern somewhere
··· 134 #define __initmv __initdata 135 #define ALIAS_MV(x) 136 #else 137 + #define __initmv __initdata_refok 138 139 /* GCC actually has a syntax for defining aliases, but is under some 140 delusion that you shouldn't be able to declare it extern somewhere
+8 -4
include/asm-alpha/io_trivial.h
··· 72 __EXTERN_INLINE u8 73 IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a) 74 { 75 - return IO_CONCAT(__IO_PREFIX,ioread8)((void __iomem *)a); 76 } 77 78 __EXTERN_INLINE u16 79 IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a) 80 { 81 - return IO_CONCAT(__IO_PREFIX,ioread16)((void __iomem *)a); 82 } 83 84 __EXTERN_INLINE void 85 IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a) 86 { 87 - IO_CONCAT(__IO_PREFIX,iowrite8)(b, (void __iomem *)a); 88 } 89 90 __EXTERN_INLINE void 91 IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a) 92 { 93 - IO_CONCAT(__IO_PREFIX,iowrite16)(b, (void __iomem *)a); 94 } 95 #endif 96
··· 72 __EXTERN_INLINE u8 73 IO_CONCAT(__IO_PREFIX,readb)(const volatile void __iomem *a) 74 { 75 + void __iomem *addr = (void __iomem *)a; 76 + return IO_CONCAT(__IO_PREFIX,ioread8)(addr); 77 } 78 79 __EXTERN_INLINE u16 80 IO_CONCAT(__IO_PREFIX,readw)(const volatile void __iomem *a) 81 { 82 + void __iomem *addr = (void __iomem *)a; 83 + return IO_CONCAT(__IO_PREFIX,ioread16)(addr); 84 } 85 86 __EXTERN_INLINE void 87 IO_CONCAT(__IO_PREFIX,writeb)(u8 b, volatile void __iomem *a) 88 { 89 + void __iomem *addr = (void __iomem *)a; 90 + IO_CONCAT(__IO_PREFIX,iowrite8)(b, addr); 91 } 92 93 __EXTERN_INLINE void 94 IO_CONCAT(__IO_PREFIX,writew)(u16 b, volatile void __iomem *a) 95 { 96 + void __iomem *addr = (void __iomem *)a; 97 + IO_CONCAT(__IO_PREFIX,iowrite16)(b, addr); 98 } 99 #endif 100