diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-07-11 12:09:57 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-09-27 19:02:16 -0400 |
commit | 04db972290a6f3c61920fc7498031f477911774e (patch) | |
tree | 61486505328ef8cb6abf6785da1db07982067551 /src/disk.c | |
parent | 5e9a6d5b03b8a7458b1f1d68d6e98f5de16f4e0b (diff) | |
download | seabios-04db972290a6f3c61920fc7498031f477911774e.tar.gz |
disk: Don't require the 'struct drive_s' to be in the f-segment
Allow the 'struct drive_s' drive description structure to be in either
the "low" memory segment or the f-segment.
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/disk.c')
-rw-r--r-- | src/disk.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -81,9 +81,9 @@ getLCHS(struct drive_s *drive_gf) res.sector = sptcyl & 0x3f; return res; } - res.cylinder = GET_GLOBALFLAT(drive_gf->lchs.cylinder); - res.head = GET_GLOBALFLAT(drive_gf->lchs.head); - res.sector = GET_GLOBALFLAT(drive_gf->lchs.sector); + res.cylinder = GET_FLATPTR(drive_gf->lchs.cylinder); + res.head = GET_FLATPTR(drive_gf->lchs.head); + res.sector = GET_FLATPTR(drive_gf->lchs.sector); return res; } @@ -168,7 +168,7 @@ extended_access(struct bregs *regs, struct drive_s *drive_gf, u16 command) dop.lba = GET_FARVAR(regs->ds, param_far->lba); dop.command = command; dop.drive_gf = drive_gf; - if (dop.lba >= GET_GLOBALFLAT(drive_gf->sectors)) { + if (dop.lba >= GET_FLATPTR(drive_gf->sectors)) { warn_invalid(regs); disk_ret(regs, DISK_RET_EPARAM); return; @@ -287,7 +287,7 @@ disk_1308(struct bregs *regs, struct drive_s *drive_gf) if (CONFIG_CDROM_EMU && drive_gf == GET_GLOBAL(cdemu_drive_gf)) regs->bx = GET_LOW(CDEmu.media) * 2; else - regs->bx = GET_GLOBALFLAT(drive_gf->floppy_type); + regs->bx = GET_FLATPTR(drive_gf->floppy_type); // set es & di to point to 11 byte diskette param table in ROM regs->es = SEG_BIOS; |