hw/ide: Rename idebus_active_if() -> ide_bus_active_if()
idebus_active_if() operates on a IDEBus; rename it as ide_bus_active_if() to emphasize its first argument is a IDEBus. Mechanical change using: $ sed -i -e 's/idebus_active_if/ide_bus_active_if/g' \ $(git grep -l idebus_active_if) Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-Id: <20230215112712.23110-16-philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
c951963043
commit
2c50207f0d
@ -1265,7 +1265,7 @@ const char *ATA_IOPORT_WR_lookup[ATA_IOPORT_WR_NUM_REGISTERS] = {
|
|||||||
void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
int reg_num = addr & 7;
|
int reg_num = addr & 7;
|
||||||
|
|
||||||
trace_ide_ioport_write(addr, ATA_IOPORT_WR_lookup[reg_num], val, bus, s);
|
trace_ide_ioport_write(addr, ATA_IOPORT_WR_lookup[reg_num], val, bus, s);
|
||||||
@ -2128,7 +2128,7 @@ void ide_bus_exec_cmd(IDEBus *bus, uint32_t val)
|
|||||||
IDEState *s;
|
IDEState *s;
|
||||||
bool complete;
|
bool complete;
|
||||||
|
|
||||||
s = idebus_active_if(bus);
|
s = ide_bus_active_if(bus);
|
||||||
trace_ide_bus_exec_cmd(bus, s, val);
|
trace_ide_bus_exec_cmd(bus, s, val);
|
||||||
|
|
||||||
/* ignore commands to non existent slave */
|
/* ignore commands to non existent slave */
|
||||||
@ -2195,7 +2195,7 @@ const char *ATA_IOPORT_RR_lookup[ATA_IOPORT_RR_NUM_REGISTERS] = {
|
|||||||
uint32_t ide_ioport_read(void *opaque, uint32_t addr)
|
uint32_t ide_ioport_read(void *opaque, uint32_t addr)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
uint32_t reg_num;
|
uint32_t reg_num;
|
||||||
int ret, hob;
|
int ret, hob;
|
||||||
|
|
||||||
@ -2281,7 +2281,7 @@ uint32_t ide_ioport_read(void *opaque, uint32_t addr)
|
|||||||
uint32_t ide_status_read(void *opaque, uint32_t addr)
|
uint32_t ide_status_read(void *opaque, uint32_t addr)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((!bus->ifs[0].blk && !bus->ifs[1].blk) ||
|
if ((!bus->ifs[0].blk && !bus->ifs[1].blk) ||
|
||||||
@ -2370,7 +2370,7 @@ static bool ide_is_pio_out(IDEState *s)
|
|||||||
void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
|
void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
|
|
||||||
trace_ide_data_writew(addr, val, bus, s);
|
trace_ide_data_writew(addr, val, bus, s);
|
||||||
@ -2406,7 +2406,7 @@ void ide_data_writew(void *opaque, uint32_t addr, uint32_t val)
|
|||||||
uint32_t ide_data_readw(void *opaque, uint32_t addr)
|
uint32_t ide_data_readw(void *opaque, uint32_t addr)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -2444,7 +2444,7 @@ uint32_t ide_data_readw(void *opaque, uint32_t addr)
|
|||||||
void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
|
void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
|
|
||||||
trace_ide_data_writel(addr, val, bus, s);
|
trace_ide_data_writel(addr, val, bus, s);
|
||||||
@ -2472,7 +2472,7 @@ void ide_data_writel(void *opaque, uint32_t addr, uint32_t val)
|
|||||||
uint32_t ide_data_readl(void *opaque, uint32_t addr)
|
uint32_t ide_data_readl(void *opaque, uint32_t addr)
|
||||||
{
|
{
|
||||||
IDEBus *bus = opaque;
|
IDEBus *bus = opaque;
|
||||||
IDEState *s = idebus_active_if(bus);
|
IDEState *s = ide_bus_active_if(bus);
|
||||||
uint8_t *p;
|
uint8_t *p;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -2711,7 +2711,7 @@ static void ide_restart_bh(void *opaque)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
s = idebus_active_if(bus);
|
s = ide_bus_active_if(bus);
|
||||||
is_read = (bus->error_status & IDE_RETRY_READ) != 0;
|
is_read = (bus->error_status & IDE_RETRY_READ) != 0;
|
||||||
|
|
||||||
/* The error status must be cleared before resubmitting the request: The
|
/* The error status must be cleared before resubmitting the request: The
|
||||||
|
@ -60,7 +60,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
|
|||||||
{
|
{
|
||||||
DBDMA_io *io = opaque;
|
DBDMA_io *io = opaque;
|
||||||
MACIOIDEState *m = io->opaque;
|
MACIOIDEState *m = io->opaque;
|
||||||
IDEState *s = idebus_active_if(&m->bus);
|
IDEState *s = ide_bus_active_if(&m->bus);
|
||||||
int64_t offset;
|
int64_t offset;
|
||||||
|
|
||||||
MACIO_DPRINTF("pmac_ide_atapi_transfer_cb\n");
|
MACIO_DPRINTF("pmac_ide_atapi_transfer_cb\n");
|
||||||
@ -136,7 +136,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
|
|||||||
{
|
{
|
||||||
DBDMA_io *io = opaque;
|
DBDMA_io *io = opaque;
|
||||||
MACIOIDEState *m = io->opaque;
|
MACIOIDEState *m = io->opaque;
|
||||||
IDEState *s = idebus_active_if(&m->bus);
|
IDEState *s = ide_bus_active_if(&m->bus);
|
||||||
int64_t offset;
|
int64_t offset;
|
||||||
|
|
||||||
MACIO_DPRINTF("pmac_ide_transfer_cb\n");
|
MACIO_DPRINTF("pmac_ide_transfer_cb\n");
|
||||||
@ -220,7 +220,7 @@ done:
|
|||||||
static void pmac_ide_transfer(DBDMA_io *io)
|
static void pmac_ide_transfer(DBDMA_io *io)
|
||||||
{
|
{
|
||||||
MACIOIDEState *m = io->opaque;
|
MACIOIDEState *m = io->opaque;
|
||||||
IDEState *s = idebus_active_if(&m->bus);
|
IDEState *s = ide_bus_active_if(&m->bus);
|
||||||
|
|
||||||
MACIO_DPRINTF("\n");
|
MACIO_DPRINTF("\n");
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ static void pmac_ide_transfer(DBDMA_io *io)
|
|||||||
static void pmac_ide_flush(DBDMA_io *io)
|
static void pmac_ide_flush(DBDMA_io *io)
|
||||||
{
|
{
|
||||||
MACIOIDEState *m = io->opaque;
|
MACIOIDEState *m = io->opaque;
|
||||||
IDEState *s = idebus_active_if(&m->bus);
|
IDEState *s = ide_bus_active_if(&m->bus);
|
||||||
|
|
||||||
if (s->bus->dma->aiocb) {
|
if (s->bus->dma->aiocb) {
|
||||||
blk_drain(s->blk);
|
blk_drain(s->blk);
|
||||||
|
@ -250,14 +250,14 @@ static uint16_t md_common_read(PCMCIACardState *card, uint32_t at)
|
|||||||
case 0xd: /* Error */
|
case 0xd: /* Error */
|
||||||
return ide_ioport_read(&s->bus, 0x1);
|
return ide_ioport_read(&s->bus, 0x1);
|
||||||
case 0xe: /* Alternate Status */
|
case 0xe: /* Alternate Status */
|
||||||
ifs = idebus_active_if(&s->bus);
|
ifs = ide_bus_active_if(&s->bus);
|
||||||
if (ifs->blk) {
|
if (ifs->blk) {
|
||||||
return ifs->status;
|
return ifs->status;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case 0xf: /* Device Address */
|
case 0xf: /* Device Address */
|
||||||
ifs = idebus_active_if(&s->bus);
|
ifs = ide_bus_active_if(&s->bus);
|
||||||
return 0xc2 | ((~ifs->select << 2) & 0x3c);
|
return 0xc2 | ((~ifs->select << 2) & 0x3c);
|
||||||
default:
|
default:
|
||||||
return ide_ioport_read(&s->bus, at);
|
return ide_ioport_read(&s->bus, at);
|
||||||
|
@ -296,7 +296,7 @@ void bmdma_cmd_writeb(BMDMAState *bm, uint32_t val)
|
|||||||
/* Ignore writes to SSBM if it keeps the old value */
|
/* Ignore writes to SSBM if it keeps the old value */
|
||||||
if ((val & BM_CMD_START) != (bm->cmd & BM_CMD_START)) {
|
if ((val & BM_CMD_START) != (bm->cmd & BM_CMD_START)) {
|
||||||
if (!(val & BM_CMD_START)) {
|
if (!(val & BM_CMD_START)) {
|
||||||
ide_cancel_dma_sync(idebus_active_if(bm->bus));
|
ide_cancel_dma_sync(ide_bus_active_if(bm->bus));
|
||||||
bm->status &= ~BM_STATUS_DMAING;
|
bm->status &= ~BM_STATUS_DMAING;
|
||||||
} else {
|
} else {
|
||||||
bm->cur_addr = bm->addr;
|
bm->cur_addr = bm->addr;
|
||||||
|
@ -566,7 +566,7 @@ static inline uint8_t ide_dma_cmd_to_retry(uint8_t dma_cmd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline IDEState *idebus_active_if(IDEBus *bus)
|
static inline IDEState *ide_bus_active_if(IDEBus *bus)
|
||||||
{
|
{
|
||||||
return bus->ifs + bus->unit;
|
return bus->ifs + bus->unit;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user