blob: 9ddf83028465806345e8e6e1177a4caab0337064 [file] [log] [blame]
Macpaul Lin273d11e2011-12-01 12:32:10 +08001/*
2 * U-boot - linkage.h
3 *
4 * Copyright (c) 2005-2007 Analog Devices Inc.
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Macpaul Lin273d11e2011-12-01 12:32:10 +08007 */
8
9#ifndef _LINUX_LINKAGE_H
10#define _LINUX_LINKAGE_H
11
12#include <asm/linkage.h>
13#include <linux/config.h>
14
15#ifdef __cplusplus
16#define CPP_ASMLINKAGE extern "C"
17#else
18#define CPP_ASMLINKAGE
19#endif
20
21#define asmlinkage CPP_ASMLINKAGE
22
23#define SYMBOL_NAME_STR(X) #X
24#define SYMBOL_NAME(X) X
25#ifdef __STDC__
26#define SYMBOL_NAME_LABEL(X) X##:
27#else
28#define SYMBOL_NAME_LABEL(X) X:
29#endif
30
Aneesh V72455362012-03-08 07:20:17 +000031#ifndef __ALIGN
Macpaul Lin273d11e2011-12-01 12:32:10 +080032#define __ALIGN .align 4
Aneesh V72455362012-03-08 07:20:17 +000033#endif
34
35#ifndef __ALIGN_STR
Macpaul Lin273d11e2011-12-01 12:32:10 +080036#define __ALIGN_STR ".align 4"
Aneesh V72455362012-03-08 07:20:17 +000037#endif
Macpaul Lin273d11e2011-12-01 12:32:10 +080038
39#ifdef __ASSEMBLY__
40
41#define ALIGN __ALIGN
42#define ALIGN_STR __ALIGN_STR
43
44#define LENTRY(name) \
45 ALIGN; \
46 SYMBOL_NAME_LABEL(name)
47
48#define ENTRY(name) \
49 .globl SYMBOL_NAME(name); \
50 LENTRY(name)
51
52#ifndef END
53#define END(name) \
54 .size name, .-name
55#endif
56
57#ifndef ENDPROC
58#define ENDPROC(name) \
Aneesh V72455362012-03-08 07:20:17 +000059 .type name STT_FUNC; \
Macpaul Lin273d11e2011-12-01 12:32:10 +080060 END(name)
61#endif
62
63#endif
64
65#endif