#ifndef _X68K_LOADFILE_MACHDEP_H_
#define _X68K_LOADFILE_MACHDEP_H_
#define BOOT_AOUT
#ifndef BOOT_STAGE1
#define BOOT_ELF32
#endif
#define LOAD_KERNEL LOAD_ALL
#define COUNT_KERNEL COUNT_ALL
#ifdef _STANDALONE
#ifndef BOOT_STAGE1
#define LOADADDR(a) ((a) + offset)
#define ALIGNENTRY(a) 0
#define READ(f, b, c) pread((f), (void *)LOADADDR(b), (c))
#define BCOPY(s, d, c) vpbcopy((s), (void *)LOADADDR(d), (c))
#define BZERO(d, c) pbzero((void *)LOADADDR(d), (c))
#define WARN(a) do { \
(void)printf a; \
if (errno) \
(void)printf(": %s\n", \
strerror(errno)); \
else \
(void)printf("\n"); \
} while(0)
#define PROGRESS(a) (void) printf a
#define ALLOC(a) alloc(a)
#define DEALLOC(a, b) dealloc(a, b)
#define OKMAGIC(a) (((a) == NMAGIC) || ((a) == OMAGIC))
#else
#define LOADADDR(a) ((a) + offset)
#define ALIGNENTRY(a) 0
#define READ(f, b, c) pread((f), (void *)LOADADDR(b), (c))
#define BCOPY(s, d, c) vpbcopy((s), (void *)LOADADDR(d), (c))
#define BZERO(d, c) pbzero((void *)LOADADDR(d), (c))
#define WARN(a)
#define PROGRESS(a)
#define ALLOC(a) alloc(a)
#define DEALLOC(a, b) dealloc(a, b)
#define OKMAGIC(a) (((a) == NMAGIC) || ((a) == OMAGIC))
#endif
#define vpbcopy bcopy
#define pbzero bzero
#define pread read
#else
#define LOADADDR(a) (((u_long)(a)) + offset)
#define ALIGNENTRY(a) ((u_long)(a))
#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c))
#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c))
#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c))
#define WARN(a) warn a
#define PROGRESS(a)
#define ALLOC(a) malloc(a)
#define DEALLOC(a, b) free(a)
#define OKMAGIC(a) ((a) == NMAGIC)
ssize_t vread(int, u_long, u_long *, size_t);
void vcopy(u_long, u_long, u_long *, size_t);
void vzero(u_long, u_long *, size_t);
#endif
#endif