Merge branch 'cpus4096' into irq/threaded
[safe/jmp/linux-2.6] / arch / x86 / include / asm / linkage.h
1 #ifndef _ASM_X86_LINKAGE_H
2 #define _ASM_X86_LINKAGE_H
3
4 #undef notrace
5 #define notrace __attribute__((no_instrument_function))
6
7 #ifdef CONFIG_X86_32
8 #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
9 /*
10  * For 32-bit UML - mark functions implemented in assembly that use
11  * regparm input parameters:
12  */
13 #define asmregparm __attribute__((regparm(3)))
14
15 /*
16  * Make sure the compiler doesn't do anything stupid with the
17  * arguments on the stack - they are owned by the *caller*, not
18  * the callee. This just fools gcc into not spilling into them,
19  * and keeps it from doing tailcall recursion and/or using the
20  * stack slots for temporaries, since they are live and "used"
21  * all the way to the end of the function.
22  *
23  * NOTE! On x86-64, all the arguments are in registers, so this
24  * only matters on a 32-bit kernel.
25  */
26 #define asmlinkage_protect(n, ret, args...) \
27         __asmlinkage_protect##n(ret, ##args)
28 #define __asmlinkage_protect_n(ret, args...) \
29         __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
30 #define __asmlinkage_protect0(ret) \
31         __asmlinkage_protect_n(ret)
32 #define __asmlinkage_protect1(ret, arg1) \
33         __asmlinkage_protect_n(ret, "g" (arg1))
34 #define __asmlinkage_protect2(ret, arg1, arg2) \
35         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2))
36 #define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
37         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3))
38 #define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
39         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
40                               "g" (arg4))
41 #define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
42         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
43                               "g" (arg4), "g" (arg5))
44 #define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
45         __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
46                               "g" (arg4), "g" (arg5), "g" (arg6))
47
48 #endif /* CONFIG_X86_32 */
49
50 #ifdef __ASSEMBLY__
51
52 #define GLOBAL(name)    \
53         .globl name;    \
54         name:
55
56 #ifdef CONFIG_X86_64
57 #define __ALIGN .p2align 4,,15
58 #define __ALIGN_STR ".p2align 4,,15"
59 #endif
60
61 #ifdef CONFIG_X86_ALIGNMENT_16
62 #define __ALIGN .align 16,0x90
63 #define __ALIGN_STR ".align 16,0x90"
64 #endif
65
66 #endif /* __ASSEMBLY__ */
67
68 #endif /* _ASM_X86_LINKAGE_H */
69