From patchwork Mon May 26 07:19:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 30920 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4997420491 for ; Mon, 26 May 2014 07:59:42 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf28750222vcb.7 for ; Mon, 26 May 2014 00:59:42 -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:cc: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=hE2Q26KQlQBxiQRU1nWMbewhiaHEhMPuba22lxSWZXY=; b=b0H1IrYABf4M5x5n6TKXwXXwmA2cGBQD/499a0aTCNO4o51bGZYMeW2/2l57EjuT+k 9/sT/qqGbf8ke3reGdOVQKTez+7JgdGmHWQ2WG+/IM+1v4LKUW6geDnKTa72BsUb3rhL bgRe2P/1QOErM7W2JvSs7hL0+trhoUNJKoM4ljYG42/eUi5EMGb/1X2Lwt+iZyP06gCY j5amfPW6tpljQJYWcAJnK/sgQOF+nerRIJlAt5dGQ5voCeujgP7Ht4O4z6qYrpYvDqdi KbSTunD56MEGjzsOQTi7uCyrxBRdixTQ3jbKSW9WVDkH6k0pi+K8kJNIfIVrnqQ2khoB RhPA== X-Gm-Message-State: ALoCoQnHLE46HkD4HpeGs4TySOhj6tS+bP8Yd1aPSX04AEtdEREB5HxgyXIJBTeMgbF1/Yb9Bfk0 X-Received: by 10.236.83.161 with SMTP id q21mr8427654yhe.41.1401091182044; Mon, 26 May 2014 00:59:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.29.4 with SMTP id a4ls2633559qga.45.gmail; Mon, 26 May 2014 00:59:41 -0700 (PDT) X-Received: by 10.58.25.6 with SMTP id y6mr5193965vef.48.1401091181884; Mon, 26 May 2014 00:59:41 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id bo13si5881769vdb.31.2014.05.26.00.59.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 00:59:41 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id sa20so9058169veb.27 for ; Mon, 26 May 2014 00:59:41 -0700 (PDT) X-Received: by 10.58.243.72 with SMTP id ww8mr5067907vec.49.1401091181802; Mon, 26 May 2014 00:59:41 -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.220.221.72 with SMTP id ib8csp24871vcb; Mon, 26 May 2014 00:59:41 -0700 (PDT) X-Received: by 10.229.79.2 with SMTP id n2mr29856833qck.11.1401091181256; Mon, 26 May 2014 00:59:41 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p68si12191061qga.89.2014.05.26.00.59.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 26 May 2014 00:59:41 -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]:55083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wopoq-0007uz-U8 for patch@linaro.org; Mon, 26 May 2014 03:59:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WopmV-0004bq-Vw for qemu-devel@nongnu.org; Mon, 26 May 2014 03:57:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WopmR-0001Wt-Eg for qemu-devel@nongnu.org; Mon, 26 May 2014 03:57:15 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:40927) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WopmQ-0001WB-Pc; Mon, 26 May 2014 03:57:11 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id A1BD242FAF; Mon, 26 May 2014 11:57:09 +0400 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.corpit.ru (Postfix) with SMTP id 49A96666; Mon, 26 May 2014 11:20:14 +0400 (MSK) Received: (nullmailer pid 22999 invoked by uid 1000); Mon, 26 May 2014 07:20:13 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 26 May 2014 11:19:54 +0400 Message-Id: <1401088811-22923-7-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1401088811-22923-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1401088811-22923-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Peter Maydell , Michael Tokarev Subject: [Qemu-devel] [PULL 06/23] bswap.h: Rename ldl_p, stl_p, etc to ldl_he_p, stl_he_p, etc 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: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) smtp.mail=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 From: Peter Maydell We have an unfortunate naming clash between the functions ldl_p, stl_p, etc defined in bswap.h (which have semantics "load/store in host endianness") and the #defines of the same name in cpu-all.h (which have the semantics "load/store in target endianness"). Fortunately it turns out that the only users of the bswap.h functions are all within bswap.h itself, so we can simply rename them to include a _he_ infix for "host endianness". Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Signed-off-by: Michael Tokarev --- include/qemu/bswap.h | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 0f9c6cf..78c1ced 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -215,9 +215,10 @@ typedef union { * q: 64 bits * * endian is: - * (empty): host endian + * he : host endian * be : big endian * le : little endian + * (except for byte accesses, which have no endian infix). */ static inline int ldub_p(const void *ptr) @@ -239,82 +240,82 @@ static inline void stb_p(void *ptr, uint8_t v) operations. Thus we don't need to play games with packed attributes, or inline byte-by-byte stores. */ -static inline int lduw_p(const void *ptr) +static inline int lduw_he_p(const void *ptr) { uint16_t r; memcpy(&r, ptr, sizeof(r)); return r; } -static inline int ldsw_p(const void *ptr) +static inline int ldsw_he_p(const void *ptr) { int16_t r; memcpy(&r, ptr, sizeof(r)); return r; } -static inline void stw_p(void *ptr, uint16_t v) +static inline void stw_he_p(void *ptr, uint16_t v) { memcpy(ptr, &v, sizeof(v)); } -static inline int ldl_p(const void *ptr) +static inline int ldl_he_p(const void *ptr) { int32_t r; memcpy(&r, ptr, sizeof(r)); return r; } -static inline void stl_p(void *ptr, uint32_t v) +static inline void stl_he_p(void *ptr, uint32_t v) { memcpy(ptr, &v, sizeof(v)); } -static inline uint64_t ldq_p(const void *ptr) +static inline uint64_t ldq_he_p(const void *ptr) { uint64_t r; memcpy(&r, ptr, sizeof(r)); return r; } -static inline void stq_p(void *ptr, uint64_t v) +static inline void stq_he_p(void *ptr, uint64_t v) { memcpy(ptr, &v, sizeof(v)); } static inline int lduw_le_p(const void *ptr) { - return (uint16_t)le_bswap(lduw_p(ptr), 16); + return (uint16_t)le_bswap(lduw_he_p(ptr), 16); } static inline int ldsw_le_p(const void *ptr) { - return (int16_t)le_bswap(lduw_p(ptr), 16); + return (int16_t)le_bswap(lduw_he_p(ptr), 16); } static inline int ldl_le_p(const void *ptr) { - return le_bswap(ldl_p(ptr), 32); + return le_bswap(ldl_he_p(ptr), 32); } static inline uint64_t ldq_le_p(const void *ptr) { - return le_bswap(ldq_p(ptr), 64); + return le_bswap(ldq_he_p(ptr), 64); } static inline void stw_le_p(void *ptr, uint16_t v) { - stw_p(ptr, le_bswap(v, 16)); + stw_he_p(ptr, le_bswap(v, 16)); } static inline void stl_le_p(void *ptr, uint32_t v) { - stl_p(ptr, le_bswap(v, 32)); + stl_he_p(ptr, le_bswap(v, 32)); } static inline void stq_le_p(void *ptr, uint64_t v) { - stq_p(ptr, le_bswap(v, 64)); + stq_he_p(ptr, le_bswap(v, 64)); } /* float access */ @@ -349,37 +350,37 @@ static inline void stfq_le_p(void *ptr, float64 v) static inline int lduw_be_p(const void *ptr) { - return (uint16_t)be_bswap(lduw_p(ptr), 16); + return (uint16_t)be_bswap(lduw_he_p(ptr), 16); } static inline int ldsw_be_p(const void *ptr) { - return (int16_t)be_bswap(lduw_p(ptr), 16); + return (int16_t)be_bswap(lduw_he_p(ptr), 16); } static inline int ldl_be_p(const void *ptr) { - return be_bswap(ldl_p(ptr), 32); + return be_bswap(ldl_he_p(ptr), 32); } static inline uint64_t ldq_be_p(const void *ptr) { - return be_bswap(ldq_p(ptr), 64); + return be_bswap(ldq_he_p(ptr), 64); } static inline void stw_be_p(void *ptr, uint16_t v) { - stw_p(ptr, be_bswap(v, 16)); + stw_he_p(ptr, be_bswap(v, 16)); } static inline void stl_be_p(void *ptr, uint32_t v) { - stl_p(ptr, be_bswap(v, 32)); + stl_he_p(ptr, be_bswap(v, 32)); } static inline void stq_be_p(void *ptr, uint64_t v) { - stq_p(ptr, be_bswap(v, 64)); + stq_he_p(ptr, be_bswap(v, 64)); } /* float access */