From patchwork Thu Feb 15 14:46:21 2024 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: 772901 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp866492wre; Thu, 15 Feb 2024 06:47:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUL81C2TWIgiz1PXx078tGRG3QiNCIH+RSGUHY+kAD0l68BdWGUzrKL6DBJph9NTDJr589EvZkdjCqyKPCBnZfg X-Google-Smtp-Source: AGHT+IGRNWmQV1wMDG6ajfBu2qWXpT6O4+1HhbCEC7qkzKvNucUU8D1WZA1YIgWsxPnGjEx7fC+4 X-Received: by 2002:ac8:4e4a:0:b0:42d:d779:f14c with SMTP id e10-20020ac84e4a000000b0042dd779f14cmr664668qtw.11.1708008431960; Thu, 15 Feb 2024 06:47:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708008431; cv=none; d=google.com; s=arc-20160816; b=MNqAXKlvaGS5/MzK4RZoLRJmPrSJ1C2MP/QFocgr641ckQDX6FnVkmGgPB0Q/EiIkn rpxSRx9aqKWNnQbgQK86rcTH1umIq47D01s3X2CVXZFE2FcS/XhuwmIrLClL6KLUr2y8 7+gPH8KuyzYfP/dnKTJrbZafSqS/Qcb0c2RHvRFD3nUvk+ByrtMYBJvTOWI96KBC7v/O Egl2kPAjSV3RMnXbmT4IxarT/DHyKN4JOpbRUsDnlzQeo1dI9lcphVVS3EgOevVDaO31 kkYK9m61WIC3dObWvOVu9ppHP0q4X51rGu2oqTYxTH2AnBBfkku2Fxs0+JW0coLp5PG7 JQyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=BGKg1tIZ8Pmm8o3jSUHHCrdxf28mb3+tuXvQyvyxP5g=; fh=vKL7DoExp4lE8whkmUTvP6IrGDB6wJ9Hzl8dHrUtro4=; b=fL731HVguJ7g7BOkw+vLaagUekT5FjlqdFSriNd1aOXsla5EafFuZ2nsnph9doOLrK A1PF+KdEGf5CSOt9CFcP3VaT8RMYSEGDNL6YIriFGgASGyKxiGgC7g++3qNwduawrAl8 6XyvMp6wDKUUYfacMvez6Y2rBdXNwQbk7TEnuWInsKzrFKjlvgo4BbiEOeORSqZgvQ7d 9F3Oj0dZ4uH2YLhWCL34m2g6akUaSdDRJ2Sgi4U9QLjMZ8oxXPFmy7o8R1TOxgxGfTUU oOcPRd/BI+aEFjh02KTpzJErGAuUP6jgt5dZtfMgDLVjw2YLOIURXFZZl8B1yRLZPIPU X02Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jk3oC2Bo; 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 v26-20020a05622a189a00b0042c765ddf7bsi1564279qtc.801.2024.02.15.06.47.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 06:47:11 -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=jk3oC2Bo; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rad0k-0006oT-5x; Thu, 15 Feb 2024 09:46:50 -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 1rad0a-0006ic-Hc for qemu-devel@nongnu.org; Thu, 15 Feb 2024 09:46:46 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rad0Y-00072o-Vz for qemu-devel@nongnu.org; Thu, 15 Feb 2024 09:46:40 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-a26ed1e05c7so131763966b.2 for ; Thu, 15 Feb 2024 06:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708008396; x=1708613196; 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=BGKg1tIZ8Pmm8o3jSUHHCrdxf28mb3+tuXvQyvyxP5g=; b=jk3oC2BoqEi3TVE0K21CLxMOIRISoUrqGSsg+JPjN0adh5acvfLqoDbyfbcFFQ7Xau eoDJ2CmBKaUFmbHIDLUvYWFV1T96Kifzl/eEaeX1KFxeiMosNLXS4dSq9TfNfOGr7tmn FQ4gojLgp5t+WAitV1M4W/VbiCdQd5yAiW4mrvBnONdc2vWFJTbcwWEoOab6N3nwmhBR pDk1gydyClX+aesiNdfnItNmnqpLfxFkcjUCu4+xRrwqscMnZUokV3/5bObN1bqaqDD8 i/28wMojHyDItpn7tSr3QINMLlO56EYIN1axtEEHihK2SP8rjgSXMDlnkgwpQwVkj0HS VkQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708008396; x=1708613196; 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=BGKg1tIZ8Pmm8o3jSUHHCrdxf28mb3+tuXvQyvyxP5g=; b=bsfmxZlcudC4nzSWGwReetlznizH+5nVavcTuFc9Ti0MyCjMDYikKJl5Ljne/lcTIx qsrbpiHJugfTLyoj/hap3lh9zIxtKl2ZCWd9CpT7SpC0lyA+JzKNADKCIky+hFq+D06F cfScU3OD6ipkCEl/hfajecIQE49EhYegr0LawEM8tvVJKySvNazh4k6CxzXwNPBQJHPG EcNVmTJvbh66hSXckGacM+up81is/GWIWzFId+5gFoY6mdl+EAtHEBHx2V4ZS8vsv2zJ iKP8t4yEObM7ZeOzd+bCb21sXXzwc44ySEdJI5AaryL/gjVlF/t+vSKC/Bx2w3TSG8Dv XXlA== X-Gm-Message-State: AOJu0YzCxOaBeyGPT439I5TT9Rp4QNkCnatTSXdQxnRdDIGHxjqMGUZy kUw27lK5s0lCS80J3UPQFrIqZSqmvwZ7bLKS0Nrz4AxRBaCfTXA+wWKgnLas4VAKp++mFOX1qBg 3KIo= X-Received: by 2002:a17:906:370b:b0:a3d:254d:5aaa with SMTP id d11-20020a170906370b00b00a3d254d5aaamr1450284ejc.63.1708008396320; Thu, 15 Feb 2024 06:46:36 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id qk9-20020a170906d9c900b00a3ce60b003asm630467ejb.176.2024.02.15.06.46.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 06:46:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Cl=C3=A9ment_Chigot?= , Frederic Konrad , Mark Cave-Ayland , Artyom Tarasenko , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v5 2/3] hw/sparc/leon3: Pass DeviceState opaque argument to leon3_start_cpu() Date: Thu, 15 Feb 2024 15:46:21 +0100 Message-ID: <20240215144623.76233-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215144623.76233-1-philmd@linaro.org> References: <20240215144623.76233-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=philmd@linaro.org; helo=mail-ej1-x633.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, T_SCC_BODY_TEXT_LINE=-0.01 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 By passing a DeviceState context to a QDev IRQ handler, we can simplify and use qdev_init_gpio_in_named() instead of qdev_init_gpio_in_named_with_opaque(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Mark Cave-Ayland --- hw/sparc/leon3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index a15f90e142..44fca1487d 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -241,7 +241,8 @@ static void leon3_start_cpu_async_work(CPUState *cpu, run_on_cpu_data data) static void leon3_start_cpu(void *opaque, int n, int level) { - CPUState *cs = CPU(opaque); + DeviceState *cpu = opaque; + CPUState *cs = CPU(cpu); assert(level == 1); async_run_on_cpu(cs, leon3_start_cpu_async_work, RUN_ON_CPU_NULL); @@ -310,8 +311,7 @@ static void leon3_generic_hw_init(MachineState *machine) for (i = 0; i < machine->smp.cpus; i++) { cpu = reset_info->info[i].cpu; env = &cpu->env; - qdev_init_gpio_in_named_with_opaque(DEVICE(cpu), leon3_start_cpu, - cpu, "start_cpu", 1); + qdev_init_gpio_in_named(DEVICE(cpu), leon3_start_cpu, "start_cpu", 1); qdev_connect_gpio_out_named(irqmpdev, "grlib-start-cpu", i, qdev_get_gpio_in_named(DEVICE(cpu), "start_cpu", 0));