aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-08-04 09:51:10 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-08-04 16:03:34 -0400
commit4e3a1a5df143f910dc2dfce4ecbd202f5e1efb29 (patch)
treead631fd97081403e5322863c297886a62042837a
parent09e24ac187d586c6a287927afffefe4da319fd3e (diff)
downloadseabios-4e3a1a5df143f910dc2dfce4ecbd202f5e1efb29.tar.gz
seabios-4e3a1a5df143f910dc2dfce4ecbd202f5e1efb29.tar.xz
seabios-4e3a1a5df143f910dc2dfce4ecbd202f5e1efb29.zip
blockcmd: CMD_SCSI op is only used in 32bit mode
Reduce the size of the 16bit code slightly by recognizing that CMD_SCSI is only used in 32bit mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/hw/blockcmd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/hw/blockcmd.c b/src/hw/blockcmd.c
index 093c5d7..f147100 100644
--- a/src/hw/blockcmd.c
+++ b/src/hw/blockcmd.c
@@ -118,6 +118,8 @@ scsi_fill_cmd(struct disk_op_s *op, void *cdbcmd, int maxcdb)
cmd->count = cpu_to_be16(op->count);
return GET_GLOBALFLAT(op->drive_gf->blksize);
case CMD_SCSI:
+ if (MODESEGMENT)
+ return -1;
memcpy(cdbcmd, op->cdbcmd, maxcdb);
return op->blocksize;
default:
@@ -129,13 +131,15 @@ scsi_fill_cmd(struct disk_op_s *op, void *cdbcmd, int maxcdb)
int
scsi_is_read(struct disk_op_s *op)
{
- return op->command == CMD_READ || (op->command == CMD_SCSI && op->blocksize);
+ return op->command == CMD_READ || (
+ !MODESEGMENT && op->command == CMD_SCSI && op->blocksize);
}
// Check if a SCSI device is ready to receive commands
int
scsi_is_ready(struct disk_op_s *op)
{
+ ASSERT32FLAT();
dprintf(6, "scsi_is_ready (drive=%p)\n", op->drive_gf);
/* Retry TEST UNIT READY for 5 seconds unless MEDIUM NOT PRESENT is
@@ -181,6 +185,7 @@ scsi_is_ready(struct disk_op_s *op)
int
scsi_drive_setup(struct drive_s *drive, const char *s, int prio)
{
+ ASSERT32FLAT();
struct disk_op_s dop;
memset(&dop, 0, sizeof(dop));
dop.drive_gf = drive;