aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--com32/include/syslinux/firmware.h1
-rw-r--r--core/fs/diskio.c2
-rw-r--r--core/fs/diskio_bios.c9
-rw-r--r--core/fs/fs.c2
-rw-r--r--core/include/core.h6
-rw-r--r--core/include/disk.h16
-rw-r--r--core/include/fs.h2
-rw-r--r--efi/diskio.c8
-rw-r--r--efi/efi.h6
-rw-r--r--efi/main.c4
-rw-r--r--mk/lib.mk11
11 files changed, 24 insertions, 43 deletions
diff --git a/com32/include/syslinux/firmware.h b/com32/include/syslinux/firmware.h
index c2b5a44c..13ba1591 100644
--- a/com32/include/syslinux/firmware.h
+++ b/com32/include/syslinux/firmware.h
@@ -45,7 +45,6 @@ struct mem_ops {
int (*scan_memory)(scan_memory_callback_t, void *);
};
-struct disk_private;
struct initramfs;
struct setup_data;
diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index 9e1f63fd..afe4e58c 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -22,7 +22,7 @@ void getoneblk(struct disk *disk, char *buf, block_t block, int block_size)
*
* NOTE: the disk cache needs to be revamped to support multiple devices...
*/
-struct device * device_init(struct disk_private *args)
+struct device * device_init(void *args)
{
static struct device dev;
static __hugebss char diskcache[128*1024];
diff --git a/core/fs/diskio_bios.c b/core/fs/diskio_bios.c
index 52d20172..9b935fe2 100644
--- a/core/fs/diskio_bios.c
+++ b/core/fs/diskio_bios.c
@@ -285,9 +285,10 @@ static int edd_rdwr_sectors(struct disk *disk, void *buf,
return done;
}
-struct disk *bios_disk_init(struct disk_private *priv)
+struct disk *bios_disk_init(void *private)
{
static struct disk disk;
+ struct bios_disk_private *priv = (struct bios_disk_private *)private;
com32sys_t *regs = priv->regs;
static __lowmem struct edd_disk_params edd_params;
com32sys_t ireg, oreg;
@@ -385,14 +386,14 @@ struct disk *bios_disk_init(struct disk_private *priv)
devno, cdrom, ebios, sector_size, disk.sector_shift,
part_start, disk.maxtransfer);
- disk.private = priv;
+ disk.private = private;
return &disk;
}
void pm_fs_init(com32sys_t *regs)
{
- static struct disk_private priv;
+ static struct bios_disk_private priv;
priv.regs = regs;
- fs_init((const struct fs_ops **)regs->eax.l, &priv);
+ fs_init((const struct fs_ops **)regs->eax.l, (void *)&priv);
}
diff --git a/core/fs/fs.c b/core/fs/fs.c
index 997eadba..21e7684a 100644
--- a/core/fs/fs.c
+++ b/core/fs/fs.c
@@ -447,7 +447,7 @@ void pm_close_file(com32sys_t *regs)
*/
__bss16 uint16_t SectorSize, SectorShift;
-void fs_init(const struct fs_ops **ops, struct disk_private *priv)
+void fs_init(const struct fs_ops **ops, void *priv)
{
static struct fs_info fs; /* The actual filesystem buffer */
int blk_shift = -1;
diff --git a/core/include/core.h b/core/include/core.h
index b5dac885..aa3bfb7a 100644
--- a/core/include/core.h
+++ b/core/include/core.h
@@ -11,12 +11,6 @@
#include <com32.h>
#include <errno.h>
#include <syslinux/pmapi.h>
-#ifdef SYSLINUX_EFI
-#include <efi.h>
-#include <efilib.h>
-#undef DEBUG
-#include <efistdarg.h>
-#endif
extern char core_xfer_buf[65536];
extern char core_cache_buf[65536];
diff --git a/core/include/disk.h b/core/include/disk.h
index 2aec11ce..0a19e8a1 100644
--- a/core/include/disk.h
+++ b/core/include/disk.h
@@ -9,24 +9,16 @@
typedef uint64_t sector_t;
typedef uint64_t block_t;
-#ifdef SYSLINUX_EFI
-struct disk_private {
- EFI_HANDLE dev_handle;
- EFI_BLOCK_IO *bio;
- EFI_DISK_IO *dio;
-};
-#else
-struct disk_private {
+struct bios_disk_private {
com32sys_t *regs;
};
-#endif
/*
* struct disk: contains the information about a specific disk and also
* contains the I/O function.
*/
struct disk {
- struct disk_private *private; /* Firmware-private disk info */
+ void *private; /* Firmware-private disk info */
unsigned int disk_number; /* in BIOS style */
unsigned int sector_size; /* gener512B or 2048B */
unsigned int sector_shift;
@@ -45,7 +37,7 @@ extern void read_sectors(char *, sector_t, int);
extern void getoneblk(struct disk *, char *, block_t, int);
/* diskio.c */
-struct disk *bios_disk_init(struct disk_private *);
-struct device *device_init(struct disk_private *);
+struct disk *bios_disk_init(void *);
+struct device *device_init(void *);
#endif /* DISK_H */
diff --git a/core/include/fs.h b/core/include/fs.h
index c648d2ad..4d6c18be 100644
--- a/core/include/fs.h
+++ b/core/include/fs.h
@@ -186,7 +186,7 @@ static inline struct file *handle_to_file(uint16_t handle)
extern char *PATH;
/* fs.c */
-void fs_init(const struct fs_ops **ops, struct disk_private *priv);
+void fs_init(const struct fs_ops **ops, void *priv);
void pm_mangle_name(com32sys_t *);
void pm_searchdir(com32sys_t *);
void mangle_name(char *, const char *);
diff --git a/efi/diskio.c b/efi/diskio.c
index 27745a92..01ab2a0e 100644
--- a/efi/diskio.c
+++ b/efi/diskio.c
@@ -19,12 +19,11 @@ static inline EFI_STATUS write_blocks(EFI_BLOCK_IO *bio, uint32_t id,
static int efi_rdwr_sectors(struct disk *disk, void *buf,
sector_t lba, size_t count, bool is_write)
{
- struct disk_private *priv = disk->private;
+ struct efi_disk_private *priv = (struct efi_disk_private *)disk->private;
EFI_BLOCK_IO *bio = priv->bio;
EFI_STATUS status;
UINTN bytes = count * disk->sector_size;
-
if (is_write)
status = write_blocks(bio, disk->disk_number, lba, bytes, buf);
else
@@ -38,9 +37,10 @@ static int efi_rdwr_sectors(struct disk *disk, void *buf,
return count << disk->sector_shift;
}
-struct disk *efi_disk_init(struct disk_private *priv)
+struct disk *efi_disk_init(void *private)
{
static struct disk disk;
+ struct efi_disk_private *priv = (struct efi_disk_private *)private;
EFI_HANDLE handle = priv->dev_handle;
EFI_BLOCK_IO *bio;
EFI_DISK_IO *dio;
@@ -70,7 +70,7 @@ struct disk *efi_disk_init(struct disk_private *priv)
priv->bio = bio;
priv->dio = dio;
- disk.private = priv;
+ disk.private = private;
#if 0
disk.part_start = part_start;
diff --git a/efi/efi.h b/efi/efi.h
index 97b46444..6472d6ab 100644
--- a/efi/efi.h
+++ b/efi/efi.h
@@ -8,6 +8,12 @@
#include <efilib.h>
#include <efistdarg.h>
+struct efi_disk_private {
+ EFI_HANDLE dev_handle;
+ EFI_BLOCK_IO *bio;
+ EFI_DISK_IO *dio;
+};
+
extern EFI_HANDLE image_handle;
struct screen_info;
diff --git a/efi/main.c b/efi/main.c
index 3bd8491e..39782cb2 100644
--- a/efi/main.c
+++ b/efi/main.c
@@ -1116,7 +1116,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table)
EFI_STATUS status = EFI_SUCCESS;
const struct fs_ops *ops[] = { &vfat_fs_ops, NULL };
unsigned long len = (unsigned long)__bss_end - (unsigned long)__bss_start;
- static struct disk_private priv;
+ static struct efi_disk_private priv;
SIMPLE_INPUT_INTERFACE *in;
EFI_INPUT_KEY key;
EFI_EVENT timer_ev;
@@ -1158,7 +1158,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table)
*/
efi_setcwd(DevicePathToStr(info->FilePath));
- fs_init(ops, &priv);
+ fs_init(ops, (void *)&priv);
/*
* There may be pending user input that wasn't processed by
diff --git a/mk/lib.mk b/mk/lib.mk
index fc7eba11..499a13b6 100644
--- a/mk/lib.mk
+++ b/mk/lib.mk
@@ -52,17 +52,6 @@ OPTFLAGS = -Os -march=$(MARCH) -falign-functions=0 -falign-jumps=0 \
-falign-labels=0 -ffast-math -fomit-frame-pointer
WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
-ifdef EFI_BUILD
-#Add console read fixes to rawcon_read.c
-LIBFLAGS += -DSYSLINUX_EFI -DEFI_FUNCTION_WRAPPER
-ifeq ($(ARCH),i386)
- EFIINC = -I/usr/local/include/efi -I/usr/local/include/efi/ia32
-endif
-ifeq ($(ARCH),x86_64)
- EFIINC = -I/usr/include/efi -I/usr/include/efi/x86_64
-endif
-REQFLAGS += $(EFIINC)
-endif
CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
VPATH = $(SRC)