• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2009-2022 Huawei Technologies Co., Ltd. All rights reserved.
3  *
4  * UniProton is licensed under Mulan PSL v2.
5  * You can use this software according to the terms and conditions of the Mulan PSL v2.
6  * You may obtain a copy of Mulan PSL v2 at:
7  *          http://license.coscl.org.cn/MulanPSL2
8  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
9  * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
10  * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
11  * See the Mulan PSL v2 for more details.
12  * Create: 2009-12-22
13  * Description: mem模块的模块内头文件。
14  */
15 #ifndef PRT_MEM_INTERNAL_H
16 #define PRT_MEM_INTERNAL_H
17 
18 #include "prt_mem_external.h"
19 #include "prt_attr_external.h"
20 #include "prt_lib_external.h"
21 #include "prt_cpu_external.h"
22 
23 /*
24  * 模块内宏定义
25  */
26 #define OS_MEM_ADDR_ALIGN_TYPE_TO_SIZE(size) (0x1UL << (U32)(size))
27 
28 /* 申请一个内存块 */
29 typedef void *(*MemAllocFunc)(U32 mid, U32 size);
30 
31 /* 释放一个内存块  */
32 typedef U32 (*MemFreeFunc)(void *addr);
33 
34 struct TagMemFuncLib {
35     void *addr;        /* 分区起始地址 */
36     MemAllocFunc alloc; /* 申请一个内存块 */
37     MemFreeFunc free;   /* 释放一个内存块 */
38 };
39 
40 extern struct TagMemFuncLib g_memArithAPI; /* 算法对应API */
41 
42 #endif /* PRT_MEM_INTERNAL_H */
43