]> xenbits.xensource.com Git - seabios.git/commitdiff
blockcmd: CMD_SCSI op is only used in 32bit mode
authorKevin O'Connor <kevin@koconnor.net>
Thu, 4 Aug 2016 13:51:10 +0000 (09:51 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Thu, 4 Aug 2016 20:03:34 +0000 (16:03 -0400)
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>
src/hw/blockcmd.c

index 093c5d73e934a09e3c88f4c9f0c17320a44a437b..f147100e9883c3f3d7aac18f54ece65fcd8ef0a2 100644 (file)
@@ -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;