diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2015-10-08 11:18:17 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2015-10-15 10:52:13 -0400 |
commit | 5d91226e897b8209f7acefc1806a3cbf90a5394e (patch) | |
tree | fc08571a7a45b908d430c6952ec1f90d5f01d5a2 /src/memmap.h | |
parent | fe6682da0bc435a62f3a5189ec203dcba9f91183 (diff) | |
download | seabios-hppa-5d91226e897b8209f7acefc1806a3cbf90a5394e.zip seabios-hppa-5d91226e897b8209f7acefc1806a3cbf90a5394e.tar.gz seabios-hppa-5d91226e897b8209f7acefc1806a3cbf90a5394e.tar.bz2 |
memmap: Introduce SYMBOL() macro to access linker script symbols
Use a macro to define and obtain the value of a symbol introduced by
the linker scripts (scripts/layoutrom.py).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/memmap.h')
-rw-r--r-- | src/memmap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/memmap.h b/src/memmap.h index 092e2ad..22bd4bc 100644 --- a/src/memmap.h +++ b/src/memmap.h @@ -14,4 +14,8 @@ static inline void *memremap(u32 addr, u32 len) { return (void*)addr; } +// Return the value of a linker script symbol (see scripts/layoutrom.py) +#define SYMBOL(SYM) ({ extern char SYM; (u32)&SYM; }) +#define VSYMBOL(SYM) ((void*)SYMBOL(SYM)) + #endif // memmap.h |