mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Fix several compile errors for logic added for CONFIG_BUILD_KERNEL, but which cause problems for other configurations
This commit is contained in:
+3
-3
@@ -262,8 +262,8 @@ extern "C"
|
|||||||
#define EXTERN extern
|
#define EXTERN extern
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (!defined(CONFIG_ARCH_ADDRENV) || !defined(CONFIG_BUILD_KERNEL)) && \
|
#if (!defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_BUILD_KERNEL)) || \
|
||||||
(defined(CONFIG_BUILD_KERNEL) && !defined(__KERNEL__))
|
(defined(CONFIG_BUILD_DEFINED) && !defined(__KERNEL__))
|
||||||
/* User heap structure:
|
/* User heap structure:
|
||||||
*
|
*
|
||||||
* - Flat build: In the FLAT build, the user heap structure is a globally
|
* - Flat build: In the FLAT build, the user heap structure is a globally
|
||||||
@@ -272,7 +272,7 @@ extern "C"
|
|||||||
* in user space.
|
* in user space.
|
||||||
* - Kernel build: There are multiple heaps, one per process. The heap
|
* - Kernel build: There are multiple heaps, one per process. The heap
|
||||||
* structure is associated with the address environment and there is
|
* structure is associated with the address environment and there is
|
||||||
* no global user heap structure.
|
* no global user heap structure.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
EXTERN struct mm_heap_s g_mmheap;
|
EXTERN struct mm_heap_s g_mmheap;
|
||||||
|
|||||||
+3
-3
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include <nuttx/mm.h>
|
#include <nuttx/mm.h>
|
||||||
|
|
||||||
#ifdef MM_KERNEL_USRHEAP_INTF
|
#ifdef MM_KERNEL_USRHEAP_INIT
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Pre-processor definition
|
* Pre-processor definition
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -102,4 +102,4 @@ void umm_addregion(FAR void *heap_start, size_t heap_size)
|
|||||||
mm_addregion(USR_HEAP, heap_start, heap_size);
|
mm_addregion(USR_HEAP, heap_start, heap_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MM_KERNEL_USRHEAP_INTF */
|
#endif /* MM_KERNEL_USRHEAP_INIT */
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+8
-3
@@ -39,9 +39,11 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
|
||||||
#include <nuttx/mm.h>
|
#include <nuttx/mm.h>
|
||||||
|
|
||||||
#ifdef MM_KERNEL_USRHEAP_INTF
|
#ifdef MM_KERNEL_USRHEAP_INIT
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Pre-processor definition
|
* Pre-processor definition
|
||||||
@@ -70,7 +72,7 @@
|
|||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
struct mm_heap_s g_mmheap;
|
struct mm_heap_s g_mmheap;
|
||||||
#define USR_HEAP &g_mmheap;
|
#define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
@@ -100,8 +102,11 @@ struct mm_heap_s g_mmheap;
|
|||||||
|
|
||||||
void umm_initialize(FAR void *heap_start, size_t heap_size)
|
void umm_initialize(FAR void *heap_start, size_t heap_size)
|
||||||
{
|
{
|
||||||
|
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_BUILD_KERNEL)
|
||||||
DEBUGASSERT(ARCH_DATA_RESERVE_SIZE >= sizeof(struct addrenv_reserve_s));
|
DEBUGASSERT(ARCH_DATA_RESERVE_SIZE >= sizeof(struct addrenv_reserve_s));
|
||||||
|
#endif
|
||||||
|
|
||||||
mm_initialize(USR_HEAP, heap_start, heap_size);
|
mm_initialize(USR_HEAP, heap_start, heap_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MM_KERNEL_USRHEAP_INTF */
|
#endif /* MM_KERNEL_USRHEAP_INIT */
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@
|
|||||||
#else
|
#else
|
||||||
/* Otherwise, the user heap data structures are in common .bss */
|
/* Otherwise, the user heap data structures are in common .bss */
|
||||||
|
|
||||||
# define USR_HEAP &g_mmheap;
|
# define USR_HEAP &g_mmheap
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user