1 /* 2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU) 3 * Licensed under the Mulan PSL v2. 4 * You can use this software according to the terms and conditions of the Mulan PSL v2. 5 * You may obtain a copy of Mulan PSL v2 at: 6 * http://license.coscl.org.cn/MulanPSL2 7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR 8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR 9 * PURPOSE. 10 * See the Mulan PSL v2 for more details. 11 */ 12 #ifndef USRSYSCALL_SMC_H 13 #define USRSYSCALL_SMC_H 14 15 #include <stddef.h> 16 #include <stdint.h> 17 #include <chcore/syscall.h> 18 19 struct cap_teesmc_buf { 20 uint64_t ops; 21 uint64_t ta; 22 uint64_t target; 23 }; 24 25 enum cap_teesmc_buf_ops { 26 CAP_TEESMC_OPS_NORMAL = 0, 27 }; 28 29 enum cap_teesmc_req { 30 CAP_TEESMC_REQ_STARTTZ, 31 CAP_TEESMC_REQ_IDLE, 32 }; 33 34 int32_t smc_wait_switch_req(struct cap_teesmc_buf *buf); 35 36 int32_t smc_switch_req(enum cap_teesmc_req switch_req); 37 38 void init_teesmc_hdlr(void); 39 40 #endif 41