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