summaryrefslogtreecommitdiffstats
path: root/kexec/arch/i386/kexec-x86.h
blob: 46e2898144eeb45652e52ae9e0ba2a7c05727583 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef KEXEC_X86_H
#define KEXEC_X86_H

#define MAX_MEMORY_RANGES 2048

enum coretype {
	CORE_TYPE_UNDEF = 0,
	CORE_TYPE_ELF32 = 1,
	CORE_TYPE_ELF64 = 2
};

extern unsigned char compat_x86_64[];
extern uint32_t compat_x86_64_size, compat_x86_64_entry32;

struct entry32_regs {
	uint32_t eax;
	uint32_t ebx;
	uint32_t ecx;
	uint32_t edx;
	uint32_t esi;
	uint32_t edi;
	uint32_t esp;
	uint32_t ebp;
	uint32_t eip;
};

struct entry16_regs {
	uint32_t eax;
	uint32_t ebx;
	uint32_t ecx;
	uint32_t edx;
	uint32_t esi;
	uint32_t edi;
	uint32_t esp;
	uint32_t ebp;
	uint16_t ds;
	uint16_t es;
	uint16_t ss;
	uint16_t fs;
	uint16_t gs;
	uint16_t ip;
	uint16_t cs;
	uint16_t pad;
};

struct arch_options_t {
	uint8_t  	reset_vga;
	uint16_t 	serial_base;
	uint32_t 	serial_baud;
	uint8_t  	console_vga;
	uint8_t  	console_serial;
	enum coretype	core_header_type;
	uint8_t  	pass_memmap_cmdline;
	uint8_t		noefi;
	uint8_t		reuse_video_type;
};

int multiboot_x86_probe(const char *buf, off_t len);
int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
	struct kexec_info *info);
void multiboot_x86_usage(void);

int multiboot2_x86_load(int argc, char **argv, const char *buf, off_t len,
			struct kexec_info *info);
void multiboot2_x86_usage(void);
int multiboot2_x86_probe(const char *buf, off_t buf_len);

int elf_x86_probe(const char *buf, off_t len);
int elf_x86_any_probe(const char *buf, off_t len, enum coretype arch);
int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
	struct kexec_info *info);
void elf_x86_usage(void);

int bzImage_probe(const char *buf, off_t len);
int bzImage_load(int argc, char **argv, const char *buf, off_t len, 
	struct kexec_info *info);
void bzImage_usage(void);
int do_bzImage_load(struct kexec_info *info,
	const char *kernel, off_t kernel_len,
	const char *command_line, off_t command_line_len,
	const char *initrd, off_t initrd_len,
	const char *dtb, off_t dtb_len,
	int real_mode_entry);

int beoboot_probe(const char *buf, off_t len);
int beoboot_load(int argc, char **argv, const char *buf, off_t len,
	struct kexec_info *info);
void beoboot_usage(void);

int nbi_probe(const char *buf, off_t len);
int nbi_load(int argc, char **argv, const char *buf, off_t len,
	struct kexec_info *info);
void nbi_usage(void);

extern unsigned xen_e820_to_kexec_type(uint32_t type);
extern uint64_t get_acpi_rsdp(void);
#endif /* KEXEC_X86_H */