blob: 3faf599ea58ec4cac70121f874efa9ec4d6ca5f4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _LINUX_LINKAGE_H
2#define _LINUX_LINKAGE_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <asm/linkage.h>
5
6#ifdef __cplusplus
7#define CPP_ASMLINKAGE extern "C"
8#else
9#define CPP_ASMLINKAGE
10#endif
11
12#ifndef asmlinkage
13#define asmlinkage CPP_ASMLINKAGE
14#endif
15
Ingo Molnard50efc62008-01-30 13:33:00 +010016#ifndef asmregparm
17# define asmregparm
18#endif
19
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#ifndef prevent_tail_call
21# define prevent_tail_call(ret) do { } while (0)
22#endif
23
24#ifndef __ALIGN
25#define __ALIGN .align 4,0x90
26#define __ALIGN_STR ".align 4,0x90"
27#endif
28
29#ifdef __ASSEMBLY__
30
31#define ALIGN __ALIGN
32#define ALIGN_STR __ALIGN_STR
33
Jan Beulichab7efcc2006-03-24 03:16:17 -080034#ifndef ENTRY
Linus Torvalds1da177e2005-04-16 15:20:36 -070035#define ENTRY(name) \
36 .globl name; \
37 ALIGN; \
38 name:
Jan Beulichab7efcc2006-03-24 03:16:17 -080039#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
Rusty Russell214541d2007-10-21 16:41:34 -070041#ifndef WEAK
42#define WEAK(name) \
43 .weak name; \
44 name:
45#endif
46
Prasanna S Panchamukhid0aaff92005-09-06 15:19:26 -070047#define KPROBE_ENTRY(name) \
Prasanna S.Pd28c4392006-09-26 10:52:34 +020048 .pushsection .kprobes.text, "ax"; \
Jan Beulichab7efcc2006-03-24 03:16:17 -080049 ENTRY(name)
Prasanna S Panchamukhid0aaff92005-09-06 15:19:26 -070050
Prasanna S.Pd28c4392006-09-26 10:52:34 +020051#define KPROBE_END(name) \
52 END(name); \
53 .popsection
54
Jan Beulichab7efcc2006-03-24 03:16:17 -080055#ifndef END
56#define END(name) \
57 .size name, .-name
58#endif
59
John Reiser6b8be6d2008-01-30 13:33:13 +010060/* If symbol 'name' is treated as a subroutine (gets called, and returns)
61 * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
62 * static analysis tools such as stack depth analyzer.
63 */
Jan Beulichab7efcc2006-03-24 03:16:17 -080064#ifndef ENDPROC
65#define ENDPROC(name) \
66 .type name, @function; \
67 END(name)
68#endif
Prasanna S Panchamukhid0aaff92005-09-06 15:19:26 -070069
Linus Torvalds1da177e2005-04-16 15:20:36 -070070#endif
71
72#define NORET_TYPE /**/
73#define ATTRIB_NORET __attribute__((noreturn))
74#define NORET_AND noreturn,
75
76#ifndef FASTCALL
77#define FASTCALL(x) x
78#define fastcall
79#endif
80
81#endif