diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2009-08-16 12:09:44 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2009-08-16 12:09:44 -0400 |
commit | 0a0e42e98538e959fece731be9262b1a8e874c7d (patch) | |
tree | f832825c7bfdccc0fd1e257c66396d292492e660 /src/ata.c | |
parent | 669e6449565018e72e3833ff39fcf677d5a5b824 (diff) | |
download | seabios-hppa-0a0e42e98538e959fece731be9262b1a8e874c7d.zip seabios-hppa-0a0e42e98538e959fece731be9262b1a8e874c7d.tar.gz seabios-hppa-0a0e42e98538e959fece731be9262b1a8e874c7d.tar.bz2 |
Add floppy controllers to "drives" list also.
The Drives.drives list now contains floppies, harddrives, and cdroms.
Add mapping table for external/internal drive ids for floppies.
Rename CONFIG_FLOPPY_SUPPORT to CONFIG_FLOPPY (for consistency).
Be consistent with "driveid" and "floppyid" variable names.
Replace switch statements of drive parameters into a global array.
There are some externally visible changes with this patch:
- Some calls will now return EPARAM instead of ETIMEOUT (or ECHANGED)
- floppy_1301/1308 are now only available when regs->dl is valid
- floppy_1308/1315 return EPARAM on invalid drives
Diffstat (limited to 'src/ata.c')
-rw-r--r-- | src/ata.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -623,7 +623,7 @@ ata_detect() { // Device detection u64 end = calc_future_tsc(IDE_TIMEOUT); - int ataid, last_reset_ataid=-1, driveid=0; + int ataid, last_reset_ataid=-1; for (ataid=0; ataid<CONFIG_MAX_ATA_INTERFACES*2; ataid++) { u8 channel = ataid / 2; u8 slave = ataid % 2; @@ -656,6 +656,7 @@ ata_detect() continue; // Prepare new driveid. + u8 driveid = GET_GLOBAL(Drives.drivecount); if (driveid >= ARRAY_SIZE(Drives.drives)) break; memset(&Drives.drives[driveid], 0, sizeof(Drives.drives[0])); @@ -691,7 +692,7 @@ ata_detect() // No ATA drive found continue; } - driveid++; + SET_GLOBAL(Drives.drivecount, driveid+1); u16 resetresult = buffer[93]; dprintf(6, "ata_detect resetresult=%04x\n", resetresult); |