1 /*
2 * Copyright (C) 2022 Huawei Technologies Co., Ltd.
3 * Decription: for log cfg api define
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14 #ifndef LOG_CFG_API_H
15 #define LOG_CFG_API_H
16
17 #include <linux/types.h>
18
19 #if ((defined(CONFIG_BBOX_MEM) || defined(CONFIG_RDR_MEM) || \
20 defined(CONFIG_PAGES_MEM)) && defined(CONFIG_TEELOG))
21 int register_log_mem(uint64_t *addr, uint32_t *len);
22 int register_log_exception(void);
23 void report_log_system_error(void);
24 void report_log_system_panic(void);
25 int *map_log_mem(uint64_t mem_addr, uint32_t mem_len);
26 void unmap_log_mem(int *log_buffer);
27 void get_log_chown(uid_t *user, gid_t *group);
28 void unregister_log_exception(void);
29 void ta_crash_report_log(void);
30 #else
register_log_mem(const uint64_t * addr,const uint32_t * len)31 static inline int register_log_mem(const uint64_t *addr, const uint32_t *len)
32 {
33 (void)addr;
34 (void)len;
35 return 0;
36 }
37
register_log_exception(void)38 static inline int register_log_exception(void)
39 {
40 return 0;
41 }
42
report_log_system_error(void)43 static inline void report_log_system_error(void)
44 {
45 }
46
report_log_system_panic(void)47 static inline void report_log_system_panic(void)
48 {
49 }
50
map_log_mem(uint64_t mem_addr,uint32_t mem_len)51 static inline int *map_log_mem(uint64_t mem_addr, uint32_t mem_len)
52 {
53 (void)mem_addr;
54 (void)mem_len;
55 return NULL;
56 }
unmap_log_mem(const int * log_buffer)57 static inline void unmap_log_mem(const int *log_buffer)
58 {
59 (void)log_buffer;
60 }
get_log_chown(const uid_t * user,const gid_t * group)61 static inline void get_log_chown(const uid_t *user, const gid_t *group)
62 {
63 (void)user;
64 (void)group;
65 }
unregister_log_exception(void)66 static inline void unregister_log_exception(void)
67 {
68 }
69
ta_crash_report_log(void)70 static inline void ta_crash_report_log(void)
71 {
72 }
73 #endif
74 #endif
75