]> xenbits.xensource.com Git - seabios.git/commitdiff
Merge bmp.h, boot.h, jpeg.h, and post.h into util.h.
authorKevin O'Connor <kevin@koconnor.net>
Sun, 15 Sep 2013 04:31:17 +0000 (00:31 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 19 Sep 2013 00:48:35 +0000 (20:48 -0400)
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
25 files changed:
src/bmp.c
src/bmp.h [deleted file]
src/boot.c
src/boot.h [deleted file]
src/bootsplash.c
src/fw/coreboot.c
src/fw/csm.c
src/hw/ahci.c
src/hw/ata.c
src/hw/blockcmd.c
src/hw/esp-scsi.c
src/hw/floppy.c
src/hw/lsi-scsi.c
src/hw/megasas.c
src/hw/ramdisk.c
src/hw/usb-msc.c
src/hw/usb-uas.c
src/hw/virtio-blk.c
src/hw/virtio-scsi.c
src/jpeg.c
src/jpeg.h [deleted file]
src/optionroms.c
src/post.c
src/post.h [deleted file]
src/util.h

index 68952f60d0195b013359162bdc655a000bf2a27c..d8e76b78959aebf1c11548e8de3fffa9a822f03b 100644 (file)
--- a/src/bmp.c
+++ b/src/bmp.c
@@ -6,9 +6,17 @@
 *
 * This work is licensed under the terms of the GNU LGPLv3.
 */
-#include "bmp.h" // struct bmp_decdata
 #include "malloc.h" // malloc_tmphigh
 #include "string.h" // memcpy
+#include "util.h" // struct bmp_decdata
+
+struct bmp_decdata {
+    struct tagRGBQUAD *quadp;
+    unsigned char *datap;
+    int width;
+    int height;
+    int bpp;
+};
 
 #define bmp_load4byte(addr) (*(u32 *)(addr))
 #define bmp_load2byte(addr) (*(u16 *)(addr))
@@ -59,12 +67,14 @@ static void raw_data_format_adjust_24bpp(u8 *src, u8 *dest, int width,
     }
 }
 
+/* allocate decdata struct */
 struct bmp_decdata *bmp_alloc(void)
 {
     struct bmp_decdata *bmp = malloc_tmphigh(sizeof(*bmp));
     return bmp;
 }
 
+/* extract information from bmp file data */
 int bmp_decode(struct bmp_decdata *bmp, unsigned char *data, int data_size)
 {
     if (data_size < 54)
@@ -84,13 +94,14 @@ int bmp_decode(struct bmp_decdata *bmp, unsigned char *data, int data_size)
     return 0;
 }
 
+/* get bmp properties */
 void bmp_get_size(struct bmp_decdata *bmp, int *width, int *height)
 {
     *width = bmp->width;
     *height = bmp->height;
 }
 
-
+/* flush flat picture data to *pc */
 int bmp_show(struct bmp_decdata *bmp, unsigned char *pic, int width
              , int height, int depth, int bytes_per_line_dest)
 {
diff --git a/src/bmp.h b/src/bmp.h
deleted file mode 100644 (file)
index 7ae8e87..0000000
--- a/src/bmp.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef BMP_H
-#define BMP_H
-#include "types.h"
-
-struct bmp_decdata {
-    struct tagRGBQUAD *quadp;
-    unsigned char *datap;
-    int width;
-    int height;
-    int bpp;
-};
-
-/* allocate decdata struct */
-struct bmp_decdata *bmp_alloc(void);
-
-/* extract information from bmp file data */
-int bmp_decode(struct bmp_decdata *bmp, unsigned char *data, int data_size);
-
-/* get bmp properties */
-void bmp_get_size(struct bmp_decdata *bmp, int *width, int *height);
-
-/* flush flat picture data to *pc */
-int bmp_show(struct bmp_decdata *bmp, unsigned char *pic, int width
-             , int height, int depth, int bytes_per_line_dest);
-#endif
index 70888e264b907c9941a514708210ba8950a26601..a2851b25687190526cb6231955b80de4750940cb 100644 (file)
@@ -5,7 +5,6 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "boot.h" // boot_init
 #include "block.h" // struct drive_s
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
diff --git a/src/boot.h b/src/boot.h
deleted file mode 100644 (file)
index e6b81bd..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// Storage for boot definitions.
-#ifndef __BOOT_H
-#define __BOOT_H
-
-#include "types.h" // u16
-
-// boot.c
-void boot_init(void);
-void boot_add_bev(u16 seg, u16 bev, u16 desc, int prio);
-void boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio);
-struct drive_s;
-void boot_add_floppy(struct drive_s *drive_g, const char *desc, int prio);
-void boot_add_hd(struct drive_s *drive_g, const char *desc, int prio);
-void boot_add_cd(struct drive_s *drive_g, const char *desc, int prio);
-void boot_add_cbfs(void *data, const char *desc, int prio);
-void interactive_bootmenu(void);
-void bcv_prepboot(void);
-struct pci_device;
-int bootprio_find_pci_device(struct pci_device *pci);
-int bootprio_find_scsi_device(struct pci_device *pci, int target, int lun);
-int bootprio_find_ata_device(struct pci_device *pci, int chanid, int slave);
-int bootprio_find_fdc_device(struct pci_device *pci, int port, int fdid);
-int bootprio_find_pci_rom(struct pci_device *pci, int instance);
-int bootprio_find_named_rom(const char *name, int instance);
-struct usbdevice_s;
-int bootprio_find_usb(struct usbdevice_s *usbdev, int lun);
-
-#endif // __BOOT_H
index aac7ebe4701bcc4881638ca3f2556b8825f075cf..fb505ceb956c6bf21ee0e14ef82b80326bda2467 100644 (file)
@@ -5,11 +5,9 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "bmp.h" // bmp_alloc
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
 #include "farptr.h" // FLATPTR_TO_SEG
-#include "jpeg.h" // jpeg_alloc
 #include "malloc.h" // free
 #include "output.h" // dprintf
 #include "romfile.h" // romfile_loadfile
index 7d877eb275c96fc0ddecff8dfcaabf27c48e3968..a234e97f68de92cb79e2f74bf07255fa78cc6594 100644 (file)
@@ -5,7 +5,6 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "block.h" // MAXDESCSIZE
-#include "boot.h" // boot_add_cbfs
 #include "byteorder.h" // be32_to_cpu
 #include "config.h" // CONFIG_*
 #include "hw/pci.h" // pci_probe_devices
index d241b17538cacb9b07c4987704c4c7871d1865ed..cd16641b3284611176b78b4ad3040f6e0914edc6 100644 (file)
@@ -4,7 +4,6 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "boot.h"
 #include "bregs.h"
 #include "config.h" // CONFIG_*
 #include "farptr.h" // MAKE_FLATPTR
@@ -13,7 +12,6 @@
 #include "malloc.h" // csm_malloc_preinit
 #include "memmap.h"
 #include "output.h" // dprintf
-#include "post.h"
 #include "stacks.h" // wait_threads
 #include "std/acpi.h" // RSDP_SIGNATURE
 #include "std/bda.h" // struct bios_data_area_s
index 719d07398f8b96b14b8c9fc87fd8817df8acb2e1..05a80b3774e5e3f7a4da0515a5f6897668e8ef77 100644 (file)
@@ -8,7 +8,6 @@
 #include "ata.h" // ATA_CB_STAT
 #include "biosvar.h" // GET_GLOBAL
 #include "blockcmd.h" // CDB_CMD_READ_10
-#include "boot.h" // add_bcv_hd
 #include "ioport.h" // inb
 #include "malloc.h" // free
 #include "output.h" // dprintf
index 4ea6cd1972822bb1a93819cad8db99748e7193aa..34ba119d7d1ce67bad8b4db3b53a97bf6b23b896 100644 (file)
@@ -9,7 +9,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct drive_s
 #include "blockcmd.h" // CDB_CMD_READ_10
-#include "boot.h" // boot_add_hd
 #include "byteorder.h" // be16_to_cpu
 #include "cmos.h" // inb_cmos
 #include "ioport.h" // inb
index b9e61cd5d5c8a93fa1dad70b62b86c024d491363..7bdcf3863ed0d7d810310e2114bcfc785067765f 100644 (file)
@@ -10,7 +10,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct disk_op_s
 #include "blockcmd.h" // struct cdb_request_sense
-#include "boot.h" // boot_add_hd
 #include "byteorder.h" // be32_to_cpu
 #include "esp-scsi.h" // esp_scsi_cmd_data
 #include "lsi-scsi.h" // lsi_scsi_cmd_data
index e6533af405e4922decdef9f3d135d96804de72a6..118a1f525bdd4a144b40077c6b70fe73318ecd34 100644 (file)
@@ -13,7 +13,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct drive_s
 #include "blockcmd.h" // scsi_drive_setup
-#include "boot.h" // bootprio_find_scsi_device
 #include "config.h" // CONFIG_*
 #include "fw/paravirt.h" // runningOnQEMU
 #include "malloc.h" // free
index 05c518f0db5990cff8d962ad97f0a17164457272..39efaadc8472436a014703f2c59e54e8ebd0cc1d 100644 (file)
@@ -7,7 +7,6 @@
 
 #include "biosvar.h" // SET_BDA
 #include "block.h" // struct drive_s
-#include "boot.h" // boot_add_floppy
 #include "bregs.h" // struct bregs
 #include "cmos.h" // inb_cmos
 #include "config.h" // CONFIG_FLOPPY
index b7eb1f12843039c9ced8852083213296f68b1d03..021aa61f9cb9a26fddfec77d9c28d242012aa3b0 100644 (file)
@@ -13,7 +13,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct drive_s
 #include "blockcmd.h" // scsi_drive_setup
-#include "boot.h" // bootprio_find_scsi_device
 #include "config.h" // CONFIG_*
 #include "fw/paravirt.h" // runningOnQEMU
 #include "malloc.h" // free
index 772fc755f33fa1cf3e4d358e0af4745ec2980864..ebc49f92ae7ed1aecf47d8a3ca19660a0355607a 100644 (file)
@@ -13,7 +13,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct drive_s
 #include "blockcmd.h" // scsi_drive_setup
-#include "boot.h" // bootprio_find_scsi_device
 #include "config.h" // CONFIG_*
 #include "malloc.h" // free
 #include "output.h" // dprintf
index f57affd40a2a06e81ecc16a7dd9f021a4d2fe347..eeddf2562892c7c3fa4202f4b8b1d334ab1bad14 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct drive_s
-#include "boot.h" // boot_add_floppy
 #include "bregs.h" // struct bregs
 #include "malloc.h" // malloc_fseg
 #include "memmap.h" // add_e820
index 975ec7a9ce820034af7b73c804f3f60148ac68b8..8ee448f03484a877b4da1b125980222f82844d86 100644 (file)
@@ -7,7 +7,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // DTYPE_USB
 #include "blockcmd.h" // cdb_read
-#include "boot.h" // bootprio_find_usb
 #include "config.h" // CONFIG_USB_MSC
 #include "malloc.h" // free
 #include "output.h" // dprintf
@@ -15,6 +14,7 @@
 #include "string.h" // memset
 #include "usb.h" // struct usb_s
 #include "usb-msc.h" // usb_msc_setup
+#include "util.h" // bootprio_find_usb
 
 struct usbdrive_s {
     struct drive_s drive;
index 9f4b558b2b540c33f3c73703d845b76fb2e86df0..1a9773ae01a601e3ab9e358e7858ebec00995e15 100644 (file)
@@ -17,7 +17,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // DTYPE_USB
 #include "blockcmd.h" // cdb_read
-#include "boot.h" // bootprio_find_usb
 #include "config.h" // CONFIG_USB_UAS
 #include "malloc.h" // free
 #include "output.h" // dprintf
@@ -25,6 +24,7 @@
 #include "string.h" // memset
 #include "usb.h" // struct usb_s
 #include "usb-uas.h" // usb_uas_init
+#include "util.h" // bootprio_find_usb
 
 #define UAS_UI_COMMAND              0x01
 #define UAS_UI_SENSE                0x03
index c48ea45352278bed7850e50351aca39bf36eca32..0de83b49451512ca68d1cd7aa41ad0f979c49fb0 100644 (file)
@@ -8,7 +8,6 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "biosvar.h" // GET_GLOBAL
-#include "boot.h" // boot_add_hd
 #include "config.h" // CONFIG_*
 #include "block.h" // struct drive_s
 #include "malloc.h" // free
index f50e335646deb74a9cdc9b1e5cb0d278bb607446..7cde3bcb405f3d533f5defdf03be8bbd6309f068 100644 (file)
@@ -10,7 +10,6 @@
 #include "biosvar.h" // GET_GLOBAL
 #include "block.h" // struct drive_s
 #include "blockcmd.h" // scsi_drive_setup
-#include "boot.h" // bootprio_find_scsi_device
 #include "config.h" // CONFIG_*
 #include "malloc.h" // free
 #include "output.h" // dprintf
index 925aa3d01550c865b72cdae1a8d13eae05d1baf5..c2138edabe8a0b2002f6620b45a3ed426e6c624f 100644 (file)
@@ -41,8 +41,8 @@
 
 #define __LITTLE_ENDIAN
 #include "malloc.h"
-#include "jpeg.h"
 #include "string.h"
+#include "util.h"
 #define ISHIFT 11
 
 #define IFIX(a) ((int)((a) * (1 << ISHIFT) + .5))
diff --git a/src/jpeg.h b/src/jpeg.h
deleted file mode 100644 (file)
index 2d08f45..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef __JPEG_H
-#define __JPEG_H
-
-struct jpeg_decdata;
-struct jpeg_decdata *jpeg_alloc(void);
-int jpeg_decode(struct jpeg_decdata *jpeg, unsigned char *buf);
-void jpeg_get_size(struct jpeg_decdata *jpeg, int *width, int *height);
-int jpeg_show(struct jpeg_decdata *jpeg, unsigned char *pic, int width
-              , int height, int depth, int bytes_per_line_dest);
-
-#endif
index 04afb2c7d1fb4a104ec438a5f531ec0d3e193d48..d7c8aefdcfa0af1502c4f3772612a9d753c0274e 100644 (file)
@@ -5,7 +5,6 @@
 //
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
-#include "boot.h" // IPL
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
 #include "farptr.h" // FLATPTR_TO_SEG
index 512c716d0141fcda4cab4f0f6c88b970064760ad..592176d01600bd0ea15ba3201a71fd364a13b0ea 100644 (file)
@@ -6,7 +6,6 @@
 // This file may be distributed under the terms of the GNU LGPLv3 license.
 
 #include "biosvar.h" // SET_BDA
-#include "boot.h" // boot_init
 #include "bregs.h" // struct bregs
 #include "config.h" // CONFIG_*
 #include "fw/paravirt.h" // qemu_cfg_preinit
@@ -25,7 +24,6 @@
 #include "malloc.h" // malloc_init
 #include "memmap.h" // add_e820
 #include "output.h" // dprintf
-#include "post.h" // interface_init
 #include "string.h" // memset
 #include "util.h" // kbd_init
 
diff --git a/src/post.h b/src/post.h
deleted file mode 100644 (file)
index 5536eb9..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __POST_H
-#define __POST_H
-
-void interface_init(void);
-void device_hardware_setup(void);
-void prepareboot(void);
-void startBoot(void);
-void reloc_preinit(void *f, void *arg);
-
-#endif // __POST_H
index 32a4af4ddb71d21ea6f6dd27ca9455f7cc944dc4..79a2e7f2b29125e3e49a4174e33097a707f8ed1a 100644 (file)
@@ -69,6 +69,40 @@ int irqtimer_check(u32 end);
 void apm_shutdown(void);
 void handle_1553(struct bregs *regs);
 
+// bmp.c
+struct bmp_decdata *bmp_alloc(void);
+int bmp_decode(struct bmp_decdata *bmp, unsigned char *data, int data_size);
+void bmp_get_size(struct bmp_decdata *bmp, int *width, int *height);
+int bmp_show(struct bmp_decdata *bmp, unsigned char *pic, int width
+             , int height, int depth, int bytes_per_line_dest);
+
+// boot.c
+void boot_init(void);
+void boot_add_bev(u16 seg, u16 bev, u16 desc, int prio);
+void boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio);
+void boot_add_floppy(struct drive_s *drive_g, const char *desc, int prio);
+void boot_add_hd(struct drive_s *drive_g, const char *desc, int prio);
+void boot_add_cd(struct drive_s *drive_g, const char *desc, int prio);
+void boot_add_cbfs(void *data, const char *desc, int prio);
+void interactive_bootmenu(void);
+void bcv_prepboot(void);
+struct pci_device;
+int bootprio_find_pci_device(struct pci_device *pci);
+int bootprio_find_scsi_device(struct pci_device *pci, int target, int lun);
+int bootprio_find_ata_device(struct pci_device *pci, int chanid, int slave);
+int bootprio_find_fdc_device(struct pci_device *pci, int port, int fdid);
+int bootprio_find_pci_rom(struct pci_device *pci, int instance);
+int bootprio_find_named_rom(const char *name, int instance);
+struct usbdevice_s;
+int bootprio_find_usb(struct usbdevice_s *usbdev, int lun);
+
+// jpeg.c
+struct jpeg_decdata *jpeg_alloc(void);
+int jpeg_decode(struct jpeg_decdata *jpeg, unsigned char *buf);
+void jpeg_get_size(struct jpeg_decdata *jpeg, int *width, int *height);
+int jpeg_show(struct jpeg_decdata *jpeg, unsigned char *pic, int width
+              , int height, int depth, int bytes_per_line_dest);
+
 // optionroms.c
 struct rom_header;
 void callrom(struct rom_header *rom, u16 bdf);
@@ -77,6 +111,13 @@ void callrom(struct rom_header *rom, u16 bdf);
 void handle_1ab1(struct bregs *regs);
 void bios32_init(void);
 
+// post.c
+void interface_init(void);
+void device_hardware_setup(void);
+void prepareboot(void);
+void startBoot(void);
+void reloc_preinit(void *f, void *arg);
+
 // fw/acpi.c
 extern struct rsdp_descriptor *RsdpAddr;
 extern u32 acpi_pm1a_cnt;
@@ -88,7 +129,6 @@ void acpi_set_reset_reg(struct acpi_20_generic_address *reg, u8 val);
 void acpi_reboot(void);
 
 // fw/csm.c
-struct pci_device;
 int csm_bootprio_fdc(struct pci_device *pci, int port, int fdid);
 int csm_bootprio_ata(struct pci_device *pci, int chanid, int slave);
 int csm_bootprio_pci(struct pci_device *pci);