From patchwork Fri Sep 4 15:05:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 53121 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 7C67F22E23 for ; Fri, 4 Sep 2015 15:20:50 +0000 (UTC) Received: by lanb10 with SMTP id b10sf8349798lan.3 for ; Fri, 04 Sep 2015 08:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=bVhEX6BMecFBljGkm20mFeTbm7OpwagXCom3V+bENDQ=; b=IoOelBVU5Z4G1N5GICDxNrtmwBxCUz64y/RrRwDS1/AuLcx9XpShLpsW00CzVQ5TxR 4bKIWmcjDR1tNIvE2Z8FCp2CU8hfpFexnQ01MrESvtADpIYwAdLnWjmuvYd2cy+17aFK 1uvbD3BQbFp+q22hLUd9yfp5bZ6yV6mVj0qPOCcMKKRvwtAlIEBlnACRTtVlX5w1YHJV o6Sltccia+qvyiH8mMakxSoOXZBECovocthdXnwT9h2jntrRP8BxjgyiXNqe1PkVbNH5 5ndiVgc6+izxvTrSR3Hd5Gr2KYRoyYRioFX+mb7xLEvf21NR++jjg8YuHarvjbMLMdy0 0Kug== X-Gm-Message-State: ALoCoQkfCeEIuq8LAa8s/1SjiPIjw2KCh2hDR0igbPSLeulgCxrBJI2kr/cdZEIi/mPwI6xQp76h X-Received: by 10.194.76.6 with SMTP id g6mr1193269wjw.1.1441380049408; Fri, 04 Sep 2015 08:20:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls393597lac.79.gmail; Fri, 04 Sep 2015 08:20:49 -0700 (PDT) X-Received: by 10.152.7.237 with SMTP id m13mr4063577laa.39.1441380049246; Fri, 04 Sep 2015 08:20:49 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id y9si2591046lae.11.2015.09.04.08.20.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Sep 2015 08:20:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcjc2 with SMTP id jc2so13167887lbc.0 for ; Fri, 04 Sep 2015 08:20:49 -0700 (PDT) X-Received: by 10.152.18.194 with SMTP id y2mr4223586lad.88.1441380049149; Fri, 04 Sep 2015 08:20:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.164.42 with SMTP id yn10csp2054568lbb; Fri, 4 Sep 2015 08:20:48 -0700 (PDT) X-Received: by 10.55.24.78 with SMTP id j75mr6025440qkh.95.1441380048291; Fri, 04 Sep 2015 08:20:48 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 207si3156057qhx.1.2015.09.04.08.20.47 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 04 Sep 2015 08:20:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60666 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsnH-0002T8-2R for patch@linaro.org; Fri, 04 Sep 2015 11:20:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsZF-0000DR-Je for qemu-devel@nongnu.org; Fri, 04 Sep 2015 11:06:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXsZA-0000sI-Nu for qemu-devel@nongnu.org; Fri, 04 Sep 2015 11:06:17 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:35023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXsZA-0000iE-Ec for qemu-devel@nongnu.org; Fri, 04 Sep 2015 11:06:12 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZXsYu-0006Ey-Dk for qemu-devel@nongnu.org; Fri, 04 Sep 2015 16:05:56 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 4 Sep 2015 16:05:35 +0100 Message-Id: <1441379156-23939-7-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1441379156-23939-1-git-send-email-peter.maydell@linaro.org> References: <1441379156-23939-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:8b0:1d0::1 Subject: [Qemu-devel] [PULL 06/27] include/exec/softmmu-semi.h: Add support for 64-bit values X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Add support for getting and setting 64-bit values in the softmmu semihosting support functions. This will be needed for 64-bit ARM semihosting. Signed-off-by: Peter Maydell Tested-by: Christopher Covington Message-id: 1439483745-28752-6-git-send-email-peter.maydell@linaro.org --- include/exec/softmmu-semi.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/exec/softmmu-semi.h b/include/exec/softmmu-semi.h index 1819cc2..3a58c3f 100644 --- a/include/exec/softmmu-semi.h +++ b/include/exec/softmmu-semi.h @@ -9,6 +9,14 @@ #ifndef SOFTMMU_SEMI_H #define SOFTMMU_SEMI_H 1 +static inline uint64_t softmmu_tget64(CPUArchState *env, target_ulong addr) +{ + uint64_t val; + + cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 8, 0); + return tswap64(val); +} + static inline uint32_t softmmu_tget32(CPUArchState *env, target_ulong addr) { uint32_t val; @@ -16,6 +24,7 @@ static inline uint32_t softmmu_tget32(CPUArchState *env, target_ulong addr) cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 4, 0); return tswap32(val); } + static inline uint32_t softmmu_tget8(CPUArchState *env, target_ulong addr) { uint8_t val; @@ -24,16 +33,25 @@ static inline uint32_t softmmu_tget8(CPUArchState *env, target_ulong addr) return val; } +#define get_user_u64(arg, p) ({ arg = softmmu_tget64(env, p); 0; }) #define get_user_u32(arg, p) ({ arg = softmmu_tget32(env, p) ; 0; }) #define get_user_u8(arg, p) ({ arg = softmmu_tget8(env, p) ; 0; }) #define get_user_ual(arg, p) get_user_u32(arg, p) +static inline void softmmu_tput64(CPUArchState *env, + target_ulong addr, uint64_t val) +{ + val = tswap64(val); + cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 8, 1); +} + static inline void softmmu_tput32(CPUArchState *env, target_ulong addr, uint32_t val) { val = tswap32(val); cpu_memory_rw_debug(ENV_GET_CPU(env), addr, (uint8_t *)&val, 4, 1); } +#define put_user_u64(arg, p) ({ softmmu_tput64(env, p, arg) ; 0; }) #define put_user_u32(arg, p) ({ softmmu_tput32(env, p, arg) ; 0; }) #define put_user_ual(arg, p) put_user_u32(arg, p)