* [PATCH 2/7] ALPHA: build fixes - force architecture, eliminate wastage
@ 2007-04-11 8:28 Ivan Kokshaysky
2007-04-11 15:55 ` Richard Henderson
0 siblings, 1 reply; 2+ messages in thread
From: Ivan Kokshaysky @ 2007-04-11 8:28 UTC (permalink / raw)
To: Andrew Morton; +Cc: Richard Henderson, Jay Estabrook, linux-kernel
Files:
arch/alpha/kernel/sys_titan.c
Request EV67 since no TITAN-based machine is any less, or see errors.
include/asm-alpha/compiler.h
Request EV56 so we're sure to get what we want, or see errors.
include/asm-alpha/module.h
Stop all the wasted/worthless "got" messages.
Signed-off-by: Jay Estabrook <jay.estabrook@hp.com>
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
---
diff -Naurp a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
--- a/arch/alpha/kernel/sys_titan.c 2007-02-04 13:44:54.000000000 -0500
+++ b/arch/alpha/kernel/sys_titan.c 2007-02-14 16:32:30.000000000 -0500
@@ -257,7 +257,7 @@ titan_dispatch_irqs(u64 mask)
*/
while (mask) {
/* convert to SRM vector... priority is <63> -> <0> */
- __asm__("ctlz %1, %0" : "=r"(vector) : "r"(mask));
+ __asm__(".arch ev67; ctlz %1, %0" : "=r"(vector) : "r"(mask));
vector = 63 - vector;
mask &= ~(1UL << vector); /* clear it out */
vector = 0x900 + (vector << 4); /* convert to SRM vector */
diff -Naurp a/include/asm-alpha/compiler.h b/include/asm-alpha/compiler.h
--- a/include/asm-alpha/compiler.h 2007-02-04 13:44:54.000000000 -0500
+++ b/include/asm-alpha/compiler.h 2007-02-14 16:32:30.000000000 -0500
@@ -78,16 +78,20 @@
#else
#define __kernel_ldbu(mem) \
({ unsigned char __kir; \
- __asm__("ldbu %0,%1" : "=r"(__kir) : "m"(mem)); \
+ __asm__(".arch ev56; \
+ ldbu %0,%1" : "=r"(__kir) : "m"(mem)); \
__kir; })
#define __kernel_ldwu(mem) \
({ unsigned short __kir; \
- __asm__("ldwu %0,%1" : "=r"(__kir) : "m"(mem)); \
+ __asm__(".arch ev56; \
+ ldwu %0,%1" : "=r"(__kir) : "m"(mem)); \
__kir; })
-#define __kernel_stb(val,mem) \
- __asm__("stb %1,%0" : "=m"(mem) : "r"(val))
-#define __kernel_stw(val,mem) \
- __asm__("stw %1,%0" : "=m"(mem) : "r"(val))
+#define __kernel_stb(val,mem) \
+ __asm__(".arch ev56; \
+ stb %1,%0" : "=m"(mem) : "r"(val))
+#define __kernel_stw(val,mem) \
+ __asm__(".arch ev56; \
+ stw %1,%0" : "=m"(mem) : "r"(val))
#endif
#ifdef __KERNEL__
diff -Naurp a/include/asm-alpha/module.h b/include/asm-alpha/module.h
--- a/include/asm-alpha/module.h 2007-02-04 13:44:54.000000000 -0500
+++ b/include/asm-alpha/module.h 2007-02-14 14:40:02.000000000 -0500
@@ -17,7 +17,7 @@ struct mod_arch_specific
#define ARCH_SHF_SMALL SHF_ALPHA_GPREL
#ifdef MODULE
-asm(".section .got,\"aws\",@progbits; .align 3; .previous");
+asm(".section .got,\"aw\",@progbits; .align 3; .previous");
#endif
#endif /*_ALPHA_MODULE_H*/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 2/7] ALPHA: build fixes - force architecture, eliminate wastage
2007-04-11 8:28 [PATCH 2/7] ALPHA: build fixes - force architecture, eliminate wastage Ivan Kokshaysky
@ 2007-04-11 15:55 ` Richard Henderson
0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2007-04-11 15:55 UTC (permalink / raw)
To: Ivan Kokshaysky; +Cc: Andrew Morton, Jay Estabrook, linux-kernel
On Wed, Apr 11, 2007 at 12:28:41PM +0400, Ivan Kokshaysky wrote:
> - __asm__("ctlz %1, %0" : "=r"(vector) : "r"(mask));
> + __asm__(".arch ev67; ctlz %1, %0" : "=r"(vector) : "r"(mask));
This should use __kernel_ctlz, and we should use
#ifdef __alpha_cix__
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3
# define __kernel_cttz(x) __builtin_ctzl(x)
# else
# define __kernel_cttz(x) \
({ unsigned long __kir; \
__asm__("cttz %1,%0" : "=r"(__kir) : "r"(x)); \
__kir; })
# endif
#else
# define __kernel_cttz(x) \
({ unsigned long __kir; \
__asm__(".arch ev67; cttz %1,%0" : "=r"(__kir) : "r"(x)); \
__kir; })
#endif
etc, for the other __kernel_ctlz and __kernel_ctpop definitions.
> -asm(".section .got,\"aws\",@progbits; .align 3; .previous");
> +asm(".section .got,\"aw\",@progbits; .align 3; .previous");
Are you absolutely certain that the got gets put into the correct
spot when you do this? It really ought to have the SHF_ALPHA_GPREL
bit set, so that the ARCH_SHF_SMALL checks in kernel/module.c do
the correct thing.
I NAK this chunk without further proof. Anyway, the *proper* fix
is in the assembler; it shouldn't be complaining.
r~
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-04-11 16:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-11 8:28 [PATCH 2/7] ALPHA: build fixes - force architecture, eliminate wastage Ivan Kokshaysky
2007-04-11 15:55 ` Richard Henderson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox