Rename the apm, pcibios, and elf entry points.
[seabios.git] / src / util.h
index fa7b20f342687235e46a4974546b6a9cd52813c7..4319f63d2c50b925db626c8ffcb76b62dd433711 100644 (file)
@@ -61,6 +61,15 @@ static inline void cpuid(u32 index, u32 *eax, u32 *ebx, u32 *ecx, u32 *edx)
         : "0" (index));
 }
 
+static inline u32 getcr0(void) {
+    u32 cr0;
+    asm("movl %%cr0, %0" : "=r"(cr0));
+    return cr0;
+}
+static inline void setcr0(u32 cr0) {
+    asm("movl %0, %%cr0" : : "r"(cr0));
+}
+
 static inline u64 rdmsr(u32 index)
 {
     u64 ret;
@@ -209,6 +218,8 @@ void *memcpy(void *d1, const void *s1, size_t len);
 void iomemcpy(void *d, const void *s, u32 len);
 void *memmove(void *d, const void *s, size_t len);
 char *strtcpy(char *dest, const char *src, size_t len);
+char *strchr(const char *s, int c);
+void nullTrailingSpace(char *buf);
 int get_keystroke(int msec);
 
 // stacks.c
@@ -236,6 +247,8 @@ void printf(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2)));
 int snprintf(char *str, size_t size, const char *fmt, ...)
     __attribute__ ((format (printf, 3, 4)));
+char * znprintf(size_t size, const char *fmt, ...)
+    __attribute__ ((format (printf, 2, 3)));
 void __dprintf(const char *fmt, ...)
     __attribute__ ((format (printf, 1, 2)));
 void __debug_enter(struct bregs *regs, const char *fname);
@@ -338,14 +351,8 @@ void bios32_setup(void);
 // shadow.c
 void make_bios_writable(void);
 void make_bios_readonly(void);
-void make_bios_writable_intel(u16 bdf, u32 pam0);
-void make_bios_readonly_intel(u16 bdf, u32 pam0);
 void qemu_prep_reset(void);
 
-// smm.c
-void smm_save_and_copy(void);
-void smm_relocate_and_restore(void);
-
 // pci_region.c
 // region allocator. pci region allocates the requested region
 // sequentially with overflow check.
@@ -377,7 +384,6 @@ u32 pci_region_size(const struct pci_region *r);
 
 // pciinit.c
 extern const u8 pci_irqs[4];
-void pci_bios_allocate_regions(u16 bdf, void *arg);
 void pci_setup(void);
 
 // smm.c
@@ -390,6 +396,7 @@ void wrmsr_smp(u32 index, u64 val);
 void smp_probe(void);
 
 // coreboot.c
+extern const char *CBvendor, *CBpart;
 struct cbfs_file;
 struct cbfs_file *cbfs_finddatafile(const char *fname);
 struct cbfs_file *cbfs_findprefix(const char *prefix, struct cbfs_file *last);
@@ -398,12 +405,19 @@ const char *cbfs_filename(struct cbfs_file *file);
 int cbfs_copyfile(struct cbfs_file *file, void *dst, u32 maxlen);
 void cbfs_run_payload(struct cbfs_file *file);
 void coreboot_copy_biostable(void);
+void cbfs_payload_setup(void);
 void coreboot_setup(void);
 
+// biostable.c
+void copy_pir(void *pos);
+void copy_mptable(void *pos);
+void copy_acpi_rsdp(void *pos);
+void copy_smbios(void *pos);
+
 // vgahooks.c
-extern int VGAbdf;
 void handle_155f(struct bregs *regs);
-void vgahook_setup(const char *vendor, const char *part);
+struct pci_device;
+void vgahook_setup(struct pci_device *pci);
 
 // optionroms.c
 void call_bcv(u16 seg, u16 ip);
@@ -411,6 +425,7 @@ void optionrom_setup(void);
 void vga_setup(void);
 void s3_resume_vga_init(void);
 extern u32 RomEnd;
+extern int ScreenAndDebug;
 
 // bootsplash.c
 void enable_vga_console(void);
@@ -418,6 +433,7 @@ void enable_bootsplash(void);
 void disable_bootsplash(void);
 
 // resume.c
+extern int HaveRunPost;
 void init_dma(void);
 
 // pnpbios.c