1 /* 2 * Copyright (c) 2019-2022, Xilinx, Inc. All rights reserved. 3 * Copyright (c) 2022-2023, Advanced Micro Devices, Inc. All rights reserved. 4 * 5 * SPDX-License-Identifier: BSD-3-Clause 6 */ 7 8 #ifndef PM_SVC_MAIN_H 9 #define PM_SVC_MAIN_H 10 11 #include <pm_common.h> 12 13 /******************************************************************************/ 14 /** 15 * SECURE_REDUNDANT_CALL() - Adds redundancy to the function call. This is to 16 * avoid glitches which can skip a function call 17 * and cause altering of the code flow in security 18 * critical functions. 19 * @status: Variable which holds the return value of function executed 20 * @status_tmp: Variable which holds the return value of redundant function 21 * call executed 22 * @function: Function to be executed 23 * 24 * Return: None 25 * 26 ******************************************************************************/ 27 #define SECURE_REDUNDANT_CALL(status, status_tmp, function, ...) \ 28 { \ 29 status = function(__VA_ARGS__); \ 30 status_tmp = function(__VA_ARGS__); \ 31 } 32 33 int32_t pm_setup(void); 34 uint64_t pm_smc_handler(uint32_t smc_fid, uint64_t x1, uint64_t x2, uint64_t x3, 35 uint64_t x4, const void *cookie, void *handle, 36 uint64_t flags); 37 38 int32_t pm_register_sgi(uint32_t sgi_num, uint32_t reset); 39 #endif /* PM_SVC_MAIN_H */ 40