1419b0af8Sopenharmony_ci/*
2419b0af8Sopenharmony_ci * Copyright (C) 2022 Huawei Technologies Co., Ltd.
3419b0af8Sopenharmony_ci * Decription: for log cfg api define
4419b0af8Sopenharmony_ci *
5419b0af8Sopenharmony_ci * This software is licensed under the terms of the GNU General Public
6419b0af8Sopenharmony_ci * License version 2, as published by the Free Software Foundation, and
7419b0af8Sopenharmony_ci * may be copied, distributed, and modified under those terms.
8419b0af8Sopenharmony_ci *
9419b0af8Sopenharmony_ci * This program is distributed in the hope that it will be useful,
10419b0af8Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
11419b0af8Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12419b0af8Sopenharmony_ci * GNU General Public License for more details.
13419b0af8Sopenharmony_ci */
14419b0af8Sopenharmony_ci#ifndef LOG_CFG_API_H
15419b0af8Sopenharmony_ci#define LOG_CFG_API_H
16419b0af8Sopenharmony_ci
17419b0af8Sopenharmony_ci#include <linux/types.h>
18419b0af8Sopenharmony_ci
19419b0af8Sopenharmony_ci#if ((defined(CONFIG_BBOX_MEM) || defined(CONFIG_RDR_MEM) || \
20419b0af8Sopenharmony_ci	defined(CONFIG_PAGES_MEM)) && defined(CONFIG_TEELOG))
21419b0af8Sopenharmony_ciint register_log_mem(uint64_t *addr, uint32_t *len);
22419b0af8Sopenharmony_ciint register_log_exception(void);
23419b0af8Sopenharmony_civoid report_log_system_error(void);
24419b0af8Sopenharmony_civoid report_log_system_panic(void);
25419b0af8Sopenharmony_ciint *map_log_mem(uint64_t mem_addr, uint32_t mem_len);
26419b0af8Sopenharmony_civoid unmap_log_mem(int *log_buffer);
27419b0af8Sopenharmony_civoid get_log_chown(uid_t *user, gid_t *group);
28419b0af8Sopenharmony_civoid unregister_log_exception(void);
29419b0af8Sopenharmony_civoid ta_crash_report_log(void);
30419b0af8Sopenharmony_ci#else
31419b0af8Sopenharmony_cistatic inline int register_log_mem(const uint64_t *addr, const uint32_t *len)
32419b0af8Sopenharmony_ci{
33419b0af8Sopenharmony_ci	(void)addr;
34419b0af8Sopenharmony_ci	(void)len;
35419b0af8Sopenharmony_ci	return 0;
36419b0af8Sopenharmony_ci}
37419b0af8Sopenharmony_ci
38419b0af8Sopenharmony_cistatic inline int register_log_exception(void)
39419b0af8Sopenharmony_ci{
40419b0af8Sopenharmony_ci	return 0;
41419b0af8Sopenharmony_ci}
42419b0af8Sopenharmony_ci
43419b0af8Sopenharmony_cistatic inline void report_log_system_error(void)
44419b0af8Sopenharmony_ci{
45419b0af8Sopenharmony_ci}
46419b0af8Sopenharmony_ci
47419b0af8Sopenharmony_cistatic inline void report_log_system_panic(void)
48419b0af8Sopenharmony_ci{
49419b0af8Sopenharmony_ci}
50419b0af8Sopenharmony_ci
51419b0af8Sopenharmony_cistatic inline int *map_log_mem(uint64_t mem_addr, uint32_t mem_len)
52419b0af8Sopenharmony_ci{
53419b0af8Sopenharmony_ci	(void)mem_addr;
54419b0af8Sopenharmony_ci	(void)mem_len;
55419b0af8Sopenharmony_ci	return NULL;
56419b0af8Sopenharmony_ci}
57419b0af8Sopenharmony_cistatic inline void unmap_log_mem(const int *log_buffer)
58419b0af8Sopenharmony_ci{
59419b0af8Sopenharmony_ci	(void)log_buffer;
60419b0af8Sopenharmony_ci}
61419b0af8Sopenharmony_cistatic inline void get_log_chown(const uid_t *user, const gid_t *group)
62419b0af8Sopenharmony_ci{
63419b0af8Sopenharmony_ci	(void)user;
64419b0af8Sopenharmony_ci	(void)group;
65419b0af8Sopenharmony_ci}
66419b0af8Sopenharmony_cistatic inline void unregister_log_exception(void)
67419b0af8Sopenharmony_ci{
68419b0af8Sopenharmony_ci}
69419b0af8Sopenharmony_ci
70419b0af8Sopenharmony_cistatic inline void ta_crash_report_log(void)
71419b0af8Sopenharmony_ci{
72419b0af8Sopenharmony_ci}
73419b0af8Sopenharmony_ci#endif
74419b0af8Sopenharmony_ci#endif
75