aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2021-02-10 21:09:59 +0100
committerHelge Deller <deller@gmx.de>2021-09-24 11:10:17 +0200
commit9a6adef8e50bbdf076936af8b5f39e44982fe923 (patch)
tree2f2b0d17b4e38e6e2ca93ddf238438c2268cc0cc
parentb305fd659ebf2c11b94957904fadfab73fc3933e (diff)
downloadseabios-hppa-9a6adef8e50bbdf076936af8b5f39e44982fe923.zip
seabios-hppa-9a6adef8e50bbdf076936af8b5f39e44982fe923.tar.gz
seabios-hppa-9a6adef8e50bbdf076936af8b5f39e44982fe923.tar.bz2
lsi-scsi.c: Convert SCSI script to little endian
The lsi-scsi driver expects the SCSI script in little-endian format. Do this conversion on PA-RISC (which is big-endian). On x86 this conversion will be optimized away. Signed-off-by: Helge Deller <deller@gmx.de>
-rw-r--r--src/hw/lsi-scsi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/hw/lsi-scsi.c b/src/hw/lsi-scsi.c
index 101544e..5583bd6 100644
--- a/src/hw/lsi-scsi.c
+++ b/src/hw/lsi-scsi.c
@@ -14,6 +14,7 @@
#include "block.h" // struct drive_s
#include "blockcmd.h" // scsi_drive_setup
#include "config.h" // CONFIG_*
+#include "byteorder.h" // cpu_to_*
#include "fw/paravirt.h" // runningOnQEMU
#include "malloc.h" // free
#include "output.h" // dprintf
@@ -106,6 +107,9 @@ lsi_scsi_process_op(struct disk_op_s *op)
};
u32 dsp = (u32)MAKE_FLATPTR(GET_SEG(SS), &script);
+ /* convert to little endian for PCI */
+ convert_to_le32(script, sizeof(script));
+
outb(dsp & 0xff, iobase + LSI_REG_DSP0);
outb((dsp >> 8) & 0xff, iobase + LSI_REG_DSP1);
outb((dsp >> 16) & 0xff, iobase + LSI_REG_DSP2);