diff mbox

[2/2] exec: Remove map_client_list family

Message ID 1425973810-22831-3-git-send-email-famz@redhat.com
State New
Headers show

Commit Message

Fam Zheng March 10, 2015, 7:50 a.m. UTC
Now that bounce buffer is no longer global and the callback and BH are
not necessary. Remove them altogether.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 dma-helpers.c             | 20 --------------------
 exec.c                    | 35 -----------------------------------
 include/exec/cpu-common.h |  1 -
 include/exec/memory.h     |  2 --
 4 files changed, 58 deletions(-)
diff mbox

Patch

diff --git a/dma-helpers.c b/dma-helpers.c
index 6918572..4de52dc 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -81,25 +81,6 @@  typedef struct {
     DMAIOFunc *io_func;
 } DMAAIOCB;
 
-static void dma_blk_cb(void *opaque, int ret);
-
-static void reschedule_dma(void *opaque)
-{
-    DMAAIOCB *dbs = (DMAAIOCB *)opaque;
-
-    qemu_bh_delete(dbs->bh);
-    dbs->bh = NULL;
-    dma_blk_cb(dbs, 0);
-}
-
-static void continue_after_map_failure(void *opaque)
-{
-    DMAAIOCB *dbs = (DMAAIOCB *)opaque;
-
-    dbs->bh = qemu_bh_new(reschedule_dma, dbs);
-    qemu_bh_schedule(dbs->bh);
-}
-
 static void dma_blk_unmap(DMAAIOCB *dbs)
 {
     int i;
@@ -161,7 +142,6 @@  static void dma_blk_cb(void *opaque, int ret)
 
     if (dbs->iov.size == 0) {
         trace_dma_map_wait(dbs);
-        cpu_register_map_client(dbs, continue_after_map_failure);
         return;
     }
 
diff --git a/exec.c b/exec.c
index 5943cc2..45f324e 100644
--- a/exec.c
+++ b/exec.c
@@ -2519,38 +2519,6 @@  typedef struct MapClient {
     QLIST_ENTRY(MapClient) link;
 } MapClient;
 
-static QLIST_HEAD(map_client_list, MapClient) map_client_list
-    = QLIST_HEAD_INITIALIZER(map_client_list);
-
-void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque))
-{
-    MapClient *client = g_malloc(sizeof(*client));
-
-    client->opaque = opaque;
-    client->callback = callback;
-    QLIST_INSERT_HEAD(&map_client_list, client, link);
-    return client;
-}
-
-static void cpu_unregister_map_client(void *_client)
-{
-    MapClient *client = (MapClient *)_client;
-
-    QLIST_REMOVE(client, link);
-    g_free(client);
-}
-
-static void cpu_notify_map_clients(void)
-{
-    MapClient *client;
-
-    while (!QLIST_EMPTY(&map_client_list)) {
-        client = QLIST_FIRST(&map_client_list);
-        client->callback(client->opaque);
-        cpu_unregister_map_client(client);
-    }
-}
-
 bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_write)
 {
     MemoryRegion *mr;
@@ -2576,8 +2544,6 @@  bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
  * May map a subset of the requested range, given by and returned in *plen.
  * May return NULL if resources needed to perform the mapping are exhausted.
  * Use only for reads OR writes - not for read-modify-write operations.
- * Use cpu_register_map_client() to know when retrying the map operation is
- * likely to succeed.
  */
 void *address_space_map(AddressSpace *as,
                         hwaddr addr,
@@ -2669,7 +2635,6 @@  void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
     qemu_vfree(bounce->buffer);
     memory_region_unref(bounce->mr);
     g_free(bounce);
-    cpu_notify_map_clients();
 }
 
 void *cpu_physical_memory_map(hwaddr addr,
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index fcc3162..c86c837 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -82,7 +82,6 @@  void *cpu_physical_memory_map(hwaddr addr,
                               int is_write);
 void cpu_physical_memory_unmap(void *buffer, hwaddr len,
                                int is_write, hwaddr access_len);
-void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque));
 
 bool cpu_physical_memory_is_io(hwaddr phys_addr);
 
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 06ffa1d..3ac93ab 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -1127,8 +1127,6 @@  bool address_space_access_valid(AddressSpace *as, hwaddr addr, int len, bool is_
  * May map a subset of the requested range, given by and returned in @plen.
  * May return %NULL if resources needed to perform the mapping are exhausted.
  * Use only for reads OR writes - not for read-modify-write operations.
- * Use cpu_register_map_client() to know when retrying the map operation is
- * likely to succeed.
  *
  * @as: #AddressSpace to be accessed
  * @addr: address within that address space