H. Peter Anvin | 76f3075 | 2012-09-21 12:43:09 -0700 | [diff] [blame] | 1 | #ifndef _ASM_X86_ALTERNATIVE_ASM_H |
2 | #define _ASM_X86_ALTERNATIVE_ASM_H | ||||
3 | |||||
Adrian Bunk | 7e02cb9 | 2007-10-17 18:04:38 +0200 | [diff] [blame] | 4 | #ifdef __ASSEMBLY__ |
5 | |||||
Jan Beulich | 99063c0 | 2009-11-27 15:06:16 +0000 | [diff] [blame] | 6 | #include <asm/asm.h> |
Adrian Bunk | 7e02cb9 | 2007-10-17 18:04:38 +0200 | [diff] [blame] | 7 | |
8 | #ifdef CONFIG_SMP | ||||
9 | .macro LOCK_PREFIX | ||||
Eric Dumazet | ceb7b40 | 2012-01-03 17:35:40 +0100 | [diff] [blame] | 10 | 672: lock |
H. Peter Anvin | 9cebed4 | 2012-09-21 12:43:08 -0700 | [diff] [blame] | 11 | .pushsection .smp_locks,"a" |
Jan Beulich | 5967ed8 | 2010-04-21 16:08:14 +0100 | [diff] [blame] | 12 | .balign 4 |
Eric Dumazet | ceb7b40 | 2012-01-03 17:35:40 +0100 | [diff] [blame] | 13 | .long 672b - . |
H. Peter Anvin | 9cebed4 | 2012-09-21 12:43:08 -0700 | [diff] [blame] | 14 | .popsection |
Adrian Bunk | 7e02cb9 | 2007-10-17 18:04:38 +0200 | [diff] [blame] | 15 | .endm |
16 | #else | ||||
17 | .macro LOCK_PREFIX | ||||
18 | .endm | ||||
19 | #endif | ||||
20 | |||||
Fenghua Yu | 9072d11 | 2011-05-17 15:29:13 -0700 | [diff] [blame] | 21 | .macro altinstruction_entry orig alt feature orig_len alt_len |
Andy Lutomirski | 59e97e4 | 2011-07-13 09:24:10 -0400 | [diff] [blame] | 22 | .long \orig - . |
23 | .long \alt - . | ||||
Fenghua Yu | 9072d11 | 2011-05-17 15:29:13 -0700 | [diff] [blame] | 24 | .word \feature |
25 | .byte \orig_len | ||||
26 | .byte \alt_len | ||||
27 | .endm | ||||
28 | |||||
Adrian Bunk | 7e02cb9 | 2007-10-17 18:04:38 +0200 | [diff] [blame] | 29 | #endif /* __ASSEMBLY__ */ |
H. Peter Anvin | 76f3075 | 2012-09-21 12:43:09 -0700 | [diff] [blame] | 30 | |
31 | #endif /* _ASM_X86_ALTERNATIVE_ASM_H */ |