include/compiler: add helpers for offset-based addressing
This commit is contained in:
parent
309948a52e
commit
43807a1793
|
@ -7,6 +7,7 @@
|
||||||
#ifndef _EVL_COMPILER_H
|
#ifndef _EVL_COMPILER_H
|
||||||
#define _EVL_COMPILER_H
|
#define _EVL_COMPILER_H
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
@ -89,4 +90,7 @@
|
||||||
|
|
||||||
#define compiler_barrier() __asm__ __volatile__("": : :"memory")
|
#define compiler_barrier() __asm__ __volatile__("": : :"memory")
|
||||||
|
|
||||||
|
#define __memoff(__base, __addr) ((uintptr_t)((caddr_t)(__addr) - (caddr_t)(__base)))
|
||||||
|
#define __memptr(__base, __off) ((void *)((caddr_t)(__base) + (__off)))
|
||||||
|
|
||||||
#endif /* _EVL_COMPILER_H */
|
#endif /* _EVL_COMPILER_H */
|
||||||
|
|
Loading…
Reference in New Issue