Merge branch 'writeback-for-next' of git://git.kernel.org/pub/scm/linux/kernel/git...
[deliverable/linux.git] / arch / x86 / include / asm / linkage.h
CommitLineData
1965aae3
PA
1#ifndef _ASM_X86_LINKAGE_H
2#define _ASM_X86_LINKAGE_H
82f74e71 3
bb7f5f6c
CG
4#include <linux/stringify.h>
5
78a9909a
IM
6#undef notrace
7#define notrace __attribute__((no_instrument_function))
8
96a388de 9#ifdef CONFIG_X86_32
82f74e71 10#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
54a01510 11
d10d89ec
LT
12/*
13 * Make sure the compiler doesn't do anything stupid with the
14 * arguments on the stack - they are owned by the *caller*, not
15 * the callee. This just fools gcc into not spilling into them,
16 * and keeps it from doing tailcall recursion and/or using the
17 * stack slots for temporaries, since they are live and "used"
18 * all the way to the end of the function.
19 *
20 * NOTE! On x86-64, all the arguments are in registers, so this
21 * only matters on a 32-bit kernel.
22 */
54a01510
RM
23#define asmlinkage_protect(n, ret, args...) \
24 __asmlinkage_protect##n(ret, ##args)
25#define __asmlinkage_protect_n(ret, args...) \
26 __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
27#define __asmlinkage_protect0(ret) \
28 __asmlinkage_protect_n(ret)
29#define __asmlinkage_protect1(ret, arg1) \
30 __asmlinkage_protect_n(ret, "g" (arg1))
31#define __asmlinkage_protect2(ret, arg1, arg2) \
32 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2))
33#define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
34 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3))
35#define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
36 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
37 "g" (arg4))
38#define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
39 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
40 "g" (arg4), "g" (arg5))
41#define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
42 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
43 "g" (arg4), "g" (arg5), "g" (arg6))
44
7ab15247
CG
45#endif /* CONFIG_X86_32 */
46
47#ifdef __ASSEMBLY__
82f74e71 48
95695547
CG
49#define GLOBAL(name) \
50 .globl name; \
51 name:
52
bb7f5f6c
CG
53#if defined(CONFIG_X86_64) || defined(CONFIG_X86_ALIGNMENT_16)
54#define __ALIGN .p2align 4, 0x90
55#define __ALIGN_STR __stringify(__ALIGN)
82f74e71
HH
56#endif
57
7ab15247
CG
58#endif /* __ASSEMBLY__ */
59
1965aae3 60#endif /* _ASM_X86_LINKAGE_H */
82f74e71 61
This page took 0.432237 seconds and 5 git commands to generate.