1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 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 TEESMCMGR_H 13 #define TEESMCMGR_H 14 15 #include <stdint.h> 16 #include <tee_log.h> 17 #include <stdbool.h> 18 #include <ipclib.h> 19 #include <priorities.h> 20 #define SMCMGR_STACK_SIZE 0x8000 21 22 #define PAY_LOAD_SIZE 24 23 #define MAGIC_MSG "IDLE_0xDEADBEEF" 24 25 #define panic(fmt...) \ 26 do { \ 27 tee_abort(fmt); \ 28 } while (0) 29 #define error(fmt...) \ 30 do { \ 31 tloge(fmt); \ 32 } while (0) 33 #define info(fmt...) \ 34 do { \ 35 tlogi(fmt); \ 36 } while (0) 37 #define debug(fmt...) \ 38 do { \ 39 tlogd(fmt); \ 40 } while (0) 41 42 void *tee_idle_thread(void *arg); 43 void *tee_smc_thread(void *arg); 44 45 cref_t acquire_gtask_channel(void); 46 47 void set_gtask_channel_hdlr(cref_t value); 48 void set_is_gtask_alive(bool value); 49 50 cref_t get_gtask_channel_hdlr(void); 51 bool get_is_gtask_alive(void); 52 53 #endif 54