Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e859dc553c857f4672b3bbb73ee9170a901f8712 Commit: e859dc553c857f4672b3bbb73ee9170a901f8712 Parent: 3671df8572a299acff9c9cac2bf7279ee614d154 Author: Andi Kleen <[EMAIL PROTECTED]> AuthorDate: Wed May 2 19:27:20 2007 +0200 Committer: Andi Kleen <[EMAIL PROTECTED]> CommitDate: Wed May 2 19:27:20 2007 +0200
[PATCH] i386: Implement alternative_io for i386 Ported from x86-64. Signed-off-by: Andi Kleen <[EMAIL PROTECTED]> --- include/asm-i386/alternative.h | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index 2774673..0f70b37 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h @@ -82,6 +82,21 @@ static inline void alternatives_smp_switch(int smp) {} "663:\n\t" newinstr "\n664:\n" /* replacement */\ ".previous" :: "i" (feature), ##input) +/* Like alternative_input, but with a single output argument */ +#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 */ \ + " .byte %c[feat]\n" /* feature bit */ \ + " .byte 662b-661b\n" /* sourcelen */ \ + " .byte 664f-663f\n" /* replacementlen */ \ + ".previous\n" \ + ".section .altinstr_replacement,\"ax\"\n" \ + "663:\n\t" newinstr "\n664:\n" /* replacement */ \ + ".previous" : output : [feat] "i" (feature), ##input) + /* * Alternative inline assembly for SMP. * - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html