1 | #ifndef ELF_BOOT_H
|
---|
2 | #define ELF_BOOT_H
|
---|
3 |
|
---|
4 |
|
---|
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.
|
---|
9 | *
|
---|
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.
|
---|
16 | *
|
---|
17 | */
|
---|
18 |
|
---|
19 | #define ELF_BHDR_MAGIC 0x0E1FB007
|
---|
20 |
|
---|
21 | #ifndef ASSEMBLY
|
---|
22 | #include <stdint.h>
|
---|
23 | typedef uint16_t Elf_Half;
|
---|
24 | typedef uint32_t Elf_Word;
|
---|
25 |
|
---|
26 | typedef struct Elf_Bhdr
|
---|
27 | {
|
---|
28 | Elf_Word b_signature; /* "0x0E1FB007" */
|
---|
29 | Elf_Word b_size;
|
---|
30 | Elf_Half b_checksum;
|
---|
31 | Elf_Half b_records;
|
---|
32 | } Elf_Bhdr;
|
---|
33 |
|
---|
34 | typedef struct Elf_Nhdr
|
---|
35 | {
|
---|
36 | Elf_Word n_namesz; /* Length of the note's name. */
|
---|
37 | Elf_Word n_descsz; /* Length of the note's descriptor. */
|
---|
38 | Elf_Word n_type; /* Type of the note. */
|
---|
39 | } Elf_Nhdr;
|
---|
40 |
|
---|
41 | #endif /* ASSEMBLY */
|
---|
42 |
|
---|
43 | /* Standardized Elf image notes for booting... The name for all of these is ELFBoot */
|
---|
44 | #define ELF_NOTE_BOOT "ELFBoot"
|
---|
45 |
|
---|
46 | #define EIN_PROGRAM_NAME 0x00000001
|
---|
47 | /* The program in this ELF file */
|
---|
48 | #define EIN_PROGRAM_VERSION 0x00000002
|
---|
49 | /* The version of the program in this ELF file */
|
---|
50 | #define EIN_PROGRAM_CHECKSUM 0x00000003
|
---|
51 | /* ip style checksum of the memory image. */
|
---|
52 |
|
---|
53 |
|
---|
54 | /* Notes that are passed to a loaded image */
|
---|
55 | /* For standard notes n_namesz must be zero */
|
---|
56 | #define EBN_FIRMWARE_TYPE 0x00000001
|
---|
57 | /* ASCIZ name of the platform firmware. */
|
---|
58 | #define EBN_BOOTLOADER_NAME 0x00000002
|
---|
59 | /* This specifies just the ASCIZ name of the bootloader */
|
---|
60 | #define EBN_BOOTLOADER_VERSION 0x00000003
|
---|
61 | /* This specifies the version of the bootloader as an ASCIZ string */
|
---|
62 | #define EBN_COMMAND_LINE 0x00000004
|
---|
63 | /* This specifies a command line that can be set by user interaction,
|
---|
64 | * and is provided as a free form ASCIZ string to the loaded image.
|
---|
65 | */
|
---|
66 | #define EBN_NOP 0x00000005
|
---|
67 | /* A note nop note has no meaning, useful for inserting explicit padding */
|
---|
68 | #define EBN_LOADED_IMAGE 0x00000006
|
---|
69 | /* An ASCIZ string naming the loaded image */
|
---|
70 |
|
---|
71 |
|
---|
72 | /* Etherboot specific notes */
|
---|
73 | #define EB_PARAM_NOTE "Etherboot"
|
---|
74 | #define EB_IA64_SYSTAB 0x00000001
|
---|
75 | #define EB_IA64_MEMMAP 0x00000002
|
---|
76 | #define EB_IA64_FPSWA 0x00000003
|
---|
77 | #define EB_IA64_CONINFO 0x00000004
|
---|
78 | #define EB_BOOTP_DATA 0x00000005
|
---|
79 | #define EB_HEADER 0x00000006
|
---|
80 | #define EB_IA64_IMAGE_HANDLE 0x00000007
|
---|
81 | #define EB_I386_MEMMAP 0x00000008
|
---|
82 |
|
---|
83 |
|
---|
84 | #endif /* ELF_BOOT_H */
|
---|