URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 1707 to Rev 1708
- ↔ Reverse comparison
Rev 1707 → Rev 1708
/trunk/or1ksim/peripheral/atadevice.c
144,6 → 144,8
device->conf.stream = NULL; |
break; |
} |
|
device->conf.size_sect = device->conf.size / BYTES_PER_SECTOR; |
} |
|
/* |
/trunk/or1ksim/peripheral/atadevice.h
176,7 → 176,8
/* NO_CONNECT: no device connected (dummy) */ |
/* FILE : a file */ |
/* LOCAL : a local stream, e.g./dev/hda1 */ |
unsigned long size; /* size in bytes of the simulated device */ |
uint32_t size; /* size in bytes of the simulated device */ |
uint32_t size_sect; /* size in sectors of the simulated device*/ |
int packet; /* device implements PACKET command set */ |
} conf; |
} ata_device; |
/trunk/or1ksim/peripheral/atadevice_cmdi.c
306,7 → 306,7
|
>=1, <= 65535 |
*/ |
if((tmp = device->conf.size / BYTES_PER_SECTOR) >= 16514064) |
if((tmp = device->conf.size_sect) >= 16514064) |
*buf++ = 16383; |
else |
if ( (tmp /= (HEADS +1) * SECTORS) > 65535 ) |
472,7 → 472,7
/* |
word 54: number of current logical cylinders (0-65535) |
*/ |
if((tmp = device->conf.size / BYTES_PER_SECTOR) > 16514064 ) |
if((tmp = device->conf.size_sect) > 16514064) |
tmp = 16514064; |
|
tmp /= (device->internals.heads_per_cylinder +1) * (device->internals.sectors_per_track); |
510,8 → 510,8
/* |
word 60-61: Total number of user addressable sectors (LBA only) |
*/ |
*buf++ = (device->conf.size / BYTES_PER_SECTOR); |
*buf++ = (device->conf.size / BYTES_PER_SECTOR) >> 16; |
*buf++ = device->conf.size_sect; |
*buf++ = device->conf.size_sect >> 16; |
|
/* |
word 62: obsolete |
920,10 → 920,10
TRACE("Reading from lba %i, %i sectors\n", lba, sector_count); |
|
/* check if sector within bounds */ |
if(lba >= device->conf.size / BYTES_PER_SECTOR) { |
if(lba >= device->conf.size_sect) { |
/* invalid sector address */ |
/* set the status & error registers */ |
TRACE("Sector read out-of-bounds: %i >= %i\n", lba, device->conf.size / BYTES_PER_SECTOR); |
TRACE("Sector read out-of-bounds: %i >= %i\n", lba, device->conf.size_sect); |
device->regs.status = ATA_SR_DRDY | ATA_SR_ERR; |
device->regs.error = ATA_ERR_IDNF; |
return; |