]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/linux/linkage.h
types.h: move and redefine resource_size_t
[people/ms/u-boot.git] / include / linux / linkage.h
CommitLineData
273d11ea 1/*
a187559e 2 * U-Boot - linkage.h
273d11ea
ML
3 *
4 * Copyright (c) 2005-2007 Analog Devices Inc.
5 *
1a459660 6 * SPDX-License-Identifier: GPL-2.0+
273d11ea
ML
7 */
8
9#ifndef _LINUX_LINKAGE_H
10#define _LINUX_LINKAGE_H
11
12#include <asm/linkage.h>
273d11ea 13
950cb9bb
CG
14/* Some toolchains use other characters (e.g. '`') to mark new line in macro */
15#ifndef ASM_NL
16#define ASM_NL ;
17#endif
18
273d11ea
ML
19#ifdef __cplusplus
20#define CPP_ASMLINKAGE extern "C"
21#else
22#define CPP_ASMLINKAGE
23#endif
24
e6126a58 25#ifndef asmlinkage
273d11ea 26#define asmlinkage CPP_ASMLINKAGE
e6126a58 27#endif
273d11ea
ML
28
29#define SYMBOL_NAME_STR(X) #X
30#define SYMBOL_NAME(X) X
31#ifdef __STDC__
32#define SYMBOL_NAME_LABEL(X) X##:
33#else
34#define SYMBOL_NAME_LABEL(X) X:
35#endif
36
7245536d 37#ifndef __ALIGN
273d11ea 38#define __ALIGN .align 4
7245536d
A
39#endif
40
41#ifndef __ALIGN_STR
273d11ea 42#define __ALIGN_STR ".align 4"
7245536d 43#endif
273d11ea
ML
44
45#ifdef __ASSEMBLY__
46
47#define ALIGN __ALIGN
48#define ALIGN_STR __ALIGN_STR
49
50#define LENTRY(name) \
950cb9bb 51 ALIGN ASM_NL \
273d11ea
ML
52 SYMBOL_NAME_LABEL(name)
53
54#define ENTRY(name) \
950cb9bb 55 .globl SYMBOL_NAME(name) ASM_NL \
273d11ea
ML
56 LENTRY(name)
57
ec4fa567 58#define WEAK(name) \
950cb9bb 59 .weak SYMBOL_NAME(name) ASM_NL \
ec4fa567
DF
60 LENTRY(name)
61
273d11ea
ML
62#ifndef END
63#define END(name) \
64 .size name, .-name
65#endif
66
67#ifndef ENDPROC
68#define ENDPROC(name) \
950cb9bb 69 .type name STT_FUNC ASM_NL \
273d11ea
ML
70 END(name)
71#endif
72
73#endif
74
75#endif