Line 20... |
Line 20... |
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
*/
|
*/
|
|
|
#include <string.h>
|
#include <string.h>
|
#include <stdarg.h>
|
#include <stdarg.h>
|
|
#include <byteswap.h>
|
|
|
#include "config.h"
|
#include "config.h"
|
|
|
#ifdef HAVE_INTTYPES_H
|
#ifdef HAVE_INTTYPES_H
|
#include <inttypes.h>
|
#include <inttypes.h>
|
Line 412... |
Line 413... |
case ATA_DR :
|
case ATA_DR :
|
if(!device->regs.status & ATA_SR_DRQ) {
|
if(!device->regs.status & ATA_SR_DRQ) {
|
TRACE("data register read, while DRQ bit negated\n" );
|
TRACE("data register read, while DRQ bit negated\n" );
|
return 0;
|
return 0;
|
} else {
|
} else {
|
uint16_t val = *device->internals.dbuf_ptr++;
|
uint16_t val = le16_(*device->internals.dbuf_ptr++);
|
TRACE("data register read, value = 0x%04X, cnt = %3d\n", val,
|
TRACE("data register read, value = 0x%04X, cnt = %3d\n", val,
|
device->internals.dbuf_cnt);
|
device->internals.dbuf_cnt);
|
if(!--device->internals.dbuf_cnt) {
|
if(!--device->internals.dbuf_cnt) {
|
device->regs.status &= ~ATA_SR_DRQ;
|
device->regs.status &= ~ATA_SR_DRQ;
|
if(device->internals.end_t_func)
|
if(device->internals.end_t_func)
|
Line 502... |
Line 503... |
TRACE("data register write, while DRQ bit negated\n");
|
TRACE("data register write, while DRQ bit negated\n");
|
break;
|
break;
|
} else {
|
} else {
|
TRACE("data register write, value = 0x%04X, cnt = %3d\n",
|
TRACE("data register write, value = 0x%04X, cnt = %3d\n",
|
value, device->internals.dbuf_cnt);
|
value, device->internals.dbuf_cnt);
|
*device->internals.dbuf_ptr++ = value;
|
*device->internals.dbuf_ptr++ = le16_(value);
|
if (!--device->internals.dbuf_cnt) {
|
if (!--device->internals.dbuf_cnt) {
|
device->regs.status &= ~ATA_SR_DRQ;
|
device->regs.status &= ~ATA_SR_DRQ;
|
if(device->internals.end_t_func)
|
if(device->internals.end_t_func)
|
device->internals.end_t_func(device);
|
device->internals.end_t_func(device);
|
}
|
}
|