WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_memory_internal.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2013-2020. All rights reserved.
3 * Description: LiteOS memory Module Implementation
4 * Author: Huawei LiteOS Team
5 * Create: 2013-05-12
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
29/*
30 * @defgroup los_heap Heap
31 * @ingroup kernel
32 */
33
34#ifndef _LOS_MEMORY_INTERNAL_H
35#define _LOS_MEMORY_INTERNAL_H
36
37#include "los_typedef.h"
38#include "los_memory_pri.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif /* __cplusplus */
43
44#define OS_MEM_ALIGN_FLAG 0x80000000
45#define OS_MEM_SET_ALIGN_FLAG(align) ((align) = ((align) | OS_MEM_ALIGN_FLAG))
46#define OS_MEM_GET_ALIGN_FLAG(align) ((align) & OS_MEM_ALIGN_FLAG)
47#define OS_MEM_GET_ALIGN_GAPSIZE(align) ((align) & (~OS_MEM_ALIGN_FLAG))
48#define OS_MEM_NODE_HEAD_SIZE (UINT32)sizeof(struct LosHeapNode)
49/* Requires at least 1 byte of allocated space */
50#define OS_MEM_MIN_POOL_SIZE (OS_MEM_NODE_HEAD_SIZE + sizeof(struct LosHeapManager) + 1)
51
62
65#ifdef LOSCFG_MEM_TASK_STAT
66 UINT32 taskId;
67#endif
72};
73
76extern VOID* OsHeapAllocAlign(VOID *pool, UINT32 size, UINT32 boundary);
77extern BOOL OsHeapFree(VOID *pool, const VOID* ptr);
79extern UINT32 OsHeapIntegrityCheck(struct LosHeapManager *heap);
81
82#ifdef __cplusplus
83}
84#endif /* __cplusplus */
85
86#endif /* _LOS_MEMORY_INTERNAL_H */
UINT32 OsHeapIntegrityCheck(struct LosHeapManager *heap)
VOID * OsHeapAlloc(VOID *pool, UINT32 size)
UINTPTR OsHeapLastUsedGet(VOID *pool)
BOOL OsHeapInit(VOID *pool, UINT32 size)
BOOL OsHeapFree(VOID *pool, const VOID *ptr)
VOID * OsHeapAllocAlign(VOID *pool, UINT32 size, UINT32 boundary)
struct tagLosHeapStatus LosHeapStatus
UINT32 OsHeapStatisticsGet(VOID *pool, LosHeapStatus *status)
#define VOID
Definition los_typedef.h:88
unsigned char UINT8
Definition los_typedef.h:50
unsigned int UINTPTR
Definition los_typedef.h:74
unsigned int UINT32
Definition los_typedef.h:52
size_t BOOL
Definition los_typedef.h:83
Definition los_memory_internal.h:63
UINT32 align
Definition los_memory_internal.h:70
UINT32 used
Definition los_memory_internal.h:69
UINT32 size
Definition los_memory_internal.h:68
struct LosHeapNode * prev
Definition los_memory_internal.h:64
Definition los_memory_internal.h:52
UINT32 totalFreeSize
Definition los_memory_internal.h:54
UINT32 freeNodeNum
Definition los_memory_internal.h:57
UINT32 maxFreeNodeSize
Definition los_memory_internal.h:55
UINT32 totalUsedSize
Definition los_memory_internal.h:53
UINT32 usedNodeNum
Definition los_memory_internal.h:56
Definition hal_uart_v151_regs_def.h:38