From nobody Thu Mar 16 13:17:10 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PcnqC2720z3y6Fy; Thu, 16 Mar 2023 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PcnqC1GRwz3Bss; Thu, 16 Mar 2023 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMH7H5S63DdS19UQKqaTrHuqGPUEr/FZmB5VILcnQk8=; b=NsfEzofXJBMgBrnOf/S3X0kEH64eCMOMR3gBsXbEO7xjRNE0FfEXWvOzqpWNT1Rg3gL0MW K8dhmXCDHmvjOiD5gbqf2lNxbLHq/j4brwZRISwJoFY310ru1lKWi8TY1WtVaP5B1iPgNX j7X/EQ3YeBCECp2sizNz6DJZco/SY+14b8lzCD9mpg3w1iP5BPuUg8VdltSMCzYJFynkyJ AIeKUNTUvseBKpWQE4+8ZgMsdYaKIOaSIJSWSCbK74GbE1nOd7UVQau3T9uSPkSCQ56J8i TRVB3YIgCVrMi18Z4hE7woJ7C1IS6f+I4zsTcN5e3yhNiNGMoglX5DM6TtvAbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678972631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JMH7H5S63DdS19UQKqaTrHuqGPUEr/FZmB5VILcnQk8=; b=UdRNc2/3dWdP/3SF8ZB5aEBcDb5DtblYOdOr3I18rAFgbNqN5eFNjfagqrfyLrywXrlIe5 h5yzpkJmiWkiX6r/j5AuaOzSCixfMcWYZu57sQw20BathgGW9FspukP4qAiXEaZWwiaCAP Dj/CzdFoKbGeXC6e1EFayk6qEMfFjSH5NsL2aoqUY2n0YVGzAVtAJELTqFQXB5+DTmENWe MoReH1yg/7JU1y736P0BFbzIJM6aVbBChrLyhGSh9k3Bwb5kwFHilIMFXWmZVVyHbfFy6n /uLtFYVFZucibNvq9asKewae5/ZEwVsKdGk1oq9xKEAfkEyqS96YofXHhnA3pg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678972631; a=rsa-sha256; cv=none; b=fE9AdvLrc7Ak242ucfLvI5MdxzFFFa7+7GpQV/dzA8/HOeOm3IqKt0HdboARPagGBthlx/ Df7HM2McJpVhBEm9kFsRl9Jcd7d8YISs/38RiynE7leQEoT+6YFpH+5zzj5nq1iAUpJg9j IZUo1PZvPcIV9U2XDNpJSANJT+QoChbCFzK6RHP4qhi1HK7NYR6HWfGVvjodOVvAy3D4l1 d7M4S8ktee64cc9MfGDcXbOd5f1WwNoWe6pqZLkmpB75RhBxB1WrnHomRxd6T4ljIWeaMX jwrq8ccKzLc/56lqbIECHv4O41C5dNrx0XOEJgk/T31dZyD86N8WdtoO49g76A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PcnqC0KmZzlG5; Thu, 16 Mar 2023 13:17:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32GDHAh9078258; Thu, 16 Mar 2023 13:17:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GDHAQt078257; Thu, 16 Mar 2023 13:17:10 GMT (envelope-from git) Date: Thu, 16 Mar 2023 13:17:10 GMT Message-Id: <202303161317.32GDHAQt078257@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 473ab212dc1f - main - Allow psci.h to be used by userspace List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 473ab212dc1f72c1765f112568237d229d4e0441 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=473ab212dc1f72c1765f112568237d229d4e0441 commit 473ab212dc1f72c1765f112568237d229d4e0441 Author: Andrew Turner AuthorDate: 2023-03-16 12:08:32 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 13:08:00 +0000 Allow psci.h to be used by userspace Wrap parts of psci.h that aren't usable by userspace in _KERNEL checks. This allows it to be used to implement PSCI and SMCCC by bhyve in userspace. Sponsored by: Arm Ltd Sponsored by: Innovate UK Sponsored by: The FreeBSD Foundation --- sys/dev/psci/psci.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/psci/psci.h b/sys/dev/psci/psci.h index 8004498426c5..be5f55f49115 100644 --- a/sys/dev/psci/psci.h +++ b/sys/dev/psci/psci.h @@ -32,6 +32,7 @@ #include #include +#ifdef _KERNEL typedef int (*psci_initfn_t)(device_t dev, int default_version); typedef int (*psci_callfn_t)(register_t, register_t, register_t, register_t, register_t, register_t, register_t, register_t, @@ -52,6 +53,7 @@ psci_call(register_t a, register_t b, register_t c, register_t d) return (psci_callfn(a, b, c, d, 0, 0, 0, 0, NULL)); } +#endif /* * PSCI return codes. @@ -102,6 +104,7 @@ psci_call(register_t a, register_t b, register_t c, register_t d) #define PSCI_VER_MAJOR(v) (((v) >> 16) & 0xFF) #define PSCI_VER_MINOR(v) ((v) & 0xFF) +#ifdef _KERNEL enum psci_fn { PSCI_FN_VERSION, PSCI_FN_CPU_SUSPEND, @@ -115,5 +118,6 @@ enum psci_fn { PSCI_FN_SYSTEM_RESET, PSCI_FN_MAX }; +#endif #endif /* _MACHINE_PSCI_H_ */