diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2013-10-26 11:48:06 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2013-10-26 11:48:06 -0400 |
commit | 1902c94de0c5621726c0b05b55a2bb33e76268d6 (patch) | |
tree | f1cd02a0706a61550a7ab22018666c4bced1d136 /src/hw/ramdisk.c | |
parent | f08e84793c51ef64dc1d08e3a9bee3f47581e8de (diff) | |
download | seabios-1902c94de0c5621726c0b05b55a2bb33e76268d6.tar.gz |
Convert op->drive_g from a 16bit pointer to a 32 bit "GLOBALFLAT" pointer.
The "drive" structure is always malloc'ed and therefore always starts
off described as a 32-bit "flat" pointer. Instead of switching
to/from 16bit pointers, make all the code use the 32bit pointer. This
eliminates the confusing 16/32 bit pointer switches.
This patch also removes the "_g" suffixes on local variables in
functions that are always called in 32bit mode.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/hw/ramdisk.c')
-rw-r--r-- | src/hw/ramdisk.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/hw/ramdisk.c b/src/hw/ramdisk.c index eeddf256..81aed50c 100644 --- a/src/hw/ramdisk.c +++ b/src/hw/ramdisk.c @@ -4,7 +4,7 @@ // // This file may be distributed under the terms of the GNU LGPLv3 license. -#include "biosvar.h" // GET_GLOBAL +#include "biosvar.h" // GET_GLOBALFLAT #include "block.h" // struct drive_s #include "bregs.h" // struct bregs #include "malloc.h" // malloc_fseg @@ -49,19 +49,19 @@ ramdisk_setup(void) return; // Setup driver. - struct drive_s *drive_g = init_floppy((u32)pos, ftype); - if (!drive_g) + struct drive_s *drive = init_floppy((u32)pos, ftype); + if (!drive) return; - drive_g->type = DTYPE_RAMDISK; + drive->type = DTYPE_RAMDISK; dprintf(1, "Mapping CBFS floppy %s to addr %p\n", filename, pos); char *desc = znprintf(MAXDESCSIZE, "Ramdisk [%s]", &filename[10]); - boot_add_floppy(drive_g, desc, bootprio_find_named_rom(filename, 0)); + boot_add_floppy(drive, desc, bootprio_find_named_rom(filename, 0)); } static int ramdisk_copy(struct disk_op_s *op, int iswrite) { - u32 offset = GET_GLOBAL(op->drive_g->cntl_id); + u32 offset = GET_GLOBALFLAT(op->drive_gf->cntl_id); offset += (u32)op->lba * DISK_SECTOR_SIZE; u64 opd = GDT_DATA | GDT_LIMIT(0xfffff) | GDT_BASE((u32)op->buf_fl); u64 ramd = GDT_DATA | GDT_LIMIT(0xfffff) | GDT_BASE(offset); |