OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1695 to Rev 1696
    Reverse comparison

Rev 1695 → Rev 1696

/trunk/or1ksim/peripheral/atadevice.c
329,6 → 329,31
}
 
 
/* Return contents of status register in pretty for */
static const char *ata_pretty_status(uint8_t status)
{
static char str[50];
 
str[0] = '\0';
if(status & ATA_SR_BSY)
strcat(str, "BUSY");
if(status & ATA_SR_DRDY)
strcat(str, "| READY");
if(status & ATA_SR_DF)
strcat(str, "| FAULT");
if(status & ATA_SR_DSC)
strcat(str, "| SEEKC");
if(status & ATA_SR_DRQ)
strcat(str, "| DRQ");
if(status & ATA_SR_COR)
strcat(str, "| COR");
if(status & ATA_SR_IDX)
strcat(str, "| IDX");
if(status & ATA_SR_ERR)
strcat(str, "| ERROR");
return str;
}
 
/*
D E V I C E S _ R E A D
*/
362,7 → 387,8
/* return data provided by selected device */
switch (adr) {
case ATA_ASR :
TRACE("alternate_status register read\n");
TRACE("read alternate status register: %s\n",
ata_pretty_status(device->regs.status));
if ( (device->regs.device_head & ATA_DHR_DEV) == device->internals.dev )
return device -> regs.status;
else
416,8 → 442,9
device->regs.sector_number);
return device -> regs.sector_number;
 
case ATA_SR :
TRACE("status register read\n");
case ATA_SR:
TRACE( "read status register: %s\n",
ata_pretty_status(device->regs.status) );
if ( (device->regs.device_head & ATA_DHR_DEV) == device->internals.dev)
return device -> regs.status;
else

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.