memcg: fix GPF when cgroup removal races with last exit
[linux-2.6-block.git] / include / linux / linkage.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_LINKAGE_H
2#define _LINUX_LINKAGE_H
3
a7bf0bd5 4#include <linux/compiler.h>
1da177e4
LT
5#include <asm/linkage.h>
6
7#ifdef __cplusplus
8#define CPP_ASMLINKAGE extern "C"
9#else
10#define CPP_ASMLINKAGE
11#endif
12
13#ifndef asmlinkage
14#define asmlinkage CPP_ASMLINKAGE
15#endif
16
75b13483 17#define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE)
7c74df07 18#define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE)
a7bf0bd5 19
d2af12ae
TA
20/*
21 * For assembly routines.
22 *
23 * Note when using these that you must specify the appropriate
24 * alignment directives yourself
25 */
75b13483 26#define __PAGE_ALIGNED_DATA .section ".data..page_aligned", "aw"
7c74df07 27#define __PAGE_ALIGNED_BSS .section ".bss..page_aligned", "aw"
d2af12ae 28
d10d89ec
LT
29/*
30 * This is used by architectures to keep arguments on the stack
31 * untouched by the compiler by keeping them live until the end.
32 * The argument stack may be owned by the assembly-language
33 * caller, not the callee, and gcc doesn't always understand
34 * that.
35 *
36 * We have the return value, and a maximum of six arguments.
37 *
38 * This should always be followed by a "return ret" for the
39 * protection to work (ie no more work that the compiler might
40 * end up needing stack temporaries for).
41 */
b0fac023
HC
42/* Assembly files may be compiled with -traditional .. */
43#ifndef __ASSEMBLY__
54a01510
RM
44#ifndef asmlinkage_protect
45# define asmlinkage_protect(n, ret, args...) do { } while (0)
1da177e4 46#endif
b0fac023 47#endif
1da177e4
LT
48
49#ifndef __ALIGN
50#define __ALIGN .align 4,0x90
51#define __ALIGN_STR ".align 4,0x90"
52#endif
53
54#ifdef __ASSEMBLY__
55
42f29a25 56#ifndef LINKER_SCRIPT
1da177e4
LT
57#define ALIGN __ALIGN
58#define ALIGN_STR __ALIGN_STR
59
ab7efcc9 60#ifndef ENTRY
1da177e4
LT
61#define ENTRY(name) \
62 .globl name; \
63 ALIGN; \
64 name:
ab7efcc9 65#endif
42f29a25 66#endif /* LINKER_SCRIPT */
1da177e4 67
214541d1
RR
68#ifndef WEAK
69#define WEAK(name) \
70 .weak name; \
71 name:
72#endif
73
ab7efcc9
JB
74#ifndef END
75#define END(name) \
76 .size name, .-name
77#endif
78
6b8be6df
JR
79/* If symbol 'name' is treated as a subroutine (gets called, and returns)
80 * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
81 * static analysis tools such as stack depth analyzer.
82 */
ab7efcc9
JB
83#ifndef ENDPROC
84#define ENDPROC(name) \
85 .type name, @function; \
86 END(name)
87#endif
d0aaff97 88
1da177e4
LT
89#endif
90
1da177e4 91#endif