* 2.6.21-rc2-mm2 fails does not compile
@ 2007-03-07 11:53 Marc Dietrich
2007-03-07 13:21 ` [PATCH] i386 alternative_io implementation Andy Whitcroft
0 siblings, 1 reply; 2+ messages in thread
From: Marc Dietrich @ 2007-03-07 11:53 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton
Hi,
the fix "revert-optimize-and-simplify-get_cycles_sync" breaks the build:
CC arch/i386/kernel/asm-offsets.s
In file included from include/asm/timex.h:10,
from include/linux/timex.h:187,
from include/linux/sched.h:50,
from include/linux/utsname.h:35,
from include/asm/elf.h:12,
from include/linux/elf.h:7,
from include/linux/module.h:15,
from include/linux/crypto.h:21,
from arch/i386/kernel/asm-offsets.c:7:
include/asm/tsc.h: In function ‘get_cycles_sync’:
include/asm/tsc.h:45: warning: implicit declaration of
function ‘alternative_io’
include/asm/tsc.h:46: error: called object ‘"=a"’ is not a function
include/asm/tsc.h:46: error: called object ‘"0"’ is not a function
include/asm/tsc.h:46: error: expected ‘)’ before ‘:’ token
make[1]: *** [arch/i386/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
seems that alternative_io is only defined in the x86_64 case ...
what's the fix for the fix ?
Marc
--
"Those who question our statements are traitors"
Lord Arthur Ponsonby, "Falsehood in Wartime: Propaganda Lies of the First
World War", 1928
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] i386 alternative_io implementation
2007-03-07 11:53 2.6.21-rc2-mm2 fails does not compile Marc Dietrich
@ 2007-03-07 13:21 ` Andy Whitcroft
0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2007-03-07 13:21 UTC (permalink / raw)
To: Marc Dietrich; +Cc: Andrew Morton, Andy Whitcroft, linux-kernel
Add an i386 implementation of alternative_io modelled on
the x86_64 version.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
Ok, this seems to fix things up here. I have only boot
tested this on an SMP so I'd not call that 'heavily tested'
in any real sense but it might get you going until akpm
has a chance to comment.
-apw
---
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h
index 4a77e93..8b6d9ed 100644
--- a/include/asm-i386/alternative.h
+++ b/include/asm-i386/alternative.h
@@ -100,6 +100,23 @@ static inline void alternatives_smp_switch(int smp) {}
"663:\n\t" newinstr "\n664:\n" /* replacement */\
".previous" :: "i" (feature), ##input)
+#define alternative_io(oldinstr, newinstr, feature, output, input...) \
+ asm volatile ("661:\n\t" oldinstr "\n662:\n" \
+ ".section .altinstructions,\"a\"\n" \
+ " .align 4\n" \
+ " .long 661b\n" /* label */ \
+ " .long 663f\n" /* new instruction */ \
+ " .long 0x00\n" \
+ " .byte %c[feat]\n" /* feature bit */ \
+ " .byte 0x00\n" \
+ " .byte 662b-661b\n" /* sourcelen */ \
+ " .byte 664f-663f\n" /* replacementlen */ \
+ " .byte 0x00\n" \
+ ".previous\n" \
+ ".section .altinstr_replacement,\"ax\"\n" \
+ "663:\n\t" newinstr "\n664:\n" /* replacement */\
+ ".previous" : output : [feat] "i" (feature), ##input)
+
/* Like alternative_io, but supports 2 possible alternatives */
#define alternative_io_two(oldinstr, newinstr, feat, newinstr2, feat2,\
output, input...) \
diff --git a/include/asm-i386/tsc.h b/include/asm-i386/tsc.h
index 3469766..a031b56 100644
--- a/include/asm-i386/tsc.h
+++ b/include/asm-i386/tsc.h
@@ -6,6 +6,7 @@
#ifndef _ASM_i386_TSC_H
#define _ASM_i386_TSC_H
+#include <asm/alternative.h>
#include <asm/processor.h>
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-07 13:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-07 11:53 2.6.21-rc2-mm2 fails does not compile Marc Dietrich
2007-03-07 13:21 ` [PATCH] i386 alternative_io implementation Andy Whitcroft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®