From nobody Sat Feb 7 06:21:05 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1725679239; cv=none; d=zohomail.com; s=zohoarc; b=C1c4NUyEMwEza47Tc4+U5Q/FhSwQQy9zMChz0717dxpc6dfpAIHW+8upyOUz/YFk8XCqy+eG66Dy+Bza8oXoGaX3PF2f1QRcWWgrOkevx2Ufb6qEpvi+DIi9k5GF4nBmqDvEgYe4gZf+1V80FyKdAuijHKIQkh+YtTjMjAwurM8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725679239; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=eb2IXxxnHK/KXo5R/L/8Ek9ID/ZcfvZRBf6/jcc1+Bk=; b=N171PPsRUEz0AlQd9jHZjEgA2lxy20cwALSdAL2QEXTloArN/sIEwECmOqHjrXaQp+v2X1aZ3LRZRn+HLmB6zJAlaCAVKruG6kmngLzqI8h5M/k3MPnp4yi/1a0CSD2ZZkC6mQXUzRX1OqtZdNSUuWjXbWHgkdeHizo6xVIZchc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172567923973246.61026469514297; Fri, 6 Sep 2024 20:20:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smlzc-0003Wi-F9; Fri, 06 Sep 2024 23:20:09 -0400 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 1smlzJ-0002yI-5N for qemu-devel@nongnu.org; Fri, 06 Sep 2024 23:19:49 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smlzH-0004qv-4P for qemu-devel@nongnu.org; Fri, 06 Sep 2024 23:19:48 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7179069d029so1966815b3a.2 for ; Fri, 06 Sep 2024 20:19:46 -0700 (PDT) Received: from localhost.localdomain (115-64-160-35.tpgi.com.au. [115.64.160.35]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710f1d4c6sm1703745ad.187.2024.09.06.20.19.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2024 20:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725679185; x=1726283985; 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=eb2IXxxnHK/KXo5R/L/8Ek9ID/ZcfvZRBf6/jcc1+Bk=; b=ITauzYvibaIMCFfzeUjT1FNRQxoHWBOEZayjkDje2BbeZPIGBTt+J3bVvdzad8QG3/ 1a93RjFoq5E1Ttn5FewUmCQRopZoM9byZ6ih2NiLrC79ts1qJ7SDCs917+/p0PZFpq2x BL3ym8kZ61c5Ub5jo9sx8NoZ7moeFTBqeTv6MB/cONiZzLLSFFuheRG0UzVzLfehD1YT TllKgeR2B/e5wJ0z5/h6eoY0uw7EKqo+1YXLbZPU6opFZ/f2Q5zRZwY1xT5zzVeR6Xuk cTMgCsHEFM1k2J8dzXqts9vjor5D8+w7RnJFSZUL91tKBcw6lh8TB8vh5NFSMznADzBH +ZTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725679185; x=1726283985; 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=eb2IXxxnHK/KXo5R/L/8Ek9ID/ZcfvZRBf6/jcc1+Bk=; b=KzBOhkQYPnE1WKllMWHfTGlm2S7BE/sNJjxWJhyW7wFvrIWbD+WMkya16OUHddkVoA qXGDzrQjSj4quL68y7aNfk3UaVmwDDOsU3SyIUQZ6CX2UPTUbfDIVAYvr2uyxXYXlQ6W 7c903LnjTra0VMyvuZC35byWjy3ha2o9rRgpQQ8Rw5YBODZUTM2uB76rTUsdiGc6BAuc uUQI9fR6ZUpm55eLmSy5iPEJwT26Fi0vQheurg35YgPQsRLCr4i6TR4oeovuXkbpnHPM oBtJyAqofg1yk9wYzrQcI9tjqJ2ZjYMdSfK38DfCQs5AYpLnWS6pRU9gfy2DxZuCDw70 X/rA== X-Gm-Message-State: AOJu0YxMKRiwWIufdoUQTVAeLMna/9wZ8OzuRzlDkKIUMb2tB3OYqPIA HoKUkuSs6kDmJrv39lrRITtXR5Yk7pyVKjSxzTo/czGJTVjVQQzW9FUIfA== X-Google-Smtp-Source: AGHT+IHr6RAaEInDP6TWv3ArrXbxGFFqihr8ctTDhvQhJP+cKIVJlaSmksLkVF9mRlJaytrGxVGNXA== X-Received: by 2002:a05:6a20:6528:b0:1cf:215f:1038 with SMTP id adf61e73a8af0-1cf215f1adamr3478240637.7.1725679185332; Fri, 06 Sep 2024 20:19:45 -0700 (PDT) From: Ajeet Singh X-Google-Original-From: Ajeet Singh To: qemu-devel@nongnu.org Cc: Warner Losh , Mark Corbin , Ajeet Singh , Richard Henderson Subject: [PATCH v5 03/17] bsd-user: Implement RISC-V CPU register cloning and reset functions Date: Sat, 7 Sep 2024 13:19:13 +1000 Message-Id: <20240907031927.1908-4-itachis@FreeBSD.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240907031927.1908-1-itachis@FreeBSD.org> References: <20240907031927.1908-1-itachis@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=itachis6234@gmail.com; helo=mail-pf1-x433.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1725679240439116600 Content-Type: text/plain; charset="utf-8" From: Mark Corbin Added functions for cloning CPU registers and resetting the CPU state for RISC-V architecture. Signed-off-by: Mark Corbin Signed-off-by: Ajeet Singh Reviewed-by: Richard Henderson --- bsd-user/riscv/target_arch_cpu.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bsd-user/riscv/target_arch_cpu.h b/bsd-user/riscv/target_arch_= cpu.h index ea2a8d1ace..57abfbd556 100644 --- a/bsd-user/riscv/target_arch_cpu.h +++ b/bsd-user/riscv/target_arch_cpu.h @@ -130,4 +130,18 @@ static inline void target_cpu_loop(CPURISCVState *env) } } =20 +static inline void target_cpu_clone_regs(CPURISCVState *env, target_ulong = newsp) +{ + if (newsp) { + env->gpr[xSP] =3D newsp; + } + + env->gpr[xA0] =3D 0; + env->gpr[xT0] =3D 0; +} + +static inline void target_cpu_reset(CPUArchState *env) +{ +} + #endif /* TARGET_ARCH_CPU_H */ --=20 2.34.1