loadfile_machdep.h revision 1.5 1
2 #if defined(__aarch64__)
3 #define BOOT_ELF64
4 #else
5 #define BOOT_ELF32
6 #endif
7
8 #define LOAD_KERNEL (LOAD_ALL & ~LOAD_TEXTA)
9 #define COUNT_KERNEL (COUNT_ALL & ~COUNT_TEXTA)
10
11 #if defined(__aarch64__)
12 extern u_long load_offset;
13 #define LOADADDR(a) (((((u_long)(a)) + offset) & 0x3fffffffff) + load_offset)
14 #else
15 #define LOADADDR(a) (((u_long)(a)))
16 #endif
17 #define ALIGNENTRY(a) ((u_long)(a))
18 #define READ(f, b, c) read((f), (void*)LOADADDR(b), (c))
19 #define BCOPY(s, d, c) memmove((void*)LOADADDR(d), (void*)(s), (c))
20 #define BZERO(d, c) memset((void*)LOADADDR(d), 0, (c))
21 #define WARN(a) do { \
22 (void)printf a; \
23 if (errno) \
24 (void)printf(": %s\n", \
25 strerror(errno)); \
26 else \
27 (void)printf("\n"); \
28 } while(/* CONSTCOND */0)
29 #define PROGRESS(a) (void)printf a
30 #define ALLOC(a) alloc(a)
31 #define DEALLOC(a, b) dealloc(a, b)
32 #define OKMAGIC(a) ((a) == ZMAGIC)
33