// Read and discard x number of bytes from an io channel.
static void
-insx_discard(int mode, int iobase1, int bytes)
+insx_discard(int iobase1, int bytes)
{
int count, i;
- if (mode == ATA_MODE_PIO32) {
+ if (CONFIG_ATA_PIO32) {
count = bytes / 4;
for (i=0; i<count; i++)
inl(iobase1);
u8 channel = driveid / 2;
u16 iobase1 = GET_GLOBAL(ATA.channels[channel].iobase1);
u16 iobase2 = GET_GLOBAL(ATA.channels[channel].iobase2);
- u8 mode = GET_GLOBAL(ATA.devices[driveid].mode);
int current = 0;
int status;
for (;;) {
int bsize = blocksize;
if (skipfirst && current == 0) {
- insx_discard(mode, iobase1, skipfirst);
+ insx_discard(iobase1, skipfirst);
bsize -= skipfirst;
}
if (skiplast && current == count-1)
if (iswrite) {
// Write data to controller
dprintf(16, "Write sector id=%d dest=%p\n", driveid, buf_fl);
- if (mode == ATA_MODE_PIO32)
+ if (CONFIG_ATA_PIO32)
outsl_fl(iobase1, buf_fl, bsize / 4);
else
outsw_fl(iobase1, buf_fl, bsize / 2);
} else {
// Read data from controller
dprintf(16, "Read sector id=%d dest=%p\n", driveid, buf_fl);
- if (mode == ATA_MODE_PIO32)
+ if (CONFIG_ATA_PIO32)
insl_fl(iobase1, buf_fl, bsize / 4);
else
insw_fl(iobase1, buf_fl, bsize / 2);
buf_fl += bsize;
if (skiplast && current == count-1)
- insx_discard(mode, iobase1, skiplast);
+ insx_discard(iobase1, skiplast);
status = pause_await_not_bsy(iobase1, iobase2);
if (status < 0)
// Common flags.
SET_GLOBAL(ATA.devices[driveid].removable, (buffer[0] & 0x80) ? 1 : 0);
- // XXX - what is buffer[48]?
- SET_GLOBAL(ATA.devices[driveid].mode
- , buffer[48] ? ATA_MODE_PIO32 : ATA_MODE_PIO16);
}
static int
// Support for int13 floppy drive access
#define CONFIG_FLOPPY_SUPPORT 1
-// Support for int15c2 mouse calls
-#define CONFIG_PS2_MOUSE 1
// Support for IDE disk code
#define CONFIG_ATA 1
-// Support calling int155f on each keyboard event
-#define CONFIG_KBD_CALL_INT15_4F 1
+// Use 32bit PIO accesses on ATA (minor optimization on PCI transfers)
+#define CONFIG_ATA_PIO32 0
// Support for booting from a CD
#define CONFIG_CDROM_BOOT 1
// Support for emulating a boot CD as a floppy/harddrive
#define CONFIG_LPT 1
// Support int 16 keyboard calls
#define CONFIG_KEYBOARD 1
+// Support calling int155f on each keyboard event
+#define CONFIG_KBD_CALL_INT15_4F 1
+// Support for int15c2 mouse calls
+#define CONFIG_PS2_MOUSE 1
// Support finding and running option roms during post.
#define CONFIG_OPTIONROMS 1
// Set if option roms are already copied to 0xc0000-0xf0000
u16 iobase1 = GET_GLOBAL(ATA.channels[channel].iobase1);
u16 iobase2 = GET_GLOBAL(ATA.channels[channel].iobase2);
u8 irq = GET_GLOBAL(ATA.channels[channel].irq);
- u8 mode = GET_GLOBAL(ATA.devices[device].mode);
u16 options = 0;
if (type == ATA_TYPE_ATA) {
options |= 1<<6; // atapi device
}
options |= 1<<4; // lba translation
- if (mode == ATA_MODE_PIO32)
+ if (CONFIG_ATA_PIO32)
options |= 1<<7;
SET_EBDA2(ebda_seg, dpte.iobase1, iobase1);