blob: 39c712eac5b912b6cd2bd1ece7abf17213125552 [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>
Macpaul Lin273d11e2011-12-01 12:32:10 +080013
14#ifdef __cplusplus
15#define CPP_ASMLINKAGE extern "C"
16#else
17#define CPP_ASMLINKAGE
18#endif
19
20#define asmlinkage CPP_ASMLINKAGE
21
22#define SYMBOL_NAME_STR(X) #X
23#define SYMBOL_NAME(X) X
24#ifdef __STDC__
25#define SYMBOL_NAME_LABEL(X) X##:
26#else
27#define SYMBOL_NAME_LABEL(X) X:
28#endif
29
Aneesh V72455362012-03-08 07:20:17 +000030#ifndef __ALIGN
Macpaul Lin273d11e2011-12-01 12:32:10 +080031#define __ALIGN .align 4
Aneesh V72455362012-03-08 07:20:17 +000032#endif
33
34#ifndef __ALIGN_STR
Macpaul Lin273d11e2011-12-01 12:32:10 +080035#define __ALIGN_STR ".align 4"
Aneesh V72455362012-03-08 07:20:17 +000036#endif
Macpaul Lin273d11e2011-12-01 12:32:10 +080037
38#ifdef __ASSEMBLY__
39
40#define ALIGN __ALIGN
41#define ALIGN_STR __ALIGN_STR
42
43#define LENTRY(name) \
44 ALIGN; \
45 SYMBOL_NAME_LABEL(name)
46
47#define ENTRY(name) \
48 .globl SYMBOL_NAME(name); \
49 LENTRY(name)
50
51#ifndef END
52#define END(name) \
53 .size name, .-name
54#endif
55
56#ifndef ENDPROC
57#define ENDPROC(name) \
Aneesh V72455362012-03-08 07:20:17 +000058 .type name STT_FUNC; \
Macpaul Lin273d11e2011-12-01 12:32:10 +080059 END(name)
60#endif
61
62#endif
63
64#endif