From patchwork Wed Jul 20 05:02:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 9238895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50DEE602F0 for ; Wed, 20 Jul 2016 05:08:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44C3B20587 for ; Wed, 20 Jul 2016 05:08:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39AC32756B; Wed, 20 Jul 2016 05:08:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB55A20587 for ; Wed, 20 Jul 2016 05:08:36 +0000 (UTC) Received: from localhost ([::1]:60592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPjkJ-00044M-Nj for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 Jul 2016 01:08:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPjfN-0007zf-Ha for qemu-devel@nongnu.org; Wed, 20 Jul 2016 01:03:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPjfL-0004hU-As for qemu-devel@nongnu.org; Wed, 20 Jul 2016 01:03:28 -0400 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:34083) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPjfL-0004gw-3K; Wed, 20 Jul 2016 01:03:27 -0400 Received: by mail-pa0-x244.google.com with SMTP id hh10so2594986pac.1; Tue, 19 Jul 2016 22:03:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KFES7X5TcEsOOde34zItxoSDMGKim4CyjLBZAyJvIKk=; b=PjwscXINGfEnHFciYXvEp4O4CvD2NhyLsfSwIDefum/uHWQNSr6RI9H6p0xvlDqhxA GaQBMvjhxI+KMJToJGqYV+qvXmYjmDVkcWF+WUOp4ofTKowrWaYuG3rUmdQXCcOt5tKK 7yGVJB9g27v4Og0VgcgYVUb9lO1nSVboKr85B3pyjCaB6d4CNXLwl9QV/UOF78i8zPSR N9lsqhM1D7RZvD88azd48Jb0MTuFAtjVSHUyD9+30MpJ1ze4YSK235gkM3OVAZUVnyHh HNO4GfssPo+yg7zKjBpncmjRfLOmfkNTLELCVcwQLSbXM6JJq+JQDoWiPG5I7r42VN43 +4rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KFES7X5TcEsOOde34zItxoSDMGKim4CyjLBZAyJvIKk=; b=hGVTP+Wv6GEPHbMF+1Mp0bwHMAafCzIxKVrqh7XADOPngKZTpEJoBLpuuqRyKI0+pD X8TkzPfO7sDQvY5O++ptIV/W8CI3WcaNXxXG/pTAHsjE3ghOlzEC/RpF850FCfcDwBzc fC4qeaFiKMq8g5cPMOfddCUKgeSk82QAien1AcgGJAup3LTVkRGNkykOmzI0LBoBQSVo ywg7lfl+WCq0LDrSf+n/OQPRC9TNck6x4QTzgCBt/E+V8Fc1EDf9eGIL7cVvaEUxO24F 1Oh/V9GqMkiF9ldQ1LkxtbeuuF4qLyA+rsE4Khl4JqvU03Xiq1pJHniYkcEU2UnKyRMg 2bQQ== X-Gm-Message-State: ALyK8tLznkSvOWXAI5r1B0rpAJ0czsjzRlsk49VUGfDAvLOwC+ojY96Oohs0R+m3sowtPQ== X-Received: by 10.66.26.105 with SMTP id k9mr72974778pag.103.1468991006266; Tue, 19 Jul 2016 22:03:26 -0700 (PDT) Received: from squirtle.localdomain.localdomain (c-73-225-163-254.hsd1.wa.comcast.net. [73.225.163.254]) by smtp.gmail.com with ESMTPSA id c66sm1031757pfd.24.2016.07.19.22.03.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jul 2016 22:03:25 -0700 (PDT) From: Andrey Smirnov To: qemu-devel@nongnu.org Date: Tue, 19 Jul 2016 22:02:59 -0700 Message-Id: <1468990980-4598-10-git-send-email-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1468990980-4598-1-git-send-email-andrew.smirnov@gmail.com> References: <1468990980-4598-1-git-send-email-andrew.smirnov@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::244 Subject: [Qemu-devel] [PATCH v3 09/10] gdbstub: Convert target_memory_rw_debug to use MemoryAccessType X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , kvm@vger.kernel.org, Andrey Smirnov , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Convert target_memory_rw_debug to use MemoryAccessType as to follow similar conversion of cpu_memory_rw_debug. Signed-off-by: Andrey Smirnov Reviewed-by: David Gibson --- gdbstub.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 9c4cbe4..c215672 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -44,15 +44,17 @@ #endif static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr, - uint8_t *buf, int len, bool is_write) + uint8_t *buf, int len, + MemoryAccessType access_type) { CPUClass *cc = CPU_GET_CLASS(cpu); if (cc->memory_rw_debug) { + const bool is_write = (access_type == MEM_DATA_STORE); return cc->memory_rw_debug(cpu, addr, buf, len, is_write); } - return cpu_memory_rw_debug(cpu, addr, buf, len, - is_write ? MEM_DATA_STORE : MEM_DATA_LOAD); + + return cpu_memory_rw_debug(cpu, addr, buf, len, access_type); } enum { @@ -966,7 +968,8 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) break; } - if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, len, false) != 0) { + if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, + len, MEM_DATA_LOAD) != 0) { put_packet (s, "E14"); } else { memtohex(buf, mem_buf, len); @@ -988,7 +991,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) } hextomem(mem_buf, p, len); if (target_memory_rw_debug(s->g_cpu, addr, mem_buf, len, - true) != 0) { + MEM_DATA_STORE) != 0) { put_packet(s, "E14"); } else { put_packet(s, "OK");