diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-04-10 17:30:48 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-06-20 16:32:47 +0200 |
commit | 2b7dc949e241ac2b069d2d6183c1346cad792662 (patch) | |
tree | 036435406f192d463a234f7df11678dc61bec7c4 /hw/ppc/spapr_vio.c | |
parent | 06d985f5d844d07d31b4dada20f4ff6cf0d6ff4a (diff) |
spapr: convert TCE API to use an opaque type
The TCE table is currently returned as a DMAContext, and non-type-safe
APIs are called later passing back the DMAContext. Since we want to move
away from DMAContext, use an opaque type instead, and add an accessor
to retrieve the DMAContext from it.
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc/spapr_vio.c')
-rw-r--r-- | hw/ppc/spapr_vio.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index 304f3168f7..ae906a74a6 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -142,7 +142,7 @@ static int vio_make_devnode(VIOsPAPRDevice *dev, } } - ret = spapr_tcet_dma_dt(fdt, node_off, "ibm,my-dma-window", dev->dma); + ret = spapr_tcet_dma_dt(fdt, node_off, "ibm,my-dma-window", dev->tcet); if (ret < 0) { return ret; } @@ -315,8 +315,8 @@ int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq) static void spapr_vio_quiesce_one(VIOsPAPRDevice *dev) { - if (dev->dma) { - spapr_tce_reset(dev->dma); + if (dev->tcet) { + spapr_tce_reset(dev->tcet); } free_crq(dev); } @@ -341,12 +341,12 @@ static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token, return; } - if (!dev->dma) { + if (!dev->tcet) { rtas_st(rets, 0, -3); return; } - spapr_tce_set_bypass(dev->dma, !!enable); + spapr_tce_set_bypass(dev->tcet, !!enable); rtas_st(rets, 0, 0); } @@ -453,7 +453,8 @@ static int spapr_vio_busdev_init(DeviceState *qdev) if (pc->rtce_window_size) { uint32_t liobn = SPAPR_VIO_BASE_LIOBN | dev->reg; - dev->dma = spapr_tce_new_dma_context(liobn, pc->rtce_window_size); + dev->tcet = spapr_tce_new_table(liobn, pc->rtce_window_size); + dev->dma = spapr_tce_get_dma(dev->tcet); } return pc->init(dev); |