fix(xilinx): add API to get powerdown request status
The pwrdwn_req_received variable is used across multiple platforms
through extern keyword. Instead of using the extern, add getter
API to access this variable across the platforms, and restrict the
scope of variable to the particular file by defining it as static
variable. This prevents unintended access of variable from other
files and increase safety.
Change-Id: I758466ea7f6be2a90ec249dc3e4fa56cdbe11e57
Signed-off-by: Devanshi Chauhan <devanshi.chauhanalpeshbhai@amd.com>
diff --git a/plat/xilinx/common/include/pm_svc_main.h b/plat/xilinx/common/include/pm_svc_main.h
index 000f198..32a425c 100644
--- a/plat/xilinx/common/include/pm_svc_main.h
+++ b/plat/xilinx/common/include/pm_svc_main.h
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved.
- * Copyright (c) 2022-2024, Advanced Micro Devices, Inc. All rights reserved.
+ * Copyright (c) 2022-2025, Advanced Micro Devices, Inc. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -10,8 +10,6 @@
#include <pm_common.h>
-extern bool pwrdwn_req_received;
-
#define PASS_THROUGH_FW_CMD_ID U(0xfff)
/******************************************************************************/
@@ -34,6 +32,7 @@
status_tmp = function(__VA_ARGS__); \
}
+bool pm_pwrdwn_req_status(void);
void request_cpu_pwrdwn(void);
int32_t pm_setup(void);
uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3,