enforce minimal stack size in rt_thread_create() for native
This commit is contained in:
parent
387916dd00
commit
3975a30198
3 changed files with 7 additions and 8 deletions
|
@ -17,10 +17,7 @@
|
||||||
#ifndef FINSH_THREAD_PRIORITY
|
#ifndef FINSH_THREAD_PRIORITY
|
||||||
#define FINSH_THREAD_PRIORITY 20
|
#define FINSH_THREAD_PRIORITY 20
|
||||||
#endif
|
#endif
|
||||||
#ifdef __ISA_NATIVE__
|
#ifndef FINSH_THREAD_STACK_SIZE
|
||||||
#undef FINSH_THREAD_STACK_SIZE
|
|
||||||
#define FINSH_THREAD_STACK_SIZE (4096 * 3)
|
|
||||||
#elif !defined(FINSH_THREAD_STACK_SIZE)
|
|
||||||
#define FINSH_THREAD_STACK_SIZE 2048
|
#define FINSH_THREAD_STACK_SIZE 2048
|
||||||
#endif
|
#endif
|
||||||
#ifndef FINSH_CMD_SIZE
|
#ifndef FINSH_CMD_SIZE
|
||||||
|
|
|
@ -21,10 +21,7 @@
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
#ifdef RT_USING_USER_MAIN
|
#ifdef RT_USING_USER_MAIN
|
||||||
#ifdef __ISA_NATIVE__
|
#ifndef RT_MAIN_THREAD_STACK_SIZE
|
||||||
#undef RT_MAIN_THREAD_STACK_SIZE
|
|
||||||
#define RT_MAIN_THREAD_STACK_SIZE (4096 * 3)
|
|
||||||
#elif !defined(RT_MAIN_THREAD_STACK_SIZE)
|
|
||||||
#define RT_MAIN_THREAD_STACK_SIZE 2048
|
#define RT_MAIN_THREAD_STACK_SIZE 2048
|
||||||
#endif /* RT_MAIN_THREAD_STACK_SIZE */
|
#endif /* RT_MAIN_THREAD_STACK_SIZE */
|
||||||
#ifndef RT_MAIN_THREAD_PRIORITY
|
#ifndef RT_MAIN_THREAD_PRIORITY
|
||||||
|
|
|
@ -492,6 +492,11 @@ rt_thread_t rt_thread_create(const char *name,
|
||||||
if (thread == RT_NULL)
|
if (thread == RT_NULL)
|
||||||
return RT_NULL;
|
return RT_NULL;
|
||||||
|
|
||||||
|
#ifdef __ISA_NATIVE__
|
||||||
|
const rt_uint32_t stack_size_min = 0x4000;
|
||||||
|
if (stack_size < stack_size_min) stack_size = stack_size_min;
|
||||||
|
#endif
|
||||||
|
|
||||||
stack_start = (void *)RT_KERNEL_MALLOC(stack_size);
|
stack_start = (void *)RT_KERNEL_MALLOC(stack_size);
|
||||||
if (stack_start == RT_NULL)
|
if (stack_start == RT_NULL)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue