1419b0af8Sopenharmony_ci/*
2419b0af8Sopenharmony_ci * Copyright (C) 2022 Huawei Technologies Co., Ltd.
3419b0af8Sopenharmony_ci *
4419b0af8Sopenharmony_ci * This software is licensed under the terms of the GNU General Public
5419b0af8Sopenharmony_ci * License version 2, as published by the Free Software Foundation, and
6419b0af8Sopenharmony_ci * may be copied, distributed, and modified under those terms.
7419b0af8Sopenharmony_ci *
8419b0af8Sopenharmony_ci * This program is distributed in the hope that it will be useful,
9419b0af8Sopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
10419b0af8Sopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11419b0af8Sopenharmony_ci * GNU General Public License for more details.
12419b0af8Sopenharmony_ci */
13419b0af8Sopenharmony_ci#ifndef TZDEBUG_H
14419b0af8Sopenharmony_ci#define TZDEBUG_H
15419b0af8Sopenharmony_ci
16419b0af8Sopenharmony_ci#include <linux/types.h>
17419b0af8Sopenharmony_cistruct ta_mem {
18419b0af8Sopenharmony_ci	char ta_name[64];
19419b0af8Sopenharmony_ci	uint32_t pmem;
20419b0af8Sopenharmony_ci	uint32_t pmem_max;
21419b0af8Sopenharmony_ci	uint32_t pmem_limit;
22419b0af8Sopenharmony_ci};
23419b0af8Sopenharmony_ci#define MEMINFO_TA_MAX 100
24419b0af8Sopenharmony_cistruct tee_mem {
25419b0af8Sopenharmony_ci	uint32_t total_mem;
26419b0af8Sopenharmony_ci	uint32_t pmem;
27419b0af8Sopenharmony_ci	uint32_t free_mem;
28419b0af8Sopenharmony_ci	uint32_t free_mem_min;
29419b0af8Sopenharmony_ci	uint32_t ta_num;
30419b0af8Sopenharmony_ci	struct ta_mem ta_mem_info[MEMINFO_TA_MAX];
31419b0af8Sopenharmony_ci};
32419b0af8Sopenharmony_ci
33419b0af8Sopenharmony_ciint get_tee_meminfo(struct tee_mem *meminfo);
34419b0af8Sopenharmony_civoid tee_dump_mem(void);
35419b0af8Sopenharmony_ciint tzdebug_init(void);
36419b0af8Sopenharmony_civoid free_tzdebug(void);
37419b0af8Sopenharmony_ci
38419b0af8Sopenharmony_ci#endif