summaryrefslogtreecommitdiffstats
path: root/include/boot/beoboot.h
blob: d22fef125564497a2600c5d5a7e373787e27c24f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*--- Boot image definitions ---------------------------------------*/
struct beoboot_header {
    char magic[4];
    uint8_t  arch;
    uint8_t  flags;
    uint16_t cmdline_size;/* length of command line (including null) */
    /* The alpha chunk is a backward compatibility hack.  The original
     * assumption was that integer sizes didn't matter because we
     * would never mix architectures.  x86_64 + i386 broke that
     * assumption.  It's fixed for that combination and the future.
     * However, alpha needs a little hack now... */
#ifdef __alpha__
    unsigned long kernel_size;
    unsigned long initrd_size;
#else
    uint32_t kernel_size;
    uint32_t initrd_size;
#endif
};
#define BEOBOOT_MAGIC     "BeoB"
#define BEOBOOT_ARCH_I386  1
#define BEOBOOT_ARCH_ALPHA 2
#define BEOBOOT_ARCH_PPC   3
#define BEOBOOT_ARCH_PPC64 4
#if defined(__i386__) || defined(__x86_64__)
#define BEOBOOT_ARCH BEOBOOT_ARCH_I386
#elif defined(__alpha__)
#define BEOBOOT_ARCH BEOBOOT_ARCH_ALPHA
#elif defined(powerpc)
#define BEOBOOT_ARCH BEOBOOT_ARCH_PPC
#elif defined(__powerpc64__)
#define BEOBOOT_ARCH BEOBOOT_ARCH_PPC64
#else
#error Unsupported architecture.
#endif
#define BEOBOOT_INITRD_PRESENT 1
/*------------------------------------------------------------------*/