@@ -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;
}
@@ -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,
@@ -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);
@@ -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
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(-)