From patchwork Wed May 26 23:46:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 448333 Delivered-To: patch@linaro.org Received: by 2002:a17:907:2b0d:0:0:0:0 with SMTP id gc13csp6046793ejc; Wed, 26 May 2021 16:54:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz99uiOOaQDkZbqjJdQOoBvi4s+4NDFeT0tkyJemqDtwVWFiRbE+Oh+TONDSxRvxcMbFSGF X-Received: by 2002:a25:d994:: with SMTP id q142mr782215ybg.93.1622073266957; Wed, 26 May 2021 16:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622073266; cv=none; d=google.com; s=arc-20160816; b=qiMXE252iI03Uyx+szNaEOw6ctI49Kx2Uhh1wN+7O199hf6coXlilUOuUil4eilObY e96E0REfgi/Wvbtw68iDhaX1FxkqP3XdCp2RgytNl8hf1LXGhL7TNS1LMZSUXHp7j7K+ i+1J39NVwQzT1yedrc+KCHIMsV8UpwlJgcmGyKmAPlYuGzT4dLHB45ABBz5tzBccUYde UGVb7Jd3OVFSnOebckMAJPbXU0r6VHj5g9erCmKVUARFAVY6sOfWbn4Ko9p9VSMkDKNA rL1FtF4RZLWGoubJRwOqjlNlBq2QH9G6sAfozMl06b6JbxAp13We+DMLZKx/JoF3uxsC aehA== 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=UcCXa7GKI4W/d3/jlaSrG0mCq3KpdgKzNszQYbsDFeI=; b=WRQl8/bwIHyJem8JNpPHZ5VIuaZXf3DboUcIsemlWXR11ERJo0qsWDE3XVC2a8qWmZ Uu3TLg1PeTzWsY0hFj3CEheq5FIrz5dJMKex0JQL0htW0DElcqIq+q+ib1oucjWLQxSp 52B2tOsR4QcYDmVJpmp4EMdM4tCSJVgQfX5sINJEcXQMOY9agBr+kuKNDKCI3MzpcvYN kHfRqSHoa/oCG+AkJXMlxT00bh5YfYHyf6Vqup27UZQVRw/732YRYOV2S3d/vu1y64Nk Y0V6dATgEyoR3pwPq5DSKVQ6Nl8fJ82Wqpqan5mXKOnHeHTL+JeHmK/IiRacYI6lhUYe JohA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QFsGZAO3; 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=pass (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 a207si668958ybg.138.2021.05.26.16.54.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 May 2021 16:54:26 -0700 (PDT) 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=pass header.i=@linaro.org header.s=google header.b=QFsGZAO3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm3M2-0000ip-8U for patch@linaro.org; Wed, 26 May 2021 19:54:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm3FI-0005br-2h for qemu-devel@nongnu.org; Wed, 26 May 2021 19:47:29 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]:33430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lm3F7-0004Rx-5q for qemu-devel@nongnu.org; Wed, 26 May 2021 19:47:27 -0400 Received: by mail-pj1-x102e.google.com with SMTP id v13-20020a17090abb8db029015f9f7d7290so4456111pjr.0 for ; Wed, 26 May 2021 16:47:16 -0700 (PDT) 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=UcCXa7GKI4W/d3/jlaSrG0mCq3KpdgKzNszQYbsDFeI=; b=QFsGZAO3YYJWh5kh9+psjXK7Io4S8d/t1TEkXOHidtNQPQK0Zr0RGZ2UdSEO8wzv21 yzOAaPQfS9gSGb9pdfNQOqR1U/A+FSRdXKx92L6uVvZGszh/C/pGmESZ3iEYfUfWuTze IYS4dqu63fivPzjFQ91jhxRU8bas+bFagzlyUGMBQ8blwRQ7A+Gk79QyD0Y5fiXiD3J8 y7CBBsojMjTZa+JQAU8bk+DyK3YnldqNzjpDJQBL5uFgxFru8lFs/+gO4leYZLlRdiwT 2aAyvIWsx0gdwixR9DhhHExjXJ5wlMq0a/GO4Yuf2KzeY8gcmIal7dAk5z06sFM41zwD o5GA== 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=UcCXa7GKI4W/d3/jlaSrG0mCq3KpdgKzNszQYbsDFeI=; b=jPMkVjfUUPTxCD1OfcWvQ/qxCzZ+YB1ZzngPHo9nZclbd53qjkeiGFw1apjow8XKUZ 4adLjdxILatP8/DdIrF57zgE57sPmAfzdekO1GcdpczkkC+vVm2/JdnEJN0O0chsBcXq 4LQ6151rm2WjPUm95obI7FHJ3xj3EJSzJ2KKCJJbYYSOZYw703ZnT/0glNb5a/TMiULM xnW83pJczVyQU+Ol0ZqPp30EIcGRcxRJ0RtKx86FK8WCcHiZb/KoduAX+IiRWyZMWEbi cTtGu1M79RZ21VCKNhaD/a92ImxBUX1xBnh9u7ELIcLTaIuXYgXa6QjNgpuZrZ5kPFhX ed3A== X-Gm-Message-State: AOAM5339GkK6Nsr4CcnTxpZJSYOQcXLeDYxH8K+7YB8HXrsd0B4hXc+5 teDdwPZEJaite4IgMSdPZhi3cCrfi6fSIw== X-Received: by 2002:a17:90b:70c:: with SMTP id s12mr692672pjz.98.1622072835834; Wed, 26 May 2021 16:47:15 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id g13sm285355pfi.18.2021.05.26.16.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 16:47:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 03/31] exec/memory_ldst: Use correct type sizes Date: Wed, 26 May 2021 16:46:42 -0700 Message-Id: <20210526234710.125396-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210526234710.125396-1-richard.henderson@linaro.org> References: <20210526234710.125396-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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: peter.maydell@linaro.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Use uint8_t for (unsigned) byte, and uint16_t for (unsigned) 16-bit word. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20210518183655.1711377-4-philmd@redhat.com> Signed-off-by: Richard Henderson --- include/exec/memory_ldst.h.inc | 16 ++++++++-------- memory_ldst.c.inc | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) -- 2.25.1 diff --git a/include/exec/memory_ldst.h.inc b/include/exec/memory_ldst.h.inc index 46e6c220d3..7c3a641f7e 100644 --- a/include/exec/memory_ldst.h.inc +++ b/include/exec/memory_ldst.h.inc @@ -20,7 +20,7 @@ */ #ifdef TARGET_ENDIANNESS -extern uint32_t glue(address_space_lduw, SUFFIX)(ARG1_DECL, +extern uint16_t glue(address_space_lduw, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); extern uint32_t glue(address_space_ldl, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); @@ -29,17 +29,17 @@ extern uint64_t glue(address_space_ldq, SUFFIX)(ARG1_DECL, extern void glue(address_space_stl_notdirty, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stw, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stl, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stq, SUFFIX)(ARG1_DECL, hwaddr addr, uint64_t val, MemTxAttrs attrs, MemTxResult *result); #else -extern uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, +extern uint8_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); -extern uint32_t glue(address_space_lduw_le, SUFFIX)(ARG1_DECL, +extern uint16_t glue(address_space_lduw_le, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); -extern uint32_t glue(address_space_lduw_be, SUFFIX)(ARG1_DECL, +extern uint16_t glue(address_space_lduw_be, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); extern uint32_t glue(address_space_ldl_le, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); @@ -50,11 +50,11 @@ extern uint64_t glue(address_space_ldq_le, SUFFIX)(ARG1_DECL, extern uint64_t glue(address_space_ldq_be, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stb, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); + hwaddr addr, uint8_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stw_le, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stw_be, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stl_le, SUFFIX)(ARG1_DECL, hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result); extern void glue(address_space_stl_be, SUFFIX)(ARG1_DECL, diff --git a/memory_ldst.c.inc b/memory_ldst.c.inc index b56e961967..84b868f294 100644 --- a/memory_ldst.c.inc +++ b/memory_ldst.c.inc @@ -157,7 +157,7 @@ uint64_t glue(address_space_ldq_be, SUFFIX)(ARG1_DECL, DEVICE_BIG_ENDIAN); } -uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, +uint8_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { uint8_t *ptr; @@ -193,7 +193,7 @@ uint32_t glue(address_space_ldub, SUFFIX)(ARG1_DECL, } /* warning: addr must be aligned */ -static inline uint32_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, +static inline uint16_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result, enum device_endian endian) { @@ -240,21 +240,21 @@ static inline uint32_t glue(address_space_lduw_internal, SUFFIX)(ARG1_DECL, return val; } -uint32_t glue(address_space_lduw, SUFFIX)(ARG1_DECL, +uint16_t glue(address_space_lduw, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { return glue(address_space_lduw_internal, SUFFIX)(ARG1, addr, attrs, result, DEVICE_NATIVE_ENDIAN); } -uint32_t glue(address_space_lduw_le, SUFFIX)(ARG1_DECL, +uint16_t glue(address_space_lduw_le, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { return glue(address_space_lduw_internal, SUFFIX)(ARG1, addr, attrs, result, DEVICE_LITTLE_ENDIAN); } -uint32_t glue(address_space_lduw_be, SUFFIX)(ARG1_DECL, +uint16_t glue(address_space_lduw_be, SUFFIX)(ARG1_DECL, hwaddr addr, MemTxAttrs attrs, MemTxResult *result) { return glue(address_space_lduw_internal, SUFFIX)(ARG1, addr, attrs, result, @@ -366,7 +366,7 @@ void glue(address_space_stl_be, SUFFIX)(ARG1_DECL, } void glue(address_space_stb, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) + hwaddr addr, uint8_t val, MemTxAttrs attrs, MemTxResult *result) { uint8_t *ptr; MemoryRegion *mr; @@ -398,7 +398,7 @@ void glue(address_space_stb, SUFFIX)(ARG1_DECL, /* warning: addr must be aligned */ static inline void glue(address_space_stw_internal, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result, enum device_endian endian) { uint8_t *ptr; @@ -441,21 +441,21 @@ static inline void glue(address_space_stw_internal, SUFFIX)(ARG1_DECL, } void glue(address_space_stw, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result) { glue(address_space_stw_internal, SUFFIX)(ARG1, addr, val, attrs, result, DEVICE_NATIVE_ENDIAN); } void glue(address_space_stw_le, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result) { glue(address_space_stw_internal, SUFFIX)(ARG1, addr, val, attrs, result, DEVICE_LITTLE_ENDIAN); } void glue(address_space_stw_be, SUFFIX)(ARG1_DECL, - hwaddr addr, uint32_t val, MemTxAttrs attrs, MemTxResult *result) + hwaddr addr, uint16_t val, MemTxAttrs attrs, MemTxResult *result) { glue(address_space_stw_internal, SUFFIX)(ARG1, addr, val, attrs, result, DEVICE_BIG_ENDIAN);