blob: 372231c22a47a46b1417e5c6739d88eb927f89fd [file] [log] [blame]
H. Peter Anvin76f30752012-09-21 12:43:09 -07001#ifndef _ASM_X86_ALTERNATIVE_ASM_H
2#define _ASM_X86_ALTERNATIVE_ASM_H
3
Adrian Bunk7e02cb92007-10-17 18:04:38 +02004#ifdef __ASSEMBLY__
5
Jan Beulich99063c02009-11-27 15:06:16 +00006#include <asm/asm.h>
Adrian Bunk7e02cb92007-10-17 18:04:38 +02007
8#ifdef CONFIG_SMP
9 .macro LOCK_PREFIX
Eric Dumazetceb7b402012-01-03 17:35:40 +010010672: lock
H. Peter Anvin9cebed42012-09-21 12:43:08 -070011 .pushsection .smp_locks,"a"
Jan Beulich5967ed82010-04-21 16:08:14 +010012 .balign 4
Eric Dumazetceb7b402012-01-03 17:35:40 +010013 .long 672b - .
H. Peter Anvin9cebed42012-09-21 12:43:08 -070014 .popsection
Adrian Bunk7e02cb92007-10-17 18:04:38 +020015 .endm
16#else
17 .macro LOCK_PREFIX
18 .endm
19#endif
20
Fenghua Yu9072d112011-05-17 15:29:13 -070021.macro altinstruction_entry orig alt feature orig_len alt_len
Andy Lutomirski59e97e42011-07-13 09:24:10 -040022 .long \orig - .
23 .long \alt - .
Fenghua Yu9072d112011-05-17 15:29:13 -070024 .word \feature
25 .byte \orig_len
26 .byte \alt_len
27.endm
28
Adrian Bunk7e02cb92007-10-17 18:04:38 +020029#endif /* __ASSEMBLY__ */
H. Peter Anvin76f30752012-09-21 12:43:09 -070030
31#endif /* _ASM_X86_ALTERNATIVE_ASM_H */