Received: from eggs.gnu.org ([2001:4830:134:3::10]:54314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVEvs-0006rl-Ch for qemu-devel@nongnu.org; Tue, 10 Mar 2015 03:50:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVEvq-0006Jj-LO for qemu-devel@nongnu.org; Tue, 10 Mar 2015 03:50:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVEvq-0006J4-4c for qemu-devel@nongnu.org; Tue, 10 Mar 2015 03:50:26 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2A7oNCS013543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 10 Mar 2015 03:50:24 -0400 From: Fam Zheng Date: Tue, 10 Mar 2015 15:50:10 +0800 Message-Id: <1425973810-22831-3-git-send-email-famz@redhat.com> In-Reply-To: <1425973810-22831-1-git-send-email-famz@redhat.com> References: <1425973810-22831-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] exec: Remove map_client_list family List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini Now that bounce buffer is no longer global and the callback and BH are not necessary. Remove them altogether. Signed-off-by: Fam Zheng --- dma-helpers.c | 20 -------------------- exec.c | 35 ----------------------------------- include/exec/cpu-common.h | 1 - include/exec/memory.h | 2 -- 4 files changed, 58 deletions(-) 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 -- 1.9.3