From patchwork Thu Aug 31 20:09:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Volodymyr Babchuk X-Patchwork-Id: 9932803 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 071F460362 for ; Thu, 31 Aug 2017 20:12:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F01E21FEB1 for ; Thu, 31 Aug 2017 20:12:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4BD91FF1D; Thu, 31 Aug 2017 20:12:54 +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 1D77E1FEB1 for ; Thu, 31 Aug 2017 20:12:54 +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 1dnVnf-0000TD-6O; Thu, 31 Aug 2017 20:10:51 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dnVnd-0000S9-8F for xen-devel@lists.xen.org; Thu, 31 Aug 2017 20:10:49 +0000 Received: from [85.158.139.211] by server-11.bemta-5.messagelabs.com id FD/C0-01782-84D68A95; Thu, 31 Aug 2017 20:10:48 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA1VSaUgUYRjeb/YaF9fG1fD1pNZSCU/Kzj8FUmF qVhgpWs7auLO1u8rOWlsRmYUXJB5kXtWamaZmIhaKHaSYKGWoKYngAZnmRWaRR2Ezjpr9e973 ub4PXlyomBQ74JTJSBn0pFYpkYloHyzQ65CuPNz3W43X7oczJaL96HBL4yIWiiLEGr0qzhQtp iuzslF89kFT2d0aaSKq3JmOLHARcV0IhRkBHEZEJNTWpaF0JMMVRAYGC+Y6LB3h7BADS80yTi MhdkD1/Q9SDtsSjtA7272sFxINCBrangs5vQ0RBK2/g/n8rZD0zizm1nIiEOZbfbg1EC7Q15G 2rLYgjkB68QlurWAVWfdyJByWE9bQlv9ZxGEhAfBmbEzIWzfD7dqnEq4ViBwE1X8eiXizO7xc nFwROUPL+yIRlw9EMHQluvH6Hgy+5PUgfrghhfLhCcQbPOFW54iUJ0YlUFxegvHEHpiZm5PwO B6GOn5ivOiTGFJnC1fqnGD4a/UKUSmGqd5cxL8pGqaXFleS+i2h95k9j9Ok8OtFYCZyK1j314 J1fzUjrAJ5MJThAmXw2u7rrTJo1LRRR2q0Xn6+/t46imFINaUlVYx3TJyuFrFXcE0gQPUosyK kCdnjmHKj/MrR8nCFlSru7CWaZOgzhgQtxTQhJxxXgrz9PMtZGyg1ZYrVaNlTWqUBt1TaypVa lpYz8aSO0ah5qh1tdrCTz3M+giPoBP2abfUIu5Czg40cCQQChWU8ZdBpjP/z48gOR0pWwcVba vTGtfRxthhji6MCS7liI/mPckhExiDPqpBcl+naqcINsjiXiMyikZs2p1WuWyYdrX9cjB0dmB s8meMaltSdnFxVZgpZaM5q9khNeb2psdM5tL85j556628xeMynp9Eq9sDEZcHjSFl92JzgSR0 dcLVtxjWq1N2ce+4jDOhPTTgH7UvpV9ju/a5+tavvQf5QzXE84E6fUsTQpN82oYEh/wIv7A+P fwMAAA== X-Env-Sender: Volodymyr_Babchuk@epam.com X-Msg-Ref: server-13.tower-206.messagelabs.com!1504210247!94315155!1 X-Originating-IP: [104.47.2.74] 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 35605 invoked from network); 31 Aug 2017 20:10:47 -0000 Received: from mail-db5eur01on0074.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.74) by server-13.tower-206.messagelabs.com with AES256-SHA256 encrypted SMTP; 31 Aug 2017 20:10:47 -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=OrMlGYUvnVGCLVqtEWYtvgqP9uqifJ30Q024w3WbPZA=; b=GopS0E//oZk2yLTZvyzMQY6T5XQYg7xRQ6twJUuKihEU78BVPgCD2K6Jai+uO7mjd54hc/9bFJ2+iPAad3IZyG/YhhSQo/5SaoVh0DANCPHC2alhUCsMxQn3mUFPWsdNx1V8KjZfGZpQx6yqT6om4l8oFlOm0I8el0hyoyJmjjk= Received: from EPUAKYIW2556.kyiv.epam.com (85.223.209.51) by DB6PR0301MB2136.eurprd03.prod.outlook.com (2603:10a6:4:46::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Thu, 31 Aug 2017 20:10:44 +0000 Received: by EPUAKYIW2556.kyiv.epam.com (sSMTP sendmail emulation); Thu, 31 Aug 2017 23:10:39 +0300 From: Volodymyr Babchuk To: xen-devel@lists.xen.org Date: Thu, 31 Aug 2017 23:09:30 +0300 Message-Id: <1504210172-27234-9-git-send-email-volodymyr_babchuk@epam.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> References: <1504210172-27234-1-git-send-email-volodymyr_babchuk@epam.com> MIME-Version: 1.0 X-Originating-IP: [85.223.209.51] X-ClientProxiedBy: HE1PR09CA0086.eurprd09.prod.outlook.com (2603:10a6:7:3d::30) To DB6PR0301MB2136.eurprd03.prod.outlook.com (2603:10a6:4:46::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4bad75b-0ff8-4e8d-2b8c-08d4f0ac5d42 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:DB6PR0301MB2136; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0301MB2136; 3:ZhMfMpXvSSiDcNJr9iMmW5pseckVG3td/X+W0NhWCfjQoeV2TLFVRW0TQMumWL3I5NjG7Jbh3yqKnXHsHYBI3ppHbBPoTqW/NaVqzd+AP2lY6+YxpvF6bJH3dclJFAsTxeOFty7GP8uFi6INSvkNiRFYSwdCg7MSfZftC6Z7ie4e2KQhY6QWU//fgP0wLW2cViv2Xc7u1E0AfINqq0aRIwVougjdmRfakp+dUuMlkrAXVJ6EG1JOjbi28Z/OJHb4; 25:bINXFDBBtlZUsIiMFOTbnU48VTkSiinJEBOCLJjE5bAF00cYWNu4nFeWuUKthAsnTf0pEsdUJmu3Y73MbqtMgDMp/0TLomdusIqv9lUKi/reAIGLp1onNnnCXqegm2l2ClAnyMYdDMD1J2yMX+MzizL8PDw+EOeR2MiwsvX1mzBqlL3A7lkdRrHzKdjSwwVxH9Q22UpWpk8+YWZ6P5ToI3ZX7Z/jmaVDxi7C/VKiTYHzDEsuojA+moxG+rYzOqbScuLS0sBf+lXyJyzBXuNyNkyp2lO7eIOpWS4OrWuzp5oIcEaQgRNmwKxDOF4dxZU27JsjN9abHr3ur9Q9p/lecQ==; 31:Ip8dC2bZnr0RiJNtsS15F4lFBFYcHKwaqBihexDIs1i0mSsfWiObIKM+1Y2deCkgW8B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riScan:(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)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123555025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0301MB2136; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0301MB2136; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(199003)(189002)(50226002)(8666007)(8676002)(110136004)(81166006)(81156014)(47776003)(122856001)(80792005)(33646002)(6916009)(106356001)(105586002)(42186005)(2950100002)(6116002)(6666003)(2906002)(66066001)(2351001)(2361001)(189998001)(5660300001)(478600001)(7350300001)(53936002)(8656003)(48376002)(50466002)(36756003)(3846002)(97736004)(72206003)(5003940100001)(68736007)(54906002)(7736002)(76176999)(50986999)(305945005)(86362001)(575784001)(4326008)(101416001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0301MB2136; 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; DB6PR0301MB2136; 23:u43NWSFxTA0ha7Kn01+TaKHpOZ7pSoXCmPVX4Cw?= =?us-ascii?Q?mJDxj6Jh1IRBAlmcAWhaRwm+D0PX2IL1nNmXLxZUu5VZEmYSqGH1O2ceTAkB?= =?us-ascii?Q?obdO2G6Cebl9G+RqKzt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FkX2rVm683UTmH2IxYz5OcueJswyCHp7klmyxftpZpRTOqaw0HZs+aN0AnLfLUMg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: epam.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 20:10:44.7928 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0301MB2136 Cc: "Edgar E . Iglesias" , Julien Grall , Stefano Stabellini , Volodymyr Babchuk Subject: [Xen-devel] [PATCH v5 08/10] 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. Function psci_mode_check() in vsmc.c will be removed in a next patch, so there are no need to review it. I had to rework it, because PSCI_0_2_64BIT definition is dropped now. Signed-off-by: Volodymyr Babchuk --- * removed #include from seattle.c * PSCI_0_2_FUNC_xxx renamed back to PSCI_0_2_FN_xxx * mentioned psci_mode_check() in the commit message --- xen/arch/arm/platforms/seattle.c | 4 ++-- xen/arch/arm/psci.c | 10 ++++----- xen/arch/arm/vsmc.c | 22 ++++++++++---------- xen/include/asm-arm/psci.h | 44 ++++++++++++++++++---------------------- 4 files changed, 38 insertions(+), 42 deletions(-) /* 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_CONV_32, \ + ARM_SMCCC_OWNER_STANDARD, \ + PSCI_0_2_FN_##name) +#define PSCI_0_2_FN64(name) ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_CONV_64, \ + ARM_SMCCC_OWNER_STANDARD, \ + PSCI_0_2_FN_##name) +#define PSCI_0_2_FN_PSCI_VERSION 0 +#define PSCI_0_2_FN_CPU_SUSPEND 1 +#define PSCI_0_2_FN_CPU_OFF 2 +#define PSCI_0_2_FN_CPU_ON 3 +#define PSCI_0_2_FN_AFFINITY_INFO 4 +#define PSCI_0_2_FN_MIGRATE 5 +#define PSCI_0_2_FN_MIGRATE_INFO_TYPE 6 +#define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU 7 +#define PSCI_0_2_FN_SYSTEM_OFF 8 +#define PSCI_0_2_FN_SYSTEM_RESET 9 /* PSCI v0.2 affinity level state returned by AFFINITY_INFO */ #define PSCI_0_2_AFFINITY_LEVEL_ON 0 diff --git a/xen/arch/arm/platforms/seattle.c b/xen/arch/arm/platforms/seattle.c index 86dce91..22c0622 100644 --- a/xen/arch/arm/platforms/seattle.c +++ b/xen/arch/arm/platforms/seattle.c @@ -33,12 +33,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..be4e8e6 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 d3120a5..5421bd2 100644 --- a/xen/arch/arm/vsmc.c +++ b/xen/arch/arm/vsmc.c @@ -114,7 +114,7 @@ static bool handle_existing_apis(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) || !smccc_is_conv_64(fid); } /* PSCI 0.2 interface and other Standard Secure Calls */ @@ -124,40 +124,40 @@ static bool handle_sssc(struct cpu_user_regs *regs) switch ( smccc_get_fn(fid) ) { - case smccc_get_fn(PSCI_0_2_FN_PSCI_VERSION): + case PSCI_0_2_FN_PSCI_VERSION: perfc_incr(vpsci_version); PSCI_SET_RESULT(regs, do_psci_0_2_version()); return true; - case smccc_get_fn(PSCI_0_2_FN_CPU_OFF): + case PSCI_0_2_FN_CPU_OFF: perfc_incr(vpsci_cpu_off); PSCI_SET_RESULT(regs, do_psci_0_2_cpu_off()); return true; - case smccc_get_fn(PSCI_0_2_FN_MIGRATE_INFO_TYPE): + case PSCI_0_2_FN_MIGRATE_INFO_TYPE: perfc_incr(vpsci_migrate_info_type); PSCI_SET_RESULT(regs, do_psci_0_2_migrate_info_type()); return true; - case smccc_get_fn(PSCI_0_2_FN_MIGRATE_INFO_UP_CPU): + case PSCI_0_2_FN_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 smccc_get_fn(PSCI_0_2_FN_SYSTEM_OFF): + case PSCI_0_2_FN_SYSTEM_OFF: perfc_incr(vpsci_system_off); do_psci_0_2_system_off(); PSCI_SET_RESULT(regs, PSCI_INTERNAL_FAILURE); return true; - case smccc_get_fn(PSCI_0_2_FN_SYSTEM_RESET): + case PSCI_0_2_FN_SYSTEM_RESET: perfc_incr(vpsci_system_reset); do_psci_0_2_system_reset(); PSCI_SET_RESULT(regs, PSCI_INTERNAL_FAILURE); return true; - case smccc_get_fn(PSCI_0_2_FN_CPU_ON): + case PSCI_0_2_FN_CPU_ON: perfc_incr(vpsci_cpu_on); if ( psci_mode_check(current->domain, fid) ) { @@ -169,7 +169,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) } return true; - case smccc_get_fn(PSCI_0_2_FN_CPU_SUSPEND): + case PSCI_0_2_FN_CPU_SUSPEND: perfc_incr(vpsci_cpu_suspend); if ( psci_mode_check(current->domain, fid) ) { @@ -181,7 +181,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) } return true; - case smccc_get_fn(PSCI_0_2_FN_AFFINITY_INFO): + case PSCI_0_2_FN_AFFINITY_INFO: perfc_incr(vpsci_cpu_affinity_info); if ( psci_mode_check(current->domain, fid) ) { @@ -191,7 +191,7 @@ static bool handle_sssc(struct cpu_user_regs *regs) } return true; - case smccc_get_fn(PSCI_0_2_FN_MIGRATE): + case PSCI_0_2_FN_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..8ab8d0a 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,3 +43,3 @@ 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);