• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 LIBTEEOS_TA_ROUTINE_H
13 #define LIBTEEOS_TA_ROUTINE_H
14 
15 #include <stdbool.h>
16 #include <stdint.h>
17 
18 enum gp_function_index {
19     CREATE_ENTRY_INDEX = 0,
20     OPEN_SESSION_INDEX,
21     INVOKE_COMMAND_INDEX,
22     CLOSE_SESSION_INDEX,
23     DESTROY_ENTRY_INDEX,
24     BSS_START_INDEX,
25     BSS_END_INDEX,
26     INIT_ARRAY_START_INDEX,
27     INIT_ARRAY_END_INDEX,
28     TOTAL_SYM_NUM,
29 };
30 
31 #define GP_SYMBOL_NUM BSS_START_INDEX
32 
33 struct ta_routine_info {
34     /* info store the address of GP function/bss_start/bss_end/init_array_start/init_array_end */
35     void *info[TOTAL_SYM_NUM];
36     bool addcaller_flag;
37 };
38 
39 typedef void (*ta_entry_t)(uint32_t, const struct ta_routine_info *);
40 typedef void (*ta_entry_orig_t)(uint32_t);
41 
42 typedef union {
43     ta_entry_t ta_entry;
44     ta_entry_orig_t ta_entry_orig;
45 } ta_entry_type;
46 #endif
47