aboutsummaryrefslogtreecommitdiffstats
path: root/src/hw/esp-scsi.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-10-26 11:48:06 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-10-26 11:48:06 -0400
commit1902c94de0c5621726c0b05b55a2bb33e76268d6 (patch)
treef1cd02a0706a61550a7ab22018666c4bced1d136 /src/hw/esp-scsi.c
parentf08e84793c51ef64dc1d08e3a9bee3f47581e8de (diff)
downloadseabios-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/esp-scsi.c')
-rw-r--r--src/hw/esp-scsi.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/hw/esp-scsi.c b/src/hw/esp-scsi.c
index 118a1f52..982c1d54 100644
--- a/src/hw/esp-scsi.c
+++ b/src/hw/esp-scsi.c
@@ -10,7 +10,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 "blockcmd.h" // scsi_drive_setup
#include "config.h" // CONFIG_*
@@ -77,10 +77,10 @@ esp_scsi_dma(u32 iobase, u32 buf, u32 len, int read)
}
static int
-esp_scsi_cmd(struct esp_lun_s *llun, struct disk_op_s *op,
+esp_scsi_cmd(struct esp_lun_s *llun_gf, struct disk_op_s *op,
u8 *cdbcmd, u16 target, u16 lun, u16 blocksize)
{
- u32 iobase = GET_GLOBAL(llun->iobase);
+ u32 iobase = GET_GLOBALFLAT(llun_gf->iobase);
int i, state;
u8 status;
@@ -150,11 +150,12 @@ esp_scsi_cmd_data(struct disk_op_s *op, void *cdbcmd, u16 blocksize)
if (!CONFIG_ESP_SCSI)
return DISK_RET_EBADTRACK;
- struct esp_lun_s *llun =
- container_of(op->drive_g, struct esp_lun_s, drive);
+ struct esp_lun_s *llun_gf =
+ container_of(op->drive_gf, struct esp_lun_s, drive);
- return esp_scsi_cmd(llun, op, cdbcmd,
- GET_GLOBAL(llun->target), GET_GLOBAL(llun->lun),
+ return esp_scsi_cmd(llun_gf, op, cdbcmd,
+ GET_GLOBALFLAT(llun_gf->target),
+ GET_GLOBALFLAT(llun_gf->lun),
blocksize);
}