2 Copyright © 2004-2013, The AROS Development Team. All rights reserved.
5 Desc: PCI IDE PIO interface functions
9 #include "interface_pio.h"
11 void ata_out(struct pio_data
*data
, UBYTE val
, UWORD offset
)
13 outb(val
, offset
+ data
->ioBase
);
16 UBYTE
ata_in(struct pio_data
*data
, UWORD offset
)
18 return inb(offset
+ data
->ioBase
);
21 void ata_out_alt(struct pio_data
*data
, UBYTE val
, UWORD offset
)
23 outb(val
, offset
+ data
->ioAlt
);
26 UBYTE
ata_in_alt(struct pio_data
*data
, UWORD offset
)
28 return inb(offset
+ data
->ioAlt
);
31 #if defined(__i386__) || defined(__x86_64__)
33 void ata_outsw(struct pio_data
*data
, APTR address
, ULONG count
)
35 outsw(data
->ioBase
, address
, count
>> 1);
38 void ata_insw(struct pio_data
*data
, APTR address
, ULONG count
)
40 insw(data
->ioBase
, address
, count
>> 1);
43 void ata_outsl(struct pio_data
*data
, APTR address
, ULONG count
)
46 outsw(data
->ioBase
, address
, count
>> 1);
48 outsl(data
->ioBase
, address
, count
>> 2);
51 void ata_insl(struct pio_data
*data
, APTR address
, ULONG count
)
54 insw(data
->ioBase
, address
, count
>> 1);
56 insl(data
->ioBase
, address
, count
>> 2);
61 void ata_outsw(struct pio_data
*data
, APTR address
, ULONG count
)
63 UWORD
*addr
= address
;
67 outw(*addr
++, data
->ioBase
);
72 void ata_insw(struct pio_data
*data
, APTR address
, ULONG count
)
74 UWORD
*addr
= address
;
78 *addr
++ = inw(data
->ioBase
);
83 void ata_outsl(struct pio_data
*data
, APTR address
, ULONG count
)
87 ata_outsw(data
, address
, count
);
91 ULONG
*addr
= address
;
95 outl(*addr
++, data
->ioBase
);
101 void ata_insl(struct pio_data
*data
, APTR address
, ULONG count
)
105 ata_insw(data
, address
, count
);
109 ULONG
*addr
= address
;
113 *addr
++ = inl(data
->ioBase
);
121 const APTR bus_FuncTable
[] =
130 const APTR pio_FuncTable
[] =