mm/mm_heap: fix mm_heap not support BUILD_FLAT

1. change ifdef __KERNEL__ to:
   if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)

2. change mm_delaylist to *mm_delaylist

3. change FAR struct mm_delaynode_s *new to:
   FAR struct mm_delaynode_s *tmp

4. should check mm_trysemaphore() return values

Change-Id: I57ba991f13c3eaf56dc2d71ac946c11669e32dfa
Signed-off-by: ligd <liguiding@fishsemi.com>
This commit is contained in:
ligd
2020-04-10 12:32:32 +08:00
committed by patacongo
parent cbf31bca5c
commit ef360394c7
4 changed files with 23 additions and 18 deletions
+3 -3
View File
@@ -227,7 +227,7 @@ struct mm_freenode_s
FAR struct mm_freenode_s *blink;
};
#ifdef __KERNEL__
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
struct mm_delaynode_s
{
struct mm_delaynode_s *flink;
@@ -274,10 +274,10 @@ struct mm_heap_s
struct mm_freenode_s mm_nodelist[MM_NNODES];
#ifdef __KERNEL__
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
/* Free delay list, for some situation can't do free immdiately */
struct mm_delaynode_s mm_delaylist;
struct mm_delaynode_s *mm_delaylist;
#endif
};