diff options
| author | 2018-08-28 09:58:03 -0700 | |
|---|---|---|
| committer | 2018-08-28 09:58:03 -0700 | |
| commit | ea4d65f14f6aaa53e379b93c5544245ef081b3e7 (patch) | |
| tree | a15485f4f1cf547a52b31fa8e16e14b9579b7200 /include/linux/compiler.h | |
| parent | arm: dts: am4372: setup rtc as system-power-controller (diff) | |
| parent | ARM: dts: Fix file permission for am335x-osd3358-sm-red.dts (diff) | |
| download | wireguard-linux-ea4d65f14f6aaa53e379b93c5544245ef081b3e7.tar.xz wireguard-linux-ea4d65f14f6aaa53e379b93c5544245ef081b3e7.zip | |
Merge branch 'perm-fix' into omap-for-v4.19/fixes-v2
Diffstat (limited to '')
| -rw-r--r-- | include/linux/compiler.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 42506e4d1f53..681d866efb1e 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -280,6 +280,25 @@ unsigned long read_word_at_a_time(const void *addr) #endif /* __KERNEL__ */ +/* + * Force the compiler to emit 'sym' as a symbol, so that we can reference + * it from inline assembler. Necessary in case 'sym' could be inlined + * otherwise, or eliminated entirely due to lack of references that are + * visible to the compiler. + */ +#define __ADDRESSABLE(sym) \ + static void * __attribute__((section(".discard.addressable"), used)) \ + __PASTE(__addressable_##sym, __LINE__) = (void *)&sym; + +/** + * offset_to_ptr - convert a relative memory offset to an absolute pointer + * @off: the address of the 32-bit offset value + */ +static inline void *offset_to_ptr(const int *off) +{ + return (void *)((unsigned long)off + *off); +} + #endif /* __ASSEMBLY__ */ #ifndef __optimize @@ -313,7 +332,7 @@ unsigned long read_word_at_a_time(const void *addr) #ifdef __OPTIMIZE__ # define __compiletime_assert(condition, msg, prefix, suffix) \ do { \ - bool __cond = !(condition); \ + int __cond = !(condition); \ extern void prefix ## suffix(void) __compiletime_error(msg); \ if (__cond) \ prefix ## suffix(); \ |
