Add a file missing from r508
[openbios.git] / include / elf_boot.h
blob18487f6b02ddc8a5b145596ce5028f353f9a45ff
1 #ifndef ELF_BOOT_H
2 #define ELF_BOOT_H
5 /* This defines the structure of a table of parameters useful for ELF
6 * bootable images. These parameters are all passed and generated
7 * by the bootloader to the booted image. For simplicity and
8 * consistency the Elf Note format is reused.
10 * All of the information must be Position Independent Data.
11 * That is it must be safe to relocate the whole ELF boot parameter
12 * block without changing the meaning or correctnes of the data.
13 * Additionally it must be safe to permute the order of the ELF notes
14 * to any possible permutation without changing the meaning or correctness
15 * of the data.
19 #define ELF_BHDR_MAGIC 0x0E1FB007
21 #ifndef __ASSEMBLY__
22 typedef uint16_t Elf_Half;
23 typedef uint32_t Elf_Word;
26 * Elf boot notes...
29 typedef struct Elf_Bhdr
31 Elf_Word b_signature; /* "0x0E1FB007" */
32 Elf_Word b_size;
33 Elf_Half b_checksum;
34 Elf_Half b_records;
35 } Elf_Bhdr;
38 * ELF Notes.
41 typedef struct Elf_Nhdr
43 Elf_Word n_namesz; /* Length of the note's name. */
44 Elf_Word n_descsz; /* Length of the note's descriptor. */
45 Elf_Word n_type; /* Type of the note. */
46 } Elf_Nhdr;
48 #endif /* __ASSEMBLY__ */
50 /* Standardized Elf image notes for booting... The name for all of these is ELFBoot */
51 #define ELF_NOTE_BOOT "ELFBoot"
53 #define EIN_PROGRAM_NAME 0x00000001
54 /* The program in this ELF file */
55 #define EIN_PROGRAM_VERSION 0x00000002
56 /* The version of the program in this ELF file */
57 #define EIN_PROGRAM_CHECKSUM 0x00000003
58 /* ip style checksum of the memory image. */
61 /* Linux image notes for booting... The name for all of these is Linux */
63 #define LIN_COMMAND_LINE 0x00000001
64 /* The command line to pass to the loaded kernel. */
65 #define LIN_ROOT_DEV 0x00000002
66 /* The root dev to pass to the loaded kernel. */
67 #define LIN_RAMDISK_FLAGS 0x00000003
68 /* Various old ramdisk flags */
69 #define LIN_INITRD_START 0x00000004
70 /* Start of the ramdisk in bytes */
71 #define LIN_INITRD_SIZE 0x00000005
72 /* Size of the ramdisk in bytes */
74 /* Notes that are passed to a loaded image */
75 /* For the standard elf boot notes n_namesz must be zero */
76 #define EBN_FIRMWARE_TYPE 0x00000001
77 /* ASCIZ name of the platform firmware. */
78 #define EBN_BOOTLOADER_NAME 0x00000002
79 /* This specifies just the ASCIZ name of the bootloader */
80 #define EBN_BOOTLOADER_VERSION 0x00000003
81 /* This specifies the version of the bootloader as an ASCIZ string */
82 #define EBN_COMMAND_LINE 0x00000004
83 /* This specifies a command line that can be set by user interaction,
84 * and is provided as a free form ASCIZ string to the loaded image.
86 #define EBN_NOP 0x00000005
87 /* A note nop note has no meaning, useful for inserting explicit padding */
88 #define EBN_LOADED_IMAGE 0x00000006
89 /* An ASCIZ string naming the loaded image */
92 /* Etherboot specific notes */
93 #define EB_PARAM_NOTE "Etherboot"
94 #define EB_IA64_SYSTAB 0x00000001
95 #define EB_IA64_MEMMAP 0x00000002
96 #define EB_IA64_FPSWA 0x00000003
97 #define EB_IA64_CONINFO 0x00000004
98 #define EB_BOOTP_DATA 0x00000005
99 #define EB_HEADER 0x00000006
100 #define EB_IA64_IMAGE_HANDLE 0x00000007
101 #define EB_I386_MEMMAP 0x00000008
103 extern const struct elf_image_note elf_image_notes;
105 #endif /* ELF_BOOT_H */