These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / seabios / src / util.h
1 // Misc function and variable declarations.
2 #ifndef __UTIL_H
3 #define __UTIL_H
4
5 #include "types.h" // u32
6
7 // apm.c
8 void apm_shutdown(void);
9 struct bregs;
10 void handle_1553(struct bregs *regs);
11
12 // bmp.c
13 struct bmp_decdata *bmp_alloc(void);
14 int bmp_decode(struct bmp_decdata *bmp, unsigned char *data, int data_size);
15 void bmp_get_size(struct bmp_decdata *bmp, int *width, int *height);
16 int bmp_show(struct bmp_decdata *bmp, unsigned char *pic, int width
17              , int height, int depth, int bytes_per_line_dest);
18
19 // boot.c
20 void boot_init(void);
21 void boot_add_bev(u16 seg, u16 bev, u16 desc, int prio);
22 void boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio);
23 struct drive_s;
24 void boot_add_floppy(struct drive_s *drive_g, const char *desc, int prio);
25 void boot_add_hd(struct drive_s *drive_g, const char *desc, int prio);
26 void boot_add_cd(struct drive_s *drive_g, const char *desc, int prio);
27 void boot_add_cbfs(void *data, const char *desc, int prio);
28 void interactive_bootmenu(void);
29 void bcv_prepboot(void);
30 struct pci_device;
31 int bootprio_find_pci_device(struct pci_device *pci);
32 int bootprio_find_scsi_device(struct pci_device *pci, int target, int lun);
33 int bootprio_find_ata_device(struct pci_device *pci, int chanid, int slave);
34 int bootprio_find_fdc_device(struct pci_device *pci, int port, int fdid);
35 int bootprio_find_pci_rom(struct pci_device *pci, int instance);
36 int bootprio_find_named_rom(const char *name, int instance);
37 struct usbdevice_s;
38 int bootprio_find_usb(struct usbdevice_s *usbdev, int lun);
39
40 // bootsplash.c
41 void enable_vga_console(void);
42 void enable_bootsplash(void);
43 void disable_bootsplash(void);
44
45 // cdrom.c
46 extern struct eltorito_s CDEmu;
47 extern struct drive_s *cdemu_drive_gf;
48 struct disk_op_s;
49 int cdemu_process_op(struct disk_op_s *op);
50 void cdrom_prepboot(void);
51 int cdrom_boot(struct drive_s *drive_g);
52
53 // clock.c
54 void clock_setup(void);
55 void handle_1583(struct bregs *regs);
56 void clock_poll_irq(void);
57 u32 irqtimer_calc_ticks(u32 count);
58 u32 irqtimer_calc(u32 msecs);
59 int irqtimer_check(u32 end);
60 void handle_1586(struct bregs *regs);
61
62 // fw/acpi.c
63 void acpi_setup(void);
64
65 // fw/biostable.c
66 void copy_pir(void *pos);
67 void copy_mptable(void *pos);
68 extern struct pir_header *PirAddr;
69 void copy_acpi_rsdp(void *pos);
70 extern struct rsdp_descriptor *RsdpAddr;
71 extern u32 acpi_pm1a_cnt;
72 extern u16 acpi_pm_base;
73 void *find_acpi_rsdp(void);
74 u32 find_resume_vector(void);
75 void acpi_reboot(void);
76 void find_acpi_features(void);
77 extern struct smbios_entry_point *SMBiosAddr;
78 struct smbios_entry_point *get_smbios_entry_point();
79 void copy_smbios(void *pos);
80 void display_uuid(void);
81 void copy_table(void *pos);
82 void smbios_setup(void);
83
84 // fw/coreboot.c
85 extern const char *CBvendor, *CBpart;
86 struct cbfs_file;
87 void coreboot_debug_putc(char c);
88 void cbfs_run_payload(struct cbfs_file *file);
89 void coreboot_platform_setup(void);
90 void cbfs_payload_setup(void);
91 void coreboot_preinit(void);
92 void coreboot_cbfs_init(void);
93 struct cb_header;
94 void *find_cb_subtable(struct cb_header *cbh, u32 tag);
95 struct cb_header *find_cb_table(void);
96
97 // fw/csm.c
98 int csm_bootprio_fdc(struct pci_device *pci, int port, int fdid);
99 int csm_bootprio_ata(struct pci_device *pci, int chanid, int slave);
100 int csm_bootprio_pci(struct pci_device *pci);
101
102 // fw/mptable.c
103 void mptable_setup(void);
104
105 // fw/mtrr.c
106 void mtrr_setup(void);
107
108 // fw/multiboot.c
109 void multiboot_init(void);
110
111 // fw/pciinit.c
112 extern const u8 pci_irqs[4];
113 void pci_setup(void);
114 void pci_resume(void);
115
116 // fw/pirtable.c
117 void pirtable_setup(void);
118
119 // fw/shadow.c
120 void make_bios_writable(void);
121 void make_bios_readonly(void);
122 void qemu_prep_reset(void);
123
124 // fw/smbios.c
125 void smbios_legacy_setup(void);
126
127 // fw/smm.c
128 void smm_device_setup(void);
129 void smm_setup(void);
130
131 // fw/smp.c
132 extern u32 MaxCountCPUs;
133 void wrmsr_smp(u32 index, u64 val);
134 void smp_setup(void);
135 int apic_id_is_present(u8 apic_id);
136
137 // hw/dma.c
138 int dma_floppy(u32 addr, int count, int isWrite);
139 void dma_setup(void);
140
141 // hw/floppy.c
142 extern struct floppy_ext_dbt_s diskette_param_table2;
143 void floppy_setup(void);
144 struct drive_s *init_floppy(int floppyid, int ftype);
145 int find_floppy_type(u32 size);
146 int floppy_process_op(struct disk_op_s *op);
147 void floppy_tick(void);
148
149 // hw/ramdisk.c
150 void ramdisk_setup(void);
151 int ramdisk_process_op(struct disk_op_s *op);
152
153 // hw/sdcard.c
154 int sdcard_process_op(struct disk_op_s *op);
155 void sdcard_setup(void);
156
157 // hw/timer.c
158 void timer_setup(void);
159 void pmtimer_setup(u16 ioport);
160 u32 timer_calc(u32 msecs);
161 u32 timer_calc_usec(u32 usecs);
162 int timer_check(u32 end);
163 void ndelay(u32 count);
164 void udelay(u32 count);
165 void mdelay(u32 count);
166 void nsleep(u32 count);
167 void usleep(u32 count);
168 void msleep(u32 count);
169 u32 ticks_to_ms(u32 ticks);
170 u32 ticks_from_ms(u32 ms);
171 void pit_setup(void);
172
173 // jpeg.c
174 struct jpeg_decdata *jpeg_alloc(void);
175 int jpeg_decode(struct jpeg_decdata *jpeg, unsigned char *buf);
176 void jpeg_get_size(struct jpeg_decdata *jpeg, int *width, int *height);
177 int jpeg_show(struct jpeg_decdata *jpeg, unsigned char *pic, int width
178               , int height, int depth, int bytes_per_line_dest);
179
180 // kbd.c
181 void kbd_init(void);
182 void handle_15c2(struct bregs *regs);
183 void process_key(u8 key);
184
185 // misc.c
186 extern struct bios_config_table_s BIOS_CONFIG_TABLE __aligned(1);
187 extern struct floppy_dbt_s diskette_param_table __aligned(1);
188 extern u8 BiosChecksum;
189 int in_post(void);
190 void mathcp_setup(void);
191
192 // mouse.c
193 void mouse_init(void);
194 void process_mouse(u8 data);
195
196 // optionroms.c
197 struct rom_header;
198 void callrom(struct rom_header *rom, u16 bdf);
199 void call_bcv(u16 seg, u16 ip);
200 int is_pci_vga(struct pci_device *pci);
201 void optionrom_setup(void);
202 void vgarom_setup(void);
203 void s3_resume_vga(void);
204 extern int ScreenAndDebug;
205
206 // pcibios.c
207 void handle_1ab1(struct bregs *regs);
208 void bios32_init(void);
209
210 // pmm.c
211 void pmm_init(void);
212 void pmm_prepboot(void);
213
214 // pnpbios.c
215 u16 get_pnp_offset(void);
216 void pnp_init(void);
217
218 // post.c
219 void interface_init(void);
220 void device_hardware_setup(void);
221 void prepareboot(void);
222 void startBoot(void);
223 void reloc_preinit(void *f, void *arg);
224
225 // resume.c
226 extern int HaveRunPost;
227
228 // serial.c
229 void serial_setup(void);
230 void lpt_setup(void);
231
232 // vgahooks.c
233 void handle_155f(struct bregs *regs);
234 void handle_157f(struct bregs *regs);
235 void vgahook_setup(struct pci_device *pci);
236
237
238 // version (auto generated file out/version.c)
239 extern const char VERSION[], BUILDINFO[];
240
241 #endif // util.h