From patchwork Sat Nov 30 08:45:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 180521 Delivered-To: patch@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp2644972ile; Sat, 30 Nov 2019 00:54:27 -0800 (PST) X-Google-Smtp-Source: APXvYqx48qTcK8SUh8z9Mpvataf7GueQf36L88hBeEYJ7cxCtgiHUx6IMAS8VQ+h/WFTuOVG5wyR X-Received: by 2002:a17:906:69d2:: with SMTP id g18mr60169607ejs.153.1575104066936; Sat, 30 Nov 2019 00:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575104066; cv=none; d=google.com; s=arc-20160816; b=Fe2ts8lx3rFpAQ5uYBk25l2oktSTZiJcPFcpARfiVzdthtO+uSlB021SGFUjJEZmoe I17MFk0ABizwy9fhpjlkQpBF6UVs1nRCc3PSzKrJtDIijGkFKy/NrAvCnmo5CgUiGETg Izgnel327GXJ3g/vpwMpcZaQyxUE+J8cQH99/WW3W/+yxd3X1Y8Tl2fj9IAMr9LF3WT+ YQPwfUzLfb6xJYVsSLzD0IzgbBX3jQWZs0s1xt81QRs7Ta9v/XRd5dF5qnNLME6szKEH 6nWmR2UnKNvoMZQzXNPUFZDTp0Uv+7uRw/+9ODZTMKg3iPDXz/Lso0zDqC0CzlaQmHKV 7JYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/oYMZm4PMhPvYkXOCpY3r3pyiwYZIMr8ITabnwYT2cc=; b=U2Odz49RDjaezc2bND7ecEpyRF/Mq9J5zn8ok1KWob0trJUNAH1efZ8/Pe4gO7VHGq FJJ0CMUarhWpz4hQTMtxoRK9pet2keEsA/gjH3BM0m3LNrKdzAVxIfUxVwogN79NvhaZ n4WBumlTBnlDBkZ28yo7jb6kEGk35UCm9P9UgTjZMYi4H2FfgVgbfzdBqY4wqxrjcn6Q LwGqPCdRgHzDDYDueCowL39pEfZuk0JqcXqZH4Hn0pgU/p+tPOs5igPfJ3jfelunDtzN AkkUzL+yiNOh35/u5jtqwcH3UwBHx8jlXO2ROw0zKwBlai6JkWCqAB8kA288HhsYuTl+ AK+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OBbAsR6Q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s17si17692026edq.25.2019.11.30.00.54.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 30 Nov 2019 00:54:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OBbAsR6Q; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iayWH-0004WF-R5 for patch@linaro.org; Sat, 30 Nov 2019 03:54:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57754) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iayOT-000312-Bp for qemu-devel@nongnu.org; Sat, 30 Nov 2019 03:46:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iayOR-0003NM-79 for qemu-devel@nongnu.org; Sat, 30 Nov 2019 03:46:21 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:50219) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iayOP-0003Jp-B9 for qemu-devel@nongnu.org; Sat, 30 Nov 2019 03:46:17 -0500 Received: by mail-wm1-x341.google.com with SMTP id l17so16314092wmh.0 for ; Sat, 30 Nov 2019 00:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/oYMZm4PMhPvYkXOCpY3r3pyiwYZIMr8ITabnwYT2cc=; b=OBbAsR6QVTpGDfkUR3PPmCRUwDZ/Aw/zx0VEUQ3Zz1oPgxRlTGCftDd/ajxXCwdBSz RI3POHzojjFJDSbgTwQjwmGRdfwFKaWHLJ2uQV4sUBmEDNT4l4+Up03BQFV3rbYMChTL EohhCJOR8QN4DXTRpxCRRdEiXbIppRXwx5XR5W2f8Ycuyk0ot8cCJCLwsrdDkmgVIDB/ wbxTUXEpf7LA/A12CvvLldk1bcYzc2wnmOM71EEuA1gGwxFxsue3NHVhlvttZCbM52Qq 9Xz84RA+NWMZyQZdRUt4WTuEwSE98S2RHmShH2UUzR0rkrHbvICSDHTt1fED+5j7j2Il OvPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/oYMZm4PMhPvYkXOCpY3r3pyiwYZIMr8ITabnwYT2cc=; b=udkxfwqli6G0ES+0D46t2NJKmiauMDtWaEasGWh/jVXx3aMkZyM5wZ30r+aAJlCI/H u8bIr+P0eM4T3LnG300+3eez9wdihGpuCBR4f1LWUFpqjjna3Y8i7Y+wcTSujZkumx0Y Do0PKA7Zfs9mhz3jZeqM4guIrbfKbmRCdFCSbti+CJWnU5P8NL1+89GzU7Oykk+Qk3IR 621VD+ScQy7k2oBs2zMlKzzmwaBWfkgbfxHLwqCmWzY98oc4rlEELO360vLTz1VCWrjy MzHLLtxjoM/Na1lBGpj9MZd5DeRGkLlq+9w7ayszBCPcbNb4z7DDIXB+qlIbSFjXoUYl dh3w== X-Gm-Message-State: APjAAAXxiO6uwoP8cJYYnhuIqnk43LBbKrkt/g3LUyn7Nb3VWmk1q1DI nHw2EIQplQvHqXIGw91kdw0zXQ== X-Received: by 2002:a1c:9a8b:: with SMTP id c133mr18188441wme.82.1575103574569; Sat, 30 Nov 2019 00:46:14 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v15sm15648602wmh.24.2019.11.30.00.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 00:46:13 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1BC171FF96; Sat, 30 Nov 2019 08:46:04 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 07/14] target/m68k: use gdb_get_reg helpers Date: Sat, 30 Nov 2019 08:45:55 +0000 Message-Id: <20191130084602.10818-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191130084602.10818-1-alex.bennee@linaro.org> References: <20191130084602.10818-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: damien.hedde@greensocs.com, luis.machado@linaro.org, richard.henderson@linaro.org, Laurent Vivier , alan.hayward@arm.com, =?utf-8?q?A?= =?utf-8?q?lex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is cleaner than poking memory directly and will make later clean-ups easier. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- target/m68k/helper.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) -- 2.20.1 diff --git a/target/m68k/helper.c b/target/m68k/helper.c index ae766a6cb0b..70b0c0b5076 100644 --- a/target/m68k/helper.c +++ b/target/m68k/helper.c @@ -72,19 +72,15 @@ static int cf_fpu_gdb_get_reg(CPUM68KState *env, uint8_t *mem_buf, int n) { if (n < 8) { float_status s; - stfq_p(mem_buf, floatx80_to_float64(env->fregs[n].d, &s)); - return 8; + return gdb_get_reg64(buf, floatx80_to_float64(env->fregs[n].d, &s)); } switch (n) { case 8: /* fpcontrol */ - stl_be_p(mem_buf, env->fpcr); - return 4; + return gdb_get_reg32(buf, env->fpcr); case 9: /* fpstatus */ - stl_be_p(mem_buf, env->fpsr); - return 4; + return gdb_get_reg32(buf, env->fpsr); case 10: /* fpiar, not implemented */ - memset(mem_buf, 0, 4); - return 4; + return gdb_get_reg32(buf, 0); } return 0; } @@ -112,21 +108,18 @@ static int cf_fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n) static int m68k_fpu_gdb_get_reg(CPUM68KState *env, uint8_t *mem_buf, int n) { if (n < 8) { - stw_be_p(mem_buf, env->fregs[n].l.upper); - memset(mem_buf + 2, 0, 2); - stq_be_p(mem_buf + 4, env->fregs[n].l.lower); - return 12; + int len = gdb_get_reg16(buf, env->fregs[n].l.upper); + len += gdb_get_reg16(buf, 0); + len += gdb_get_reg64(buf, env->fregs[n].l.lower); + return len; } switch (n) { case 8: /* fpcontrol */ - stl_be_p(mem_buf, env->fpcr); - return 4; + return gdb_get_reg32(buf, env->fpcr); case 9: /* fpstatus */ - stl_be_p(mem_buf, env->fpsr); - return 4; + return gdb_get_reg32(buf, env->fpsr); case 10: /* fpiar, not implemented */ - memset(mem_buf, 0, 4); - return 4; + return gdb_get_reg32(buf, 0); } return 0; }