From patchwork Mon Feb 10 13:31:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 863762 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e42:0:b0:385:e875:8a9e with SMTP id r2csp1593423wrt; Mon, 10 Feb 2025 05:33:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWYnIb98KfK+sxYVpSMUji+BwloIzuD+OCQxgBONvrk5/kC6hFbrj/sUmQ8J3qGlfTOR8K62g==@linaro.org X-Google-Smtp-Source: AGHT+IHh/L50n8eLUM79oCVVIxGqF9qQ1lsIyFBQTK5HXU2FY+Ti6O315a5APR0pNax2gfJvzEsB X-Received: by 2002:ad4:5bc4:0:b0:6e4:2d8e:5cce with SMTP id 6a1803df08f44-6e4456dd4edmr226549566d6.36.1739194425104; Mon, 10 Feb 2025 05:33:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739194425; cv=none; d=google.com; s=arc-20240605; b=TFXgh9si8yVJQ7FgnLtSA5vvcWhUwXrkFxCQReoU/lVYe+90boLnJxvOzRVCu0MKrR hdhsUpFEampYvbsN69E8av3XcZ0NFx+OSiJ0OVRH7mhlOTiYculQXaGIKajAxXM+WpIb 47ahGrZYr1BXK8qcrz9BoW/DhhmvJkYDoGf1WewIwWsm8FhgpjZVQ38rBPih+Y+DlBDu 2Io8FZHdBLHO97wF1G71AqPOeRslX3WRDe38vBjxIc8j33itKI7b6RakH6o3xxEe/SHC ZV6Me+foeXfIox3mDxujMLSVN4FJGELcVyLiLKz/MAUBumtCiv8B+PyXWKn2Hg0QW0SZ +0nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=xBCJMHcPe/iIrLZobFxGzbZ4tBIo/mQI53ey/01FGoU=; fh=sJzkYwVzZpkx4ag4g1LGeg+dDwmiIurI0XYITRFPojk=; b=bIuSwhJFcrTsIYHFewRPiOvpxy4mpU595SRI/H4HbhSDt2GuMKa8kak6dxlhVpJqcU 9F18wgq13wDXW35cgQlljgnpTeJkZ1lWyEy6jSyZn2G7f+b4HkHb8NkkZUPTJSJpYUYi lJDU+4YEPe0JYt1Q3yfCbkn3YjwuDempWr/PbV1e7bzvHSP3XyiddpftMiQxBJHayPNZ Fmw3xtaWMyW+CrNfe8pmOikScSaAvcY1JIUWURe/I7hyazfQ8GDtyWSGzA1DfKQaWJo/ Lz8zHIM9e3yaZUw5iZKN8m7b2i+o4SDzHGBkjSLH9E5sYM3vHQj2ZxhDgnXKWhu2PjRv wkrQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NHIEZ1oG; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e44ecbda52si61855036d6.162.2025.02.10.05.33.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 10 Feb 2025 05:33:45 -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=pass header.i=@linaro.org header.s=google header.b=NHIEZ1oG; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1thTuO-0000PH-1L; Mon, 10 Feb 2025 08:33:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1thTtN-0008Mb-9s for qemu-devel@nongnu.org; Mon, 10 Feb 2025 08:32:07 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1thTtL-00069K-Gk for qemu-devel@nongnu.org; Mon, 10 Feb 2025 08:32:05 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4393dc02b78so8022945e9.3 for ; Mon, 10 Feb 2025 05:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739194321; x=1739799121; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xBCJMHcPe/iIrLZobFxGzbZ4tBIo/mQI53ey/01FGoU=; b=NHIEZ1oG9xHQJZvNKfpPFmXvLMKsWjMK6p0klRYQwaCjvJD9FGn84BOj6BEk6VT8vz KxSxnqcANMA3xg3vtKYMQzlW380q2FQClUQDAmCsmFoVyD9d+l7p/SQUoza6h/8PAXk1 xLgPACTWiCKrL0ak4Fr3kzXNa0KjYV1XQlhUq+PozOwyC4yyJZPNOJ9/B26vvXarqCUI IoxrI0Hn2SsSyV46KbXRglqs0HVepafF6CLgWvZFiiPjgS1G1FNPKvJ1yqoW+3/yR4rE Fu7pyTSr6trFUxHX7TlMklTGNSP+tOzOSnAL0yepETpOX6/7/cMHTgp3m+YYijY8YYI2 wpTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739194321; x=1739799121; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xBCJMHcPe/iIrLZobFxGzbZ4tBIo/mQI53ey/01FGoU=; b=XCFNCs7u3m19Rrd8vv0uYSZv9GNwpN9EYv4UL+xen2fbCIj9eNvzxS1/rAV2Whsexf dRn87Ud6/MHLry+3ID5lki+O3Tv3OdqRWk1ofAQKDeQfMw0TeRyV2Y7gA+lPeqU6kTau 8+jfCCjp/V8JzM/3m38E5HMh/YgzRkjwkv8z9hWT3RqV1aNpYO4zDjNR4qZ4WSzlccf4 fzg9Bmkfip4s3AQwn6htoNajbJLxqv8qJRtAoaa+mX08eeN1EZwmpmstADHKeHHgCROt /XlZ6uKq7Ke1zzzubCvVZk1HOjdH0VcS61bTcCzsFHoYyn0Wj5S5k50KAYuhaAduopfY Gunw== X-Gm-Message-State: AOJu0Ywld7kBXZtw2uBTJYqaAMnUAWVqmEHYln3gV/OweMH2RW75xJhT ABpNQmpr1dR0f+IuetsrJjBzXw20chnWvdXdksa2bVk7W/cIL4xplwLe/VZivNHSgHh9q5H64Ao tBiA= X-Gm-Gg: ASbGncuAiLBKsOIVTKRAuOb8JNV2ymp2rOcKdDFM/DPYZpacsitHlATEeiVRl3hPcQq oEykDy4WC1jnYkUiVBINfh5c+spLBdLcfPDzmhvz3Zaubj6RxpxN39kTbA/WeVsAkyl5tQfDmV+ fT+/CDLqzcAhPelsbt/a3L3WwT4U9IAvGpdsNH9kV17tCSIEAF82ykXCohg3al/jidZ4+PZQd8u 5kzKhiKajkQj9kwiA71CqPlcM+S5CGQ2+NaFhuhEfIlHkZJhW4B19IiE9lkXhYZAflxjQAeqcIf Bash/xlGoSRdj02nod96l9UMFZe4l6UfAeDhI3D4oRT1mZIgACspgreHsADQ5p8vh8ZFVfo= X-Received: by 2002:a05:600c:3b20:b0:434:a529:3b87 with SMTP id 5b1f17b1804b1-439249888aamr119936205e9.10.1739194320884; Mon, 10 Feb 2025 05:32:00 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4390d94d7c7sm179323265e9.14.2025.02.10.05.32.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 10 Feb 2025 05:32:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , qemu-riscv@nongnu.org Subject: [PATCH v2 05/11] target/riscv: Convert misa_mxl_max using GLib macros Date: Mon, 10 Feb 2025 14:31:28 +0100 Message-ID: <20250210133134.90879-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250210133134.90879-1-philmd@linaro.org> References: <20250210133134.90879-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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 Use GLib conversion macros to pass misa_mxl_max as riscv_cpu_class_init() class data. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- Cc: qemu-riscv@nongnu.org --- target/riscv/cpu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index f3ad7f88f0e..9fe1b23a297 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -2955,7 +2955,7 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) { RISCVCPUClass *mcc = RISCV_CPU_CLASS(c); - mcc->misa_mxl_max = (RISCVMXL)(uintptr_t)data; + mcc->misa_mxl_max = (RISCVMXL)GPOINTER_TO_UINT(data); riscv_cpu_validate_misa_mxl(mcc); } @@ -3057,7 +3057,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_DYNAMIC_CPU(type_name, misa_mxl_max, initfn) \ @@ -3066,7 +3066,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_DYNAMIC_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_VENDOR_CPU(type_name, misa_mxl_max, initfn) \ @@ -3075,7 +3075,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_VENDOR_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_BARE_CPU(type_name, misa_mxl_max, initfn) \ @@ -3084,7 +3084,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_BARE_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } #define DEFINE_PROFILE_CPU(type_name, misa_mxl_max, initfn) \ @@ -3093,7 +3093,7 @@ void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename) .parent = TYPE_RISCV_BARE_CPU, \ .instance_init = (initfn), \ .class_init = riscv_cpu_class_init, \ - .class_data = (void *)(misa_mxl_max) \ + .class_data = GUINT_TO_POINTER(misa_mxl_max) \ } static const TypeInfo riscv_cpu_type_infos[] = {