asmlinkage_protect replaces prevent_tail_call
[linux-2.6.git] / include / asm-x86 / linkage.h
1 #ifndef __ASM_LINKAGE_H
2 #define __ASM_LINKAGE_H
3
4 #ifdef CONFIG_X86_64
5 #define __ALIGN .p2align 4,,15
6 #define __ALIGN_STR ".p2align 4,,15"
7 #endif
8
9 #ifdef CONFIG_X86_32
10 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
11 /*
12  * For 32-bit UML - mark functions implemented in assembly that use
13  * regparm input parameters:
14  */
15 #define asmregparm __attribute__((regparm(3)))
16
17 #define asmlinkage_protect(n, ret, args...) \
18         __asmlinkage_protect##n(ret, ##args)
19 #define __asmlinkage_protect_n(ret, args...) \
20         __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
21 #define __asmlinkage_protect0(ret) \
22         __asmlinkage_protect_n(ret)
23 #define __asmlinkage_protect1(ret, arg1) \
24         __asmlinkage_protect_n(ret, "g" (arg1))
25 #define __asmlinkage_protect2(ret, arg1, arg2) \
26         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2))
27 #define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
28         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3))
29 #define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
30         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
31                               "g" (arg4))
32 #define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
33         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
34                               "g" (arg4), "g" (arg5))
35 #define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
36         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
37                               "g" (arg4), "g" (arg5), "g" (arg6))
38
39 #endif
40
41 #ifdef CONFIG_X86_ALIGNMENT_16
42 #define __ALIGN .align 16,0x90
43 #define __ALIGN_STR ".align 16,0x90"
44 #endif
45
46 #endif
47