]> git.ipfire.org Git - people/ms/u-boot.git/blame - arch/arm/include/asm/secure.h
Merge git://git.denx.de/u-boot-mmc
[people/ms/u-boot.git] / arch / arm / include / asm / secure.h
CommitLineData
f510aeae
MZ
1#ifndef __ASM_SECURE_H
2#define __ASM_SECURE_H
3
4#include <config.h>
5
afc1f65f 6#define __secure __attribute__ ((section ("._secure.text")))
a5aa7ff3 7#define __secure_data __attribute__ ((section ("._secure.data")))
afc1f65f 8
9a561753 9#if defined(CONFIG_ARMV7_SECURE_BASE) || defined(CONFIG_ARMV8_SECURE_BASE)
f510aeae
MZ
10/*
11 * Warning, horror ahead.
12 *
13 * The target code lives in our "secure ram", but u-boot doesn't know
14 * that, and has blindly added reloc_off to every relocation
15 * entry. Gahh. Do the opposite conversion. This hack also prevents
16 * GCC from generating code veeners, which u-boot doesn't relocate at
17 * all...
18 */
19#define secure_ram_addr(_fn) ({ \
20 DECLARE_GLOBAL_DATA_PTR; \
21 void *__fn = _fn; \
22 typeof(_fn) *__tmp = (__fn - gd->reloc_off); \
23 __tmp; \
24 })
25#else
26#define secure_ram_addr(_fn) (_fn)
27#endif
28
29#endif