From patchwork Mon Aug 21 20:27:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9913703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E6E8B602A0 for ; Mon, 21 Aug 2017 20:31:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7BD11FE8D for ; Mon, 21 Aug 2017 20:31:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C922328801; Mon, 21 Aug 2017 20:31:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0271E1FE8D for ; Mon, 21 Aug 2017 20:31:40 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djtKJ-00041I-5Y; Mon, 21 Aug 2017 20:29:35 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1djtKH-00040M-NR for xen-devel@lists.xen.org; Mon, 21 Aug 2017 20:29:33 +0000 Received: from [193.109.254.147] by server-1.bemta-6.messagelabs.com id 4C/2A-03765-DA24B995; Mon, 21 Aug 2017 20:29:33 +0000 X-Br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347371!112487364!1 X-Originating-IP: [104.47.2.57] X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50 X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 12951 invoked from network); 21 Aug 2017 20:29:32 -0000 Received: from mail-db5eur01on0057.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.57) by server-3.tower-27.messagelabs.com with AES256-SHA256 encrypted SMTP; 21 Aug 2017 20:29:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=EPAM.onmicrosoft.com; s=selector1-epam-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4a6Fw0jRtSShpeDMZlH2Nk0capLg7kKMGWdlAm4J474=; b=N1MOkJIktdp7d1BjV7ZeNzIeOLNpEzBKFMel164535DXTZtzOkoEpKxCRdLxZS6lRHX5xSoCxYtZYhCoHWxlhaGwT0Qf6bgxsY7brXwFr5nabBiHk0eTK/ebZUhPhyguVfS0hgVzk4EB7RvGcnuC0EnIxjuyfOZNuIhGNxK59NQ= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.58) by VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Mon, 21 Aug 2017 20:29:29 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Mon, 21 Aug 2017 23:29:24 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Mon, 21 Aug 2017 23:27:52 +0300 Message-Id: <1503347275-13039-9-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503347275-13039-1-git-send-email-volodymyr_babchuk@epam.com> References: <1503347275-13039-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.58] X-ClientProxiedBy: AM4PR05CA0020.eurprd05.prod.outlook.com (2603:10a6:205::33) To VI1PR0301MB2142.eurprd03.prod.outlook.com (2603:10a6:800:26::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: efde2687-8069-46f1-7193-08d4e8d3533c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR0301MB2142; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 3:rjkq+o/QitwHxMerljoolcguG3PatDfSnmZdxp3i0tN5QUNIilVrnnxEzwqZYpIkmSwpSO+gC3XQJcUnUPEqgYZtJkNOLTkWGCxtmIWP8kI1CJE51ry7hVkJZKPw/215wFyzNdueYyAdmXtGf3PvtLvmxEuzGm/qk4hD4BCcaRuGGM17C2DMzdbW2jnJDUquXMLyrkeQmlT5FW+aS/TR+noILcq3SwdL2N+15X9TgGrhN1woUR4qj5VYIM8t/9Dy; 25:gx6rvWwxUnBCKt653JkupbYaErGiqP3U1GxczZPg6H1rXLes0s9Nhk+Qh3XBidEMTaZjlYMg6oSFuQLSGHAM/O4bw8qiRTL8j66N5EntBwICm0Rd2iXMb0FMSypjuXZ0tNN8Hwaq6KQ/gOBI8pyux2eYX1MkTIw+0+yvzEjmbiJwdEKEKWukn7idTY80+xYBPz10G1dAcH2UyhXjI9VS5uftPGa1F5O8jbQ8PpFCwmfvDAeyRkWUYqc2DaAn+abmsibIAoinQd3NEniPeRofhXAKNSlms2Lfi3Fqi9opKi/Xl4QwhfGkOjLT5yOcj+iqrxA2uV4ETaRj3PSb0z5bKQ==; 31:JL/gQjxRoAOVd64xNFBLX856qsAn0D2v5CaXszrfWdioA7bx/aTIAdhdBLCzxsDnxYITISckoMTyEWZhQ3PBJe4e92FzacU2U3lEOCLfw1h9MFxO8FIjegmFNKYtKHl7REJTokhiENvFJkWk+0VBLN29ZwOWDXPl1MFLU5+vM0w4MZVol/2CJeee8e+4K8KshlofISpc/sxbTnMqltDgTJU5eYONiKwi3PZmHc4a5Zc= X-MS-TrafficTypeDiagnostic: VI1PR0301MB2142: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0301MB2142; 20:iC2d/kK5u0+sA7PdcDxdafrVirit+LHjDPi1YoAGIQcO1gcYikzIiWUV9npj+GuzA7Zh2jXes0+eWBdwuYCodcAgqq6lT3gjEs0cp5Eqqsj9Rg0KRAnqZbl8snWFNoHlYLx5ihCnROzWNQH7YHkUZgzVISE+T9MRmg2e1rSyXkmy+j2SZT0xewtxI3f1h0g6+cVFDrieO7XNU249uRggm5A7TUbasEqgFBlRiXrz0+pMMBywODwRfnmJk1TcpPsMw4lUt1WGiEWcLmZUZLQAKsaX9doUF7qX4hdiPpMRPFoK/VffhQe5Z0ZyEmt9bc7zo4Mg6fB7WNr2qclFvWfuDEllWbCsSecnDh3fjz9WQJKKdYu6MXFRDy3ae9/ZsXaoxtuK8Ttx9Zg+6TnW74/akpg1CL1L+9zZc/IdkvOxWsPJO1gyYp1hq/SNPI5/rjIp4kd3yGRHxmug/pmURzTCtzQLXO2cUbL/dyFGzl3BO5HBBz9FdSU9+xWvUQQoDHXD; 4:edl/YWg69HWxfwxDovoMIcIGlbMnaCEKVe+Z/v+85tXyT94+nDgMO2avOtVjXJ0TSHuHcWlNgUh33oyGLssXV6JxbMvIDWhhggsHI4UPz7CcPqvvgQhgWeXyQKcTg26XuILHBcsBiusXkHnLqbqC/en36/cfjC8d0dp/xvK6I+rfy/AmlsMNMg1S3WlqBcdCPLnQEi7a/scvL5YDXTclBkCVXraHE4bru6R+vbnRGd5UxTPt/WFzms8XYyPEfG+YDZZ7JdPpZQtmQvk8pPd6Wh0+3E4x0r3ysHwEcEYNcc4= X-Exchange-Antispam-Report-Test: UriScan:(4114951738403); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0301MB2142; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0301MB2142; X-Forefront-PRVS: 040655413E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(5660300001)(2351001)(101416001)(8656003)(6916009)(7350300001)(76176999)(42186005)(2950100002)(50226002)(106356001)(54906002)(5003940100001)(6666003)(81166006)(105586002)(50986999)(48376002)(50466002)(81156014)(8676002)(7736002)(72206003)(305945005)(33646002)(2361001)(53936002)(2906002)(86362001)(122856001)(47776003)(66066001)(478600001)(80792005)(6116002)(189998001)(4326008)(3846002)(8666007)(36756003)(107886003)(110136004)(97736004)(68736007)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0301MB2142; H:EPUAKYIW2556.kyiv.epam.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: epam.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0301MB2142; 23:Ac83oxzpTgtBz4j2jG2/1ka8MhrsvxRDdIwzYus?= =?us-ascii?Q?DMJwBbWriDHyqL90/kKzh2wRLnVfGv9cc0TAF25obS640K9CVo5igoHpufR8?= =?us-ascii?Q?RAmVNMK1kxp3Ekylcxma9D2Dd3wjATmr0HyPFFUkx4E2SxnxYfJm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/oWXEqS012s4SH8pCeROySckc2Sd7VPXkE0gCVftw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2017 20:29:29.3296 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0301MB2142 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v4 08/11] arm: PSCI: use definitions provided by asm/smccc.h X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP smccc.h provides definitions to construct SMC call function number according to SMCCC. We don't need multiple definitions for one thing, and definitions in smccc.h are more generic than ones used in psci.h. So psci.h will only provide function codes, while whole SMC function identifier will be constructed using generic macros from smccc.h. PSCI_0_2_FN_xxx was deliberately renamed to PSCI_0_2_FUNC_xxx, because this is a new entity. It can lead to problems, if we'll just change value of PSCI_0_2_FN_xxx without renaming it. This change also affects vsmc.c and seattle.c, because they both use PSCI function numbers. Signed-off-by: Volodymyr Babchuk --- * Reworked definitions to minimize their lenght * Described why I replaced PSCI_0_2_FN_xxx with PSCI_0_2_FUNC_xxx --- xen/arch/arm/platforms/seattle.c | 5 +++-- xen/arch/arm/psci.c | 10 ++++----- xen/arch/arm/vsmc.c | 24 +++++++++++----------- xen/include/asm-arm/psci.h | 44 ++++++++++++++++++---------------------- 4 files changed, 40 insertions(+), 43 deletions(-) diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c index 86dce91..fb2ad13 100644 --- a/xen/arch/arm/platforms/seattle.c +++ b/xen/arch/arm/platforms/seattle.c @@ -19,6 +19,7 @@ #include #include +#include static const char * const seattle_dt_compat[] __initconst = { @@ -33,12 +34,12 @@ static const char * const seattle_dt_compat[] __initconst = */ static void seattle_system_reset(void) { - call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_RESET), 0, 0, 0); } static void seattle_system_off(void) { - call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_OFF), 0, 0, 0); } PLATFORM_START(seattle, "SEATTLE") diff --git a/xen/arch/arm/psci.c b/xen/arch/arm/psci.c index 34ee97e..645fe58 100644 --- a/xen/arch/arm/psci.c +++ b/xen/arch/arm/psci.c @@ -31,9 +31,9 @@ * (native-width) function ID. */ #ifdef CONFIG_ARM_64 -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64_##name +#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN64(name) #else -#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN_##name +#define PSCI_0_2_FN_NATIVE(name) PSCI_0_2_FN32(name) #endif uint32_t psci_ver; @@ -48,13 +48,13 @@ int call_psci_cpu_on(int cpu) void call_psci_system_off(void) { if ( psci_ver > PSCI_VERSION(0, 1) ) - call_smc(PSCI_0_2_FN_SYSTEM_OFF, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_OFF), 0, 0, 0); } void call_psci_system_reset(void) { if ( psci_ver > PSCI_VERSION(0, 1) ) - call_smc(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0); + call_smc(PSCI_0_2_FN32(SYSTEM_RESET), 0, 0, 0); } int __init psci_is_smc_method(const struct dt_device_node *psci) @@ -144,7 +144,7 @@ int __init psci_init_0_2(void) } } - psci_ver = call_smc(PSCI_0_2_FN_PSCI_VERSION, 0, 0, 0); + psci_ver = call_smc(PSCI_0_2_FN32(PSCI_VERSION), 0, 0, 0); /* For the moment, we only support PSCI 0.2 and PSCI 1.x */ if ( psci_ver != PSCI_VERSION(0, 2) && PSCI_VERSION_MAJOR(psci_ver) != 1 ) diff --git a/xen/arch/arm/vsmc.c b/xen/arch/arm/vsmc.c index 956d4ef..46a2fde 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -102,7 +102,7 @@ static bool handle_psci_0_x(struct cpu_user_regs *regs) /* helper function for checking arm mode 32/64 bit */ static inline int psci_mode_check(struct domain *d, register_t fid) { - return !( is_64bit_domain(d)^( (fid & PSCI_0_2_64BIT) >> 30 ) ); + return is_64bit_domain(d) || !ARM_SMCCC_IS_64(fid); } /* PSCI 0.2 interface and other Standard Secure Calls */ @@ -112,34 +112,34 @@ static bool handle_sssc(struct cpu_user_regs *regs) switch ( ARM_SMCCC_FUNC_NUM(fid) ) { - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_PSCI_VERSION): + case PSCI_0_2_FUNC_PSCI_VERSION: perfc_incr(vpsci_version); PSCI_SET_RESULT(regs, do_psci_0_2_version()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_OFF): + case PSCI_0_2_FUNC_CPU_OFF: perfc_incr(vpsci_cpu_off); PSCI_SET_RESULT(regs, do_psci_0_2_cpu_off()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE_INFO_TYPE): + case PSCI_0_2_FUNC_MIGRATE_INFO_TYPE: perfc_incr(vpsci_migrate_info_type); PSCI_SET_RESULT(regs, do_psci_0_2_migrate_info_type()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE_INFO_UP_CPU): + case PSCI_0_2_FUNC_MIGRATE_INFO_UP_CPU: perfc_incr(vpsci_migrate_info_up_cpu); if ( psci_mode_check(current->domain, fid) ) PSCI_SET_RESULT(regs, do_psci_0_2_migrate_info_up_cpu()); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_SYSTEM_OFF): + case PSCI_0_2_FUNC_SYSTEM_OFF: perfc_incr(vpsci_system_off); do_psci_0_2_system_off(); PSCI_SET_RESULT(regs, PSCI_INTERNAL_FAILURE); - return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_SYSTEM_RESET): + return true; + case PSCI_0_2_FUNC_SYSTEM_RESET: perfc_incr(vpsci_system_reset); do_psci_0_2_system_reset(); PSCI_SET_RESULT(regs, PSCI_INTERNAL_FAILURE); return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_ON): + case PSCI_0_2_FUNC_CPU_ON: perfc_incr(vpsci_cpu_on); if ( psci_mode_check(current->domain, fid) ) { @@ -149,7 +149,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) PSCI_SET_RESULT(regs, do_psci_0_2_cpu_on(vcpuid, epoint, cid)); } return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_CPU_SUSPEND): + case PSCI_0_2_FUNC_CPU_SUSPEND: perfc_incr(vpsci_cpu_suspend); if ( psci_mode_check(current->domain, fid) ) { @@ -159,7 +159,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) PSCI_SET_RESULT(regs, do_psci_0_2_cpu_suspend(pstate, epoint, cid)); } return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_AFFINITY_INFO): + case PSCI_0_2_FUNC_AFFINITY_INFO: perfc_incr(vpsci_cpu_affinity_info); if ( psci_mode_check(current->domain, fid) ) { @@ -168,7 +168,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) PSCI_SET_RESULT(regs, do_psci_0_2_affinity_info(taff, laff)); } return true; - case ARM_SMCCC_FUNC_NUM(PSCI_0_2_FN_MIGRATE): + case PSCI_0_2_FUNC_MIGRATE: perfc_incr(vpsci_cpu_migrate); if ( psci_mode_check(current->domain, fid) ) { diff --git a/xen/include/asm-arm/psci.h b/xen/include/asm-arm/psci.h index be2458a..14fb98f 100644 --- a/xen/include/asm-arm/psci.h +++ b/xen/include/asm-arm/psci.h @@ -1,6 +1,8 @@ #ifndef __ASM_PSCI_H__ #define __ASM_PSCI_H__ +#include + /* PSCI return values (inclusive of all PSCI versions) */ #define PSCI_SUCCESS 0 #define PSCI_NOT_SUPPORTED -1 @@ -41,30 +43,24 @@ register_t do_psci_0_2_migrate_info_up_cpu(void); void do_psci_0_2_system_off(void); void do_psci_0_2_system_reset(void); -/* PSCI v0.2 interface */ -#define PSCI_0_2_FN_BASE 0x84000000 -#define PSCI_0_2_FN(n) (PSCI_0_2_FN_BASE + (n)) -#define PSCI_0_2_64BIT 0x40000000 -#define PSCI_0_2_FN64_BASE \ - (PSCI_0_2_FN_BASE + PSCI_0_2_64BIT) -#define PSCI_0_2_FN64(n) (PSCI_0_2_FN64_BASE + (n)) - -#define PSCI_0_2_FN_PSCI_VERSION PSCI_0_2_FN(0) -#define PSCI_0_2_FN_CPU_SUSPEND PSCI_0_2_FN(1) -#define PSCI_0_2_FN_CPU_OFF PSCI_0_2_FN(2) -#define PSCI_0_2_FN_CPU_ON PSCI_0_2_FN(3) -#define PSCI_0_2_FN_AFFINITY_INFO PSCI_0_2_FN(4) -#define PSCI_0_2_FN_MIGRATE PSCI_0_2_FN(5) -#define PSCI_0_2_FN_MIGRATE_INFO_TYPE PSCI_0_2_FN(6) -#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7) -#define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8) -#define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9) - -#define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) -#define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) -#define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) -#define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5) -#define PSCI_0_2_FN64_MIGRATE_INFO_UP_CPU PSCI_0_2_FN64(7) +#define PSCI_0_2_FN32(name) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + PSCI_0_2_FUNC_##name) +#define PSCI_0_2_FN64(name) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_64, \ + ARM_SMCCC_OWNER_STANDARD, \ + PSCI_0_2_FUNC_##name) +#define PSCI_0_2_FUNC_PSCI_VERSION 0 +#define PSCI_0_2_FUNC_CPU_SUSPEND 1 +#define PSCI_0_2_FUNC_CPU_OFF 2 +#define PSCI_0_2_FUNC_CPU_ON 3 +#define PSCI_0_2_FUNC_AFFINITY_INFO 4 +#define PSCI_0_2_FUNC_MIGRATE 5 +#define PSCI_0_2_FUNC_MIGRATE_INFO_TYPE 6 +#define PSCI_0_2_FUNC_MIGRATE_INFO_UP_CPU 7 +#define PSCI_0_2_FUNC_SYSTEM_OFF 8 +#define PSCI_0_2_FUNC_SYSTEM_RESET 9 /* PSCI v0.2 affinity level state returned by AFFINITY_INFO */ #define PSCI_0_2_AFFINITY_LEVEL_ON 0