• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* ----------------------------------------------------------------------------
2  * Copyright (c) Huawei Technologies Co., Ltd. 2013-2018. All rights reserved.
3  * Description: LiteOS Mem Module Implementation
4  * Redistribution and use in source and binary forms, with or without modification,
5  * are permitted provided that the following conditions are met:
6  * 1. Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * 2. Redistributions in binary form must reproduce the above copyright notice, this list
9  * of conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * 3. Neither the name of the copyright holder nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  * --------------------------------------------------------------------------- */
26 
27 #ifndef _LOS_MEMORY_H
28 #define _LOS_MEMORY_H
29 #include "los_base.h"
30 
31 #ifdef __cplusplus
32 #if __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35 #endif /* __cplusplus */
36 
37 /**
38  * @ingroup los_memory
39  * Memory information structure
40  */
41 typedef struct {
42     UINT32 usedSize;
43     UINT32 freeSize;
44     UINT32 totalSize;
45     UINT32 allocCount;
46     UINT32 freeCount;
47     UINT32 mallocFailCount;
48 #if defined(LOSCFG_MEM_WATERLINE) && (LOSCFG_MEM_WATERLINE == YES)
49     UINT32 usageWaterLine;
50 #endif
51 } LOS_MEM_STATUS;
52 
53 #if (LOSCFG_MEMORY_BESTFIT == YES)
54 
55 #if (LOSCFG_BASE_MEM_NODE_SIZE_CHECK == YES)
56 #define OS_MEM_CHECK_DEBUG
57 #endif
58 
59 typedef VOID (*MALLOC_HOOK)(VOID);
60 
61 extern MALLOC_HOOK g_mallocHook;
62 
63 typedef VOID (*MEM_CHECK_ERR_FUNC)(VOID *tmpNode);
64 
65 /**
66  * @ingroup los_memory
67  * @brief Get the pointer to the little memory pool.
68  *
69  * @par Description:
70  * <ul>
71  * <li>This API is used to get the pointer to the little memory pool.</li>
72  * </ul>
73  * @attention
74  * <ul>
75  * <li>None.</li>
76  * </ul>
77  *
78  * @param None.
79  *
80  * @retval #VOID*         return the pointer to the little memory pool.
81  * @par Dependency:
82  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
83  */
84 extern VOID *LOS_MemGetLmp(VOID);
85 
86 /**
87  * @ingroup los_memory
88  * @brief Get the size of memory totally used.
89  *
90  * @par Description:
91  * <ul>
92  * <li>This API is used to get the size of memory totally used in memory pool.</li>
93  * </ul>
94  * @attention
95  * <ul>
96  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
97  * </ul>
98  *
99  * @param  pool           [IN] A pointer pointed to the memory pool.
100  *
101  * @retval #LOS_NOK        The incoming parameter pool is NULL.
102  * @retval #UINT32         The size of the memory pool used.
103  * @par Dependency:
104  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
105  * @see None.
106  */
107 extern UINT32 LOS_MemTotalUsedGet(VOID *pool);
108 
109 /**
110  * @ingroup los_memory
111  * @brief Get the number of free memory nodes.
112  *
113  * @par Description:
114  * <ul>
115  * <li>This API is used to get the number of free memory nodes in memory pool.</li>
116  * </ul>
117  * @attention
118  * <ul>
119  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
120  * </ul>
121  *
122  * @param  pool           [IN] A pointer pointed to the memory pool.
123  *
124  * @retval #LOS_NOK        The incoming parameter pool is NULL.
125  * @retval #UINT32         The number of free memory nodes.
126  * @par Dependency:
127  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
128  * @see None.
129  */
130 extern UINT32 LOS_MemFreeBlksGet(VOID *pool);
131 
132 /**
133  * @ingroup los_memory
134  * @brief Get the number of used memory nodes.
135  *
136  * @par Description:
137  * <ul>
138  * <li>This API is used to get the number of used memory nodes in memory pool.</li>
139  * </ul>
140  * @attention
141  * <ul>
142  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
143  * </ul>
144  *
145  * @param  pool           [IN] A pointer pointed to the memory pool.
146  *
147  * @retval #LOS_NOK        The incoming parameter pool is NULL.
148  * @retval #UINT32         The number of used memory nodes.
149  * @par Dependency:
150  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
151  * @see None.
152  */
153 extern UINT32 LOS_MemUsedBlksGet(VOID *pool);
154 
155 /**
156  * @ingroup los_memory
157  * @brief Get the task ID of a used memory node.
158  *
159  * @par Description:
160  * <ul>
161  * <li>This API is used to get the task ID of a used memory node.</li>
162  * </ul>
163  * @attention
164  * <ul>
165  * <li>The input ptr parameter must be allocated by LOS_MemAlloc or LOS_MemAllocAlign.</li>
166  * <li>This interface only support obtain the task ID of a used memory node which is allocated from
167  * the system memory pool (OS_SYS_MEM_ADDR) at present.</li>
168  * </ul>
169  *
170  * @param  pool               [IN] A used memory node.
171  *
172  * @retval #OS_INVALID        The incoming parameter ptr is illegal.
173  * @retval #UINT32            The task ID of used memory node ptr.
174  * @par Dependency:
175  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
176  * @see None.
177  */
178 extern UINT32 LOS_MemTaskIdGet(const VOID *pool);
179 
180 /**
181  * @ingroup los_memory
182  * @brief Get the address of last node.
183  *
184  * @par Description:
185  * <ul>
186  * <li>This API is used to get the address of last node.</li>
187  * </ul>
188  * @attention
189  * <ul>
190  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
191  * <li>The last node of memory pool is not the end node.</li>
192  * </ul>
193  *
194  * @param  pool               [IN] A pointer pointed to the memory pool.
195  *
196  * @retval #LOS_NOK           The incoming parameter pool is NULL.
197  * @retval #UINT32            The address of the last used node that casts to UINT32.
198  * @par Dependency:
199  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
200  * @see None.
201  */
202 extern UINT32 LOS_MemLastUsedGet(VOID *pool);
203 
204 /**
205  * @ingroup los_memory
206  * @brief Check the memory pool Integrity.
207  *
208  * @par Description:
209  * <ul>
210  * <li>This API is used to check the memory pool Integrity.</li>
211  * </ul>
212  * @attention
213  * <ul>
214  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
215  * <li>LOS_MemIntegrityCheck will be called by malloc function when the macro of LOSCFG_BASE_MEM_NODE_INTEGRITY_CHECK
216  * is defined in LiteOS.</li>
217  * <li>LOS_MemIntegrityCheck function can be called by user anytime.</li>
218  * </ul>
219  *
220  * @param  pool              [IN] A pointer pointed to the memory pool.
221  *
222  * @retval #LOS_NOK           The memory pool (pool) is impaired.
223  * @retval #LOS_OK            The memory pool (pool) is integrated.
224  * @par Dependency:
225  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
226  * @see None.
227  */
228 extern UINT32 LOS_MemIntegrityCheck(VOID *pool);
229 
230 /**
231  * @ingroup los_memory
232  * @brief Figure the system memory pool for it's total mem used.
233  *
234  * @par Description:
235  * <ul>
236  * <li>This API is used to figure the system memory pool for it's total mem used.</li>
237  * </ul>
238  *
239  * @retval #UINT32   The mem used.
240  * @par Dependency:
241  * <ul>
242  * <li>los_memory.h: the header file that contains the API declaration.</li>
243  * </ul>
244  * @see None.
245  */
246 extern UINT32 LOS_MemGetUsed(VOID);
247 
248 /**
249  * @ingroup los_memory
250  * @brief Get the system memory pool's size.
251  *
252  * @par Description:
253  * <ul>
254  * <li>This API is used to get the system memory pool's size.</li>
255  * </ul>
256  *
257  * @retval #UINT32   The poll size.
258  * @par Dependency:
259  * <ul>
260  * <li>los_memory.h: the header file that contains the API declaration.</li>
261  * </ul>
262  * @see None.
263  */
264 extern UINT32 LOS_MemGetTotal(VOID);
265 
266 /**
267  * @ingroup los_memory
268  * @brief Get the memory pool's size.
269  *
270  * @par Description:
271  * <ul>
272  * <li>This API is used to get the memory pool's size.</li>
273  * </ul>
274  *
275  * @retval #UINT32   The memory poll size.
276  * @par Dependency:
277  * <ul>
278  * <li>los_memory.h: the header file that contains the API declaration.</li>
279  * </ul>
280  * @see None.
281  */
282 extern UINT32 LOS_MemPoolSizeGet(const VOID *pool);
283 
284 /**
285  * @ingroup los_memory
286  *  Define a mem size check intensity
287  *
288  *  Lowest mem check.
289  */
290 #define LOS_MEM_CHECK_LEVEL_LOW     0
291 
292 /**
293  * @ingroup los_memory
294  * Define a mem size check intensity
295  *
296  * Highest mem check.
297  */
298 #define LOS_MEM_CHECK_LEVEL_HIGH    1
299 
300 /**
301  * @ingroup los_memory
302  * Define a mem size check intensity
303  *
304  * disable mem check.
305  */
306 #define LOS_MEM_CHECK_LEVEL_DISABLE 0xff
307 
308 /**
309  * @ingroup los_memory
310  * Define a mem size check intensity
311  *
312  * default intensity set mem check.
313  */
314 #define LOS_MEM_CHECK_LEVEL_DEFAULT LOS_MEM_CHECK_LEVEL_DISABLE
315 
316 /**
317  * @ingroup los_memory
318  * @brief Check the size of memory node specified.
319  *
320  * @par Description:
321  * <ul>
322  * <li>This API is used to check the size of memory node.</li>
323  * </ul>
324  * @attention
325  * <ul>
326  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
327  * <li>The input ptr parameter must be allocated by LOS_MemAlloc or LOS_MemAllocAlign.</li>
328  * <li>The function will be called by function specified, such as memset or memcpy.</li>
329  * <li>The feature can be enabled when you set the macro value of LOSCFG_BASE_MEM_NODE_SIZE_CHECK as YES.</li>
330  * <li>You had better set memory check level as LOS_MEM_CHECK_LEVEL_DISABLE when copy bin file.</li>
331  * </ul>
332  *
333  * @param  pool              [IN]  A pointer pointed to the memory pool.
334  * @param  ptr               [IN]  A pointer pointed to the source node.
335  * @param  totalSize         [OUT] A pointer to save total size, must point to valid memory.
336  * @param  availSize         [OUT] A pointer to save available size, must point to valid memory.
337  *
338  * @retval #OS_ERRNO_MEMCHECK_DISABLED           Memcheck function does not open.
339  * @retval #OS_ERRNO_MEMCHECK_NOT_INIT           Memcheck function does not init.
340  * @retval #OS_ERRNO_MEMCHECK_PARA_NULL          The pool or ptr is NULL.
341  * @retval #OS_ERRNO_MEMCHECK_OUTSIDE            The ptr address is not in the reasonable range.
342  * @retval #OS_ERRNO_MEMCHECK_NO_HEAD            Can't find the control head node from ptr.
343  * @retval #OS_ERRNO_MEMCHECK_WRONG_LEVEL        The memory check level is illegal.
344  * @retval #LOS_OK                               Success to get total size and available
345  *                                               size of the memory node (ptr).
346  * @par Dependency:
347  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
348  * @see LOS_MemCheckLevelSet | LOS_MemCheckLevelGet
349  */
350 extern UINT32 LOS_MemNodeSizeCheck(VOID *pool, const VOID *ptr, UINT32 *totalSize, UINT32 *availSize);
351 
352 /**
353  * @ingroup los_memory
354  * @brief Set the memory check level.
355  *
356  * @par Description:
357  * <ul>
358  * <li>This API is used to set the memory check level.</li>
359  * </ul>
360  * @attention
361  * <ul>
362  * <li>There are three level you can set.</li>
363  * <li>The legal level are LOS_MEM_CHECK_LEVEL_LOW, LOS_MEM_CHECK_LEVEL_HIGH, LOS_MEM_CHECK_LEVEL_DISABLE.</li>
364  * </ul>
365  *
366  * @param  level                                  [IN] The level what you want to set.
367  *
368  * @retval #LOS_ERRNO_MEMCHECK_WRONG_LEVEL           The memory check level what you want to set is illegal.
369  * @retval #LOS_OK                                  Success to set the memory check level.
370  * @par Dependency:
371  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
372  * @see LOS_MemNodeSizeCheck | LOS_MemCheckLevelGet
373  */
374 extern UINT32 LOS_MemCheckLevelSet(UINT8 level);
375 
376 /**
377  * @ingroup los_memory
378  * @brief Get the memory check level.
379  *
380  * @par Description:
381  * <ul>
382  * <li>This API is used to get the current memory check level.</li>
383  * </ul>
384  * @attention
385  * <ul>
386  * <li>None.</li>
387  * </ul>
388  *
389  * @param  None
390  *
391  * @retval #UINT8           The current memory check level.
392  * @par Dependency:
393  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
394  * @see LOS_MemNodeSizeCheck | LOS_MemCheckLevelSet
395  */
396 extern UINT8 LOS_MemCheckLevelGet(VOID);
397 
398 /**
399  * @ingroup los_memory
400  * @brief Get the memory pool information.
401  *
402  * @par Description:
403  * <ul>
404  * <li>This API is used to get the current memory pool used information.</li>
405  * </ul>
406  * @attention
407  * <ul>
408  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
409  * <li>The size of the input parameter size can not be greater than the memory pool size that
410  * specified at the second input parameter of LOS_MemInit.</li>
411  * <li>The size of the input parameter size must be four byte-aligned.</li>
412  * </ul>
413  *
414  * @param  pool    [IN] Pointer to the memory pool that contains the memory block to be allocated.
415  * @param  status  [OUT] Structure contains the mem info.
416  *
417  * @retval #LOS_NOK          .
418  * @retval #LOS_OK           .
419 
420  * @par Dependency:
421  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
422  */
423 extern UINT32 LOS_MemInfoGet(VOID *pool, LOS_MEM_STATUS *status);
424 #else
425 
426 /**
427  * @ingroup los_memory
428  * @brief calculate heap max free block size.
429  *
430  * @par Description:
431  * <ul>
432  * <li>This API is used to calculate heap max free block size.</li>
433  * </ul>
434  * @attention
435  * <ul>
436  * <li>None.</li>
437  * </ul>
438  *
439  * @param  pool          [IN] Pointer to memory pool.
440  *
441  * @retval #UINT32        The  max free block size.
442  * @par Dependency:
443  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
444  * @see LOS_MemAlloc | LOS_MemRealloc | LOS_MemFree
445  */
446 extern UINT32 LOS_MemGetMaxFreeBlkSize(VOID *pool);
447 #endif
448 
449 /**
450  * @ingroup los_memory
451  * @brief Initialize dynamic memory.
452  *
453  * @par Description:
454  * <ul>
455  * <li>This API is used to initialize the dynamic memory of a doubly linked list.</li>
456  * </ul>
457  * @attention
458  * <ul>
459  * <li>The size parameter value should match the following two conditions : 1) Be less than or equal to
460  * the Memory pool size; 2) Be greater than the size of OS_MEM_MIN_POOL_SIZE.</li>
461  * <li>Call this API when dynamic memory needs to be initialized during the startup of Huawei LiteOS.</li>
462  * <li>The parameter input must be four byte-aligned.</li>
463  * <li>The init area [pool, pool + size] should not conflict with other pools.</li>
464  * </ul>
465  *
466  * @param pool         [IN] Starting address of memory.
467  * @param size         [IN] Memory size.
468  *
469  * @retval #LOS_NOK    The dynamic memory fails to be initialized.
470  * @retval #LOS_OK     The dynamic memory is successfully initialized.
471  * @par Dependency:
472  * <ul>
473  * <li>los_memory.h: the header file that contains the API declaration.</li>
474  * </ul>
475  * @see None.
476  */
477 extern UINT32 LOS_MemInit(VOID *pool, UINT32 size);
478 
479 /**
480  * @ingroup los_memory
481  * @brief Allocate dynamic memory.
482  *
483  * @par Description:
484  * <ul>
485  * <li>This API is used to allocate a memory block of which the size is specified.</li>
486  * </ul>
487  * @attention
488  * <ul>
489  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
490  * <li>The size of the input parameter size can not be greater than the memory pool size
491  * that specified at the second input parameter of LOS_MemInit.</li>
492  * <li>The size of the input parameter size must be four byte-aligned.</li>
493  * </ul>
494  *
495  * @param  pool    [IN] Pointer to the memory pool that contains the memory block to be allocated.
496  * @param  size    [IN] Size of the memory block to be allocated (unit: byte).
497  *
498  * @retval #NULL          The memory fails to be allocated.
499  * @retval #VOID*         The memory is successfully allocated with the starting address of
500  *                        the allocated memory block returned.
501  * @par Dependency:
502  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
503  * @see LOS_MemRealloc | LOS_MemAllocAlign | LOS_MemFree
504  */
505 extern VOID *LOS_MemAlloc(VOID *pool, UINT32 size);
506 
507 /**
508  * @ingroup los_memory
509  * @brief Free dynamic memory.
510  *
511  * @par Description:
512  * <li>This API is used to free specified dynamic memory that has been allocated.</li>
513  * @attention
514  * <ul>
515  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
516  * <li>The input mem parameter must be allocated by LOS_MemAlloc or LOS_MemAllocAlign or LOS_MemRealloc.</li>
517  * </ul>
518  *
519  * @param  pool  [IN] Pointer to the memory pool that contains the dynamic memory block to be freed.
520  * @param  mem   [IN] Starting address of the memory block to be freed.
521  *
522  * @retval #LOS_NOK          The memory block fails to be freed
523  * @retval #LOS_OK           The memory block is successfully freed.
524  * @par Dependency:
525  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
526  * @see LOS_MemAlloc | LOS_MemRealloc | LOS_MemAllocAlign
527  */
528 extern UINT32 LOS_MemFree(VOID *pool, const VOID *mem);
529 
530 /**
531  * @ingroup los_memory
532  * @brief Re-allocate a memory block.
533  *
534  * @par Description:
535  * <ul>
536  * <li>This API is used to allocate a new memory block of which the size is specified by size if the original
537  * memory block size is insufficient. The new memory block will copy the data in the original memory block of
538  * which the address is specified by ptr. The size of the new memory block determines the maximum size of data
539  * to be copied. After the new memory block is created, the original one is freed.</li>
540  * </ul>
541  * @attention
542  * <ul>
543  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
544  * <li>The input ptr parameter must be allocated by LOS_MemAlloc.</li>
545  * <li>The size of the input parameter size can not be greater than the memory pool size that specified at the
546  * second input parameter of LOS_MemInit.</li>
547  * <li>The size of the input parameter size must be aligned as follows: 1) if the ptr is allocated by LOS_MemAlloc,
548  * it must be four byte-aligned; 2) if the ptr is allocated by LOS_MemAllocAlign, it must be aligned with the size
549  * of the input parameter uwBoundary of LOS_MemAllocAlign.</li>
550  * </ul>
551  *
552  * @param  pool      [IN] Pointer to the memory pool that contains the original and new memory blocks.
553  * @param  ptr       [IN] Address of the original memory block.
554  * @param  size      [IN] Size of the new memory block.
555  *
556  * @retval #NULL          The memory fails to be re-allocated.
557  * @retval #VOID*         The memory is successfully re-allocated with the starting address of the new memory block
558  *                        returned.
559  * @par Dependency:
560  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
561  * @see LOS_MemAlloc | LOS_MemAllocAlign | LOS_MemFree
562  */
563 extern VOID *LOS_MemRealloc(VOID *pool, const VOID *ptr, UINT32 size);
564 
565 /**
566  * @ingroup los_memory
567  * @brief Allocate aligned memory.
568  *
569  * @par Description:
570  * <ul>
571  * <li>This API is used to allocate memory blocks of specified size and of which the starting addresses are aligned
572  * on a specified boundary.</li>
573  * </ul>
574  * @attention
575  * <ul>
576  * <li>The input pool parameter must be initialized via func LOS_MemInit.</li>
577  * <li>The size of the input parameter size can not be greater than the memory pool size that specified at the second
578  * input parameter of LOS_MemInit.</li>
579  * <li>The alignment parameter value must be a power of 2 with the minimum value being 4.</li>
580  * </ul>
581  *
582  * @param  pool      [IN] Pointer to the memory pool that contains the memory blocks to be allocated.
583  * @param  size      [IN] Size of the memory to be allocated.
584  * @param  boundary  [IN] Boundary on which the memory is aligned.
585  *
586  * @retval #NULL          The memory fails to be allocated.
587  * @retval #VOID*         The memory is successfully allocated with the starting address of the allocated memory
588  *                        returned.
589  * @par Dependency:
590  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
591  * @see LOS_MemAlloc | LOS_MemRealloc | LOS_MemFree
592  */
593 extern VOID *LOS_MemAllocAlign(VOID *pool, UINT32 size, UINT32 boundary);
594 
595 /**
596  * @ingroup los_memory
597  * @brief Enable the Intergrity check when alloc and free memory.
598  *
599  * @par Description:
600  * <ul>
601  * <li>This API is used to enable the Intergrity check when alloc and free memory.</li>
602  * </ul>
603  * @attention
604  * <ul>
605  * <li>None.</li>
606  * </ul>
607  *
608  * @param  None
609  *
610  * @retval None.
611  * @par Dependency:
612  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
613  * @see LOS_MemNodeSizeCheck | LOS_MemCheckLevelSet
614  */
615 extern VOID LOS_MemEnableIntegrityCheck(VOID);
616 
617 /**
618  * @ingroup los_memory
619  * @brief Disable the intergrity check when alloc and free memory.
620  *
621  * @par Description:
622  * <ul>
623  * <li>This API is used to disable the intergrity check when alloc and free memory.</li>
624  * </ul>
625  * @attention
626  * <ul>
627  * <li>None.</li>
628  * </ul>
629  *
630  * @param  None
631  *
632  * @retval None.
633  * @par Dependency:
634  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
635  * @see LOS_MemNodeSizeCheck | LOS_MemCheckLevelSet
636  */
637 extern VOID LOS_MemDisableIntegrityCheck(VOID);
638 
639 /**
640  * @ingroup los_memory
641  * @brief Set lr address saved in memory node info.
642  *
643  * @par Description:
644  * <ul>
645  * <li>This API is used to Set lr address saved in memory node info.</li>
646  * </ul>
647  * @attention
648  * <ul>
649  * <li>None.</li>
650  * </ul>
651  *
652  * @param lr [IN] The lr value need to be saved in memory node info.
653  *
654  * @retval None.
655  * @par Dependency:
656  * <ul><li>los_memory.h: the header file that contains the API declaration.</li></ul>
657  */
658 extern VOID LOS_MemSetLr(UINT32 lr);
659 
660 #ifdef __cplusplus
661 #if __cplusplus
662 }
663 #endif /* __cplusplus */
664 #endif /* __cplusplus */
665 
666 #endif /* _LOS_MEMORY_H */
667