aboutsummaryrefslogtreecommitdiff
path: root/hw/soc_dma.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /hw/soc_dma.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
downloadqemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.zip
qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz
qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.bz2
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/soc_dma.c')
-rw-r--r--hw/soc_dma.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/soc_dma.c b/hw/soc_dma.c
index 3f0f414..03bc846 100644
--- a/hw/soc_dma.c
+++ b/hw/soc_dma.c
@@ -48,7 +48,7 @@ static int fifo_size;
static void transfer_fifo2fifo(struct soc_dma_ch_s *ch)
{
if (ch->bytes > fifo_size)
- fifo_buf = qemu_realloc(fifo_buf, fifo_size = ch->bytes);
+ fifo_buf = g_realloc(fifo_buf, fifo_size = ch->bytes);
/* Implement as transfer_fifo2linear + transfer_linear2fifo. */
ch->io_fn[0](ch->io_opaque[0], fifo_buf, ch->bytes);
@@ -239,7 +239,7 @@ void soc_dma_reset(struct soc_dma_s *soc)
struct soc_dma_s *soc_dma_init(int n)
{
int i;
- struct dma_s *s = qemu_mallocz(sizeof(*s) + n * sizeof(*s->ch));
+ struct dma_s *s = g_malloc0(sizeof(*s) + n * sizeof(*s->ch));
s->chnum = n;
s->soc.ch = s->ch;
@@ -261,7 +261,7 @@ void soc_dma_port_add_fifo(struct soc_dma_s *soc, target_phys_addr_t virt_base,
struct memmap_entry_s *entry;
struct dma_s *dma = (struct dma_s *) soc;
- dma->memmap = qemu_realloc(dma->memmap, sizeof(*entry) *
+ dma->memmap = g_realloc(dma->memmap, sizeof(*entry) *
(dma->memmap_size + 1));
entry = soc_dma_lookup(dma, virt_base);
@@ -313,7 +313,7 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base,
struct memmap_entry_s *entry;
struct dma_s *dma = (struct dma_s *) soc;
- dma->memmap = qemu_realloc(dma->memmap, sizeof(*entry) *
+ dma->memmap = g_realloc(dma->memmap, sizeof(*entry) *
(dma->memmap_size + 1));
entry = soc_dma_lookup(dma, virt_base);