Commit | Line | Data |
---|---|---|
1965aae3 PA |
1 | #ifndef _ASM_X86_ASM_H |
2 | #define _ASM_X86_ASM_H | |
e845c06b | 3 | |
e6e07d8a JF |
4 | #ifdef __ASSEMBLY__ |
5 | # define __ASM_FORM(x) x | |
a750036f | 6 | # define __ASM_FORM_COMMA(x) x, |
e6e07d8a JF |
7 | #else |
8 | # define __ASM_FORM(x) " " #x " " | |
a750036f | 9 | # define __ASM_FORM_COMMA(x) " " #x "," |
e6e07d8a | 10 | #endif |
8ee5797a | 11 | |
e6e07d8a JF |
12 | #ifdef CONFIG_X86_32 |
13 | # define __ASM_SEL(a,b) __ASM_FORM(a) | |
e845c06b | 14 | #else |
e6e07d8a JF |
15 | # define __ASM_SEL(a,b) __ASM_FORM(b) |
16 | #endif | |
e845c06b | 17 | |
4625cd63 JB |
18 | #define __ASM_SIZE(inst, ...) __ASM_SEL(inst##l##__VA_ARGS__, \ |
19 | inst##q##__VA_ARGS__) | |
40faf463 | 20 | #define __ASM_REG(reg) __ASM_SEL(e##reg, r##reg) |
e845c06b | 21 | |
e6e07d8a JF |
22 | #define _ASM_PTR __ASM_SEL(.long, .quad) |
23 | #define _ASM_ALIGN __ASM_SEL(.balign 4, .balign 8) | |
8ee5797a | 24 | |
8df9676d | 25 | #define _ASM_MOV __ASM_SIZE(mov) |
e6e07d8a JF |
26 | #define _ASM_INC __ASM_SIZE(inc) |
27 | #define _ASM_DEC __ASM_SIZE(dec) | |
28 | #define _ASM_ADD __ASM_SIZE(add) | |
29 | #define _ASM_SUB __ASM_SIZE(sub) | |
30 | #define _ASM_XADD __ASM_SIZE(xadd) | |
8df9676d | 31 | |
40faf463 | 32 | #define _ASM_AX __ASM_REG(ax) |
2528de43 GC |
33 | #define _ASM_BX __ASM_REG(bx) |
34 | #define _ASM_CX __ASM_REG(cx) | |
40faf463 | 35 | #define _ASM_DX __ASM_REG(dx) |
8df9676d PA |
36 | #define _ASM_SP __ASM_REG(sp) |
37 | #define _ASM_BP __ASM_REG(bp) | |
38 | #define _ASM_SI __ASM_REG(si) | |
39 | #define _ASM_DI __ASM_REG(di) | |
e845c06b | 40 | |
a34746bc | 41 | /* Exception table entry */ |
709972b1 | 42 | #ifdef __ASSEMBLY__ |
535c0c34 PA |
43 | # define _ASM_EXTABLE(from,to) \ |
44 | .pushsection "__ex_table","a" ; \ | |
45 | _ASM_ALIGN ; \ | |
46 | _ASM_PTR from , to ; \ | |
47 | .popsection | |
48 | ||
49 | # define _ASM_EXTABLE_EX(from,to) \ | |
50 | .pushsection "__ex_table","a" ; \ | |
51 | _ASM_ALIGN ; \ | |
52 | _ASM_PTR from , (to) - (from) ; \ | |
d4541805 | 53 | .popsection |
709972b1 | 54 | #else |
535c0c34 PA |
55 | # define _ASM_EXTABLE(from,to) \ |
56 | " .pushsection \"__ex_table\",\"a\"\n" \ | |
57 | _ASM_ALIGN "\n" \ | |
58 | _ASM_PTR #from "," #to "\n" \ | |
59 | " .popsection\n" | |
60 | ||
61 | # define _ASM_EXTABLE_EX(from,to) \ | |
62 | " .pushsection \"__ex_table\",\"a\"\n" \ | |
63 | _ASM_ALIGN "\n" \ | |
64 | _ASM_PTR #from ",(" #to ")-(" #from ")\n" \ | |
d4541805 | 65 | " .popsection\n" |
709972b1 | 66 | #endif |
a34746bc | 67 | |
1965aae3 | 68 | #endif /* _ASM_X86_ASM_H */ |