1 /* 2 * Copyright (C) 2022 Huawei Technologies Co., Ltd. 3 * Decription: reserved memory managing for sharing memory with TEE. 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 RESERVED_MEMPOOOL_H 15 #define RESERVED_MEMPOOOL_H 16 17 #include <linux/kernel.h> 18 #include <linux/types.h> 19 20 int load_reserved_mem(void); 21 void unmap_res_mem(void); 22 void *reserved_mem_alloc(size_t size); 23 void free_reserved_mempool(void); 24 int reserved_mempool_init(void); 25 void reserved_mem_free(const void *ptr); 26 bool exist_res_mem(void); 27 unsigned long res_mem_virt_to_phys(unsigned long vaddr); 28 unsigned int get_res_mem_slice_size(void); 29 #endif 30