From 95542f193b2f9215e4c5104f449f76d1bfd7be12 Mon Sep 17 00:00:00 2001 From: zouboan Date: Tue, 1 Feb 2022 09:21:17 +0800 Subject: [PATCH] sparc adaptive patch --- arch/sparc/include/arch.h | 18 ++++ arch/sparc/src/bm3803/bm3803_head.S | 10 +- arch/sparc/src/bm3823/bm3823_head.S | 10 +- arch/sparc/src/common/up_checkstack.c | 94 ++++++++++++------- arch/sparc/src/common/up_createstack.c | 22 ++--- arch/sparc/src/common/up_initialize.c | 7 -- arch/sparc/src/common/up_internal.h | 7 ++ arch/sparc/src/common/up_releasestack.c | 23 ++--- arch/sparc/src/common/up_usestack.c | 17 ++-- arch/sparc/src/sparc_v8/up_dumpstate.c | 20 ---- arch/sparc/src/sparc_v8/up_initialstate.c | 19 ++++ .../sparc/bm3803/xx3803/configs/nsh/defconfig | 74 +++++++++++---- boards/sparc/bm3803/xx3803/scripts/Make.defs | 6 +- .../sparc/bm3803/xx3803/src/bm3803_appinit.c | 13 ++- boards/sparc/bm3823/xx3823/scripts/Make.defs | 6 +- 15 files changed, 220 insertions(+), 126 deletions(-) diff --git a/arch/sparc/include/arch.h b/arch/sparc/include/arch.h index 8a36419ab2..2be00b9c34 100644 --- a/arch/sparc/include/arch.h +++ b/arch/sparc/include/arch.h @@ -39,6 +39,24 @@ * Inline functions ****************************************************************************/ +/**************************************************************************** + * Name: up_getsp + ****************************************************************************/ + +static inline uint32_t up_getsp(void) +{ + uint32_t retval; + + do + { + retval = 0; + __asm__ volatile("mov %%sp, %0" : "=r" (retval) : "0" (retval)); + } + while (0); + + return retval; +} + /**************************************************************************** * Public Types ****************************************************************************/ diff --git a/arch/sparc/src/bm3803/bm3803_head.S b/arch/sparc/src/bm3803/bm3803_head.S index 26ca897d9b..126024b48e 100644 --- a/arch/sparc/src/bm3803/bm3803_head.S +++ b/arch/sparc/src/bm3803/bm3803_head.S @@ -70,6 +70,8 @@ jmp %l4+%lo(_handler); \ sll %l3, 1, %l4 ! l4 = WIM << 1 +#define BM3803_STACK_TOP _end+CONFIG_IDLETHREAD_STACKSIZE + .text .global _trap_table, _hardreset .global __start @@ -328,9 +330,9 @@ __start: nop ! initial the stack point - sethi %hi(__stack), %g1 - or %g1, %lo(__stack), %g1 - subcc %g1, 16, %g1 + sethi %hi(BM3803_STACK_TOP), %g1 + or %g1, %lo(BM3803_STACK_TOP), %g1 + subcc %g1, CPU_MINIMUM_STACK_FRAME_SIZE, %g1 mov %g1, %sp nop @@ -617,7 +619,7 @@ _fpdata: .align 8 g_idle_topstack: - .long _end + CONFIG_IDLETHREAD_STACKSIZE + .long BM3803_STACK_TOP .size g_idle_topstack, .-g_idle_topstack .end diff --git a/arch/sparc/src/bm3823/bm3823_head.S b/arch/sparc/src/bm3823/bm3823_head.S index fd844164b9..7dfc505608 100644 --- a/arch/sparc/src/bm3823/bm3823_head.S +++ b/arch/sparc/src/bm3823/bm3823_head.S @@ -70,6 +70,8 @@ jmp %l4+%lo(_handler); \ sll %l3, 1, %l4 ! l4 = WIM << 1 +#define BM3823_STACK_TOP _end+CONFIG_IDLETHREAD_STACKSIZE + .text .global _trap_table, _hardreset .global __start @@ -329,9 +331,9 @@ __start: nop ! initial the stack point - sethi %hi(__stack), %g1 - or %g1, %lo(__stack), %g1 - subcc %g1, 16, %g1 + sethi %hi(BM3823_STACK_TOP), %g1 + or %g1, %lo(BM3823_STACK_TOP), %g1 + subcc %g1, CPU_MINIMUM_STACK_FRAME_SIZE, %g1 mov %g1, %sp nop @@ -618,7 +620,7 @@ _fpdata: .align 8 g_idle_topstack: - .long _end + CONFIG_IDLETHREAD_STACKSIZE + .long BM3823_STACK_TOP .size g_idle_topstack, .-g_idle_topstack .end diff --git a/arch/sparc/src/common/up_checkstack.c b/arch/sparc/src/common/up_checkstack.c index d65e2a8119..b2302683e4 100644 --- a/arch/sparc/src/common/up_checkstack.c +++ b/arch/sparc/src/common/up_checkstack.c @@ -39,17 +39,31 @@ #ifdef CONFIG_STACK_COLORATION +/**************************************************************************** + * Pre-processor Macros + ****************************************************************************/ + +/* 32bit alignment macros */ + +#define INT32_ALIGN_MASK (3) +#define INT32_ALIGN_DOWN(a) ((a) & ~INT32_ALIGN_MASK) +#define INT32_ALIGN_UP(a) (((a) + INT32_ALIGN_MASK) & ~INT32_ALIGN_MASK) + /**************************************************************************** * Private Function Prototypes ****************************************************************************/ -static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack); +static size_t do_stackcheck(FAR void *stackbase, size_t nbytes); + +/**************************************************************************** + * Private Functions + ****************************************************************************/ /**************************************************************************** * Name: do_stackcheck * * Description: - * Determine (approximately) how much stack has been used be searching the + * Determine (approximately) how much stack has been used by searching the * stack memory for a high water mark. That is, the deepest level of the * stack that clobbered some recognizable marker in the stack memory. * @@ -62,42 +76,26 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack); * ****************************************************************************/ -static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) +static size_t do_stackcheck(FAR void *stackbase, size_t nbytes) { - FAR uintptr_t start; - FAR uintptr_t end; + uintptr_t start; + uintptr_t end; FAR uint32_t *ptr; size_t mark; - if (size == 0) + if (nbytes == 0) { return 0; } - /* Get aligned addresses of the top and bottom of the stack */ + /* Take extra care that we do not check outside the stack boundaries */ -#ifdef CONFIG_TLS - if (!int_stack) - { - /* Skip over the TLS data structure at the bottom of the stack */ - - DEBUGASSERT((alloc & TLS_STACK_MASK) == 0); - start = alloc + sizeof(struct tls_info_s); - } - else - { - start = alloc & ~3; - } -#else - UNUSED(int_stack); - start = alloc & ~3; -#endif - - end = (alloc + size + 3) & ~3; + start = INT32_ALIGN_UP((uintptr_t)stackbase); + end = INT32_ALIGN_DOWN((uintptr_t)stackbase + nbytes); /* Get the adjusted size based on the top and bottom of the stack */ - size = end - start; + nbytes = end - start; /* The ARM uses a push-down stack: the stack grows toward lower addresses * in memory. We need to start at the lowest address in the stack memory @@ -105,7 +103,7 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) * that does not have the magic value is the high water mark. */ - for (ptr = (FAR uint32_t *)start, mark = (size >> 2); + for (ptr = (FAR uint32_t *)start, mark = (nbytes >> 2); *ptr == STACK_COLOR && mark > 0; ptr++, mark--); @@ -157,6 +155,40 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) * Public Functions ****************************************************************************/ +/**************************************************************************** + * Name: up_stack_color + * + * Description: + * Write a well know value into the stack + * + ****************************************************************************/ + +void up_stack_color(FAR void *stackbase, size_t nbytes) +{ + uintptr_t start; + uintptr_t end; + size_t nwords; + FAR uint32_t *ptr; + + /* Take extra care that we do not write outside the stack boundaries */ + + start = INT32_ALIGN_UP((uintptr_t)stackbase); + end = nbytes ? INT32_ALIGN_DOWN((uintptr_t)stackbase + nbytes) : + up_getsp(); /* 0: colorize the running stack */ + + /* Get the adjusted size based on the top and bottom of the stack */ + + nwords = (end - start) >> 2; + ptr = (FAR uint32_t *)start; + + /* Set the entire stack to the coloration value */ + + while (nwords-- > 0) + { + *ptr++ = STACK_COLOR; + } +} + /**************************************************************************** * Name: up_check_stack and friends * @@ -175,13 +207,12 @@ static size_t do_stackcheck(uintptr_t alloc, size_t size, bool int_stack) size_t up_check_tcbstack(FAR struct tcb_s *tcb) { - return do_stackcheck((uintptr_t)tcb->stack_alloc_ptr, tcb->adj_stack_size, - false); + return do_stackcheck(tcb->stack_base_ptr, tcb->adj_stack_size); } ssize_t up_check_tcbstack_remain(FAR struct tcb_s *tcb) { - return (ssize_t)tcb->adj_stack_size - (ssize_t)up_check_tcbstack(tcb); + return tcb->adj_stack_size - up_check_tcbstack(tcb); } size_t up_check_stack(void) @@ -198,8 +229,7 @@ ssize_t up_check_stack_remain(void) size_t up_check_intstack(void) { return do_stackcheck((uintptr_t)&g_intstackalloc, - (CONFIG_ARCH_INTERRUPTSTACK & ~3), - true); + (CONFIG_ARCH_INTERRUPTSTACK & ~3)); } size_t up_check_intstack_remain(void) diff --git a/arch/sparc/src/common/up_createstack.c b/arch/sparc/src/common/up_createstack.c index 21b605ed89..f1f7475580 100644 --- a/arch/sparc/src/common/up_createstack.c +++ b/arch/sparc/src/common/up_createstack.c @@ -156,22 +156,13 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) size_t top_of_stack; size_t size_of_stack; - /* Yes.. If stack debug is enabled, then fill the stack with a - * recognizable value that we can use later to test for high - * water marks. - */ - -#ifdef CONFIG_STACK_COLORATION - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); -#endif - /* sparc uses a push-down stack: the stack grows toward lower * addresses in memory. The stack pointer register points to the * lowest, valid working address (the "top" of the stack). Items on * the stack are referenced as positive word offsets from sp. */ - top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size - 4; + top_of_stack = (uint32_t)tcb->stack_alloc_ptr + stack_size; /* The sparc stack must be aligned at word (8 byte) boundaries; for * floating point use, the stack must be aligned to 8-byte addresses. @@ -187,12 +178,21 @@ int up_create_stack(FAR struct tcb_s *tcb, size_t stack_size, uint8_t ttype) * The size need not be aligned. */ - size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr + 4; + size_of_stack = top_of_stack - (uint32_t)tcb->stack_alloc_ptr; /* Save the adjusted stack values in the struct tcb_s */ tcb->stack_base_ptr = tcb->stack_alloc_ptr; tcb->adj_stack_size = size_of_stack; + +#ifdef CONFIG_STACK_COLORATION + /* If stack debug is enabled, then fill the stack with a + * recognizable value that we can use later to test for high + * water marks. + */ + + up_stack_color(tcb->stack_base_ptr, tcb->adj_stack_size); +#endif /* CONFIG_STACK_COLORATION */ tcb->flags |= TCB_FLAG_FREE_STACK; board_autoled_on(LED_STACKCREATED); diff --git a/arch/sparc/src/common/up_initialize.c b/arch/sparc/src/common/up_initialize.c index 1b0644b232..6b95e999bc 100644 --- a/arch/sparc/src/common/up_initialize.c +++ b/arch/sparc/src/common/up_initialize.c @@ -156,13 +156,6 @@ void up_initialize(void) up_irqinitialize(); - /* Initialize the system timer interrupt */ - -#if !defined(CONFIG_SUPPRESS_INTERRUPTS) && \ - !defined(CONFIG_SUPPRESS_TIMER_INTS) - up_timer_initialize(); -#endif - #ifdef CONFIG_ARCH_DMA /* Initialize the DMA subsystem if the weak function up_dma_initialize has * been brought into the build diff --git a/arch/sparc/src/common/up_internal.h b/arch/sparc/src/common/up_internal.h index 2414c0e424..7ef8367eb5 100644 --- a/arch/sparc/src/common/up_internal.h +++ b/arch/sparc/src/common/up_internal.h @@ -28,6 +28,8 @@ #include #ifndef __ASSEMBLY__ +# include +# include # include # include #endif @@ -248,5 +250,10 @@ void up_usbuninitialize(void); # define up_usbuninitialize() #endif +/* Debug ********************************************************************/ +#ifdef CONFIG_STACK_COLORATION +void up_stack_color(FAR void *stackbase, size_t nbytes); +#endif + #endif /* __ASSEMBLY__ */ #endif /* __ARCH_SPARC_SRC_COMMON_UP_INTERNAL_H */ diff --git a/arch/sparc/src/common/up_releasestack.c b/arch/sparc/src/common/up_releasestack.c index e5e7e4328d..1d7f8f4e95 100644 --- a/arch/sparc/src/common/up_releasestack.c +++ b/arch/sparc/src/common/up_releasestack.c @@ -79,36 +79,29 @@ void up_release_stack(FAR struct tcb_s *dtcb, uint8_t ttype) { /* Is there a stack allocated? */ - if (dtcb->stack_alloc_ptr) + if (dtcb->stack_alloc_ptr && (dtcb->flags & TCB_FLAG_FREE_STACK)) { -#if defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_MM_KERNEL_HEAP) +#ifdef CONFIG_MM_KERNEL_HEAP /* Use the kernel allocator if this is a kernel thread */ if (ttype == TCB_FLAG_TTYPE_KERNEL) { - if (kmm_heapmember(dtcb->stack_alloc_ptr)) - { - kmm_free(dtcb->stack_alloc_ptr); - } + kmm_free(dtcb->stack_alloc_ptr); } else #endif { /* Use the user-space allocator if this is a task or pthread */ - if (umm_heapmember(dtcb->stack_alloc_ptr)) - { - kmm_free(dtcb->stack_alloc_ptr); - } + kumm_free(dtcb->stack_alloc_ptr); } - - /* Mark the stack freed */ - - dtcb->stack_alloc_ptr = NULL; } - /* The size of the allocated stack is now zero */ + /* Mark the stack freed */ + dtcb->flags &= ~TCB_FLAG_FREE_STACK; + dtcb->stack_alloc_ptr = NULL; + dtcb->stack_base_ptr = NULL; dtcb->adj_stack_size = 0; } diff --git a/arch/sparc/src/common/up_usestack.c b/arch/sparc/src/common/up_usestack.c index 25e4aeae04..b5c2e7c1e3 100644 --- a/arch/sparc/src/common/up_usestack.c +++ b/arch/sparc/src/common/up_usestack.c @@ -108,14 +108,6 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) tcb->stack_alloc_ptr = stack; - /* If stack debug is enabled, then fill the stack with a recognizable value - * that we can use later to test for high water marks. - */ - -#ifdef CONFIG_STACK_COLORATION - memset(tcb->stack_alloc_ptr, 0xaa, stack_size); -#endif - /* sparc uses a push-down stack: the stack grows toward loweraddresses in * memory. The stack pointer register, points to the lowest, valid work * address (the "top" of the stack). Items on the stack are referenced @@ -137,5 +129,14 @@ int up_use_stack(struct tcb_s *tcb, void *stack, size_t stack_size) tcb->stack_base_ptr = tcb->stack_alloc_ptr; tcb->adj_stack_size = size_of_stack; +#ifdef CONFIG_STACK_COLORATION + /* If stack debug is enabled, then fill the stack with a + * recognizable value that we can use later to test for high + * water marks. + */ + + up_stack_color(tcb->stack_base_ptr, tcb->adj_stack_size); +#endif /* CONFIG_STACK_COLORATION */ + return OK; } diff --git a/arch/sparc/src/sparc_v8/up_dumpstate.c b/arch/sparc/src/sparc_v8/up_dumpstate.c index 978ad9df0d..fd2d2b6587 100644 --- a/arch/sparc/src/sparc_v8/up_dumpstate.c +++ b/arch/sparc/src/sparc_v8/up_dumpstate.c @@ -43,26 +43,6 @@ * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: up_getsp - ****************************************************************************/ - -/* I don't know if the builtin to get SP is enabled */ - -static inline uint32_t up_getsp(void) -{ - uint32_t retval; - - do - { - retval = 0; - __asm__ volatile("mov %%sp, %0" : "=r" (retval) : "0" (retval)); - } - while (0); - - return retval; -} - /**************************************************************************** * Name: up_stackdump ****************************************************************************/ diff --git a/arch/sparc/src/sparc_v8/up_initialstate.c b/arch/sparc/src/sparc_v8/up_initialstate.c index 7d4112d874..298b2fbe38 100644 --- a/arch/sparc/src/sparc_v8/up_initialstate.c +++ b/arch/sparc/src/sparc_v8/up_initialstate.c @@ -67,6 +67,25 @@ void up_initial_state(struct tcb_s *tcb) struct xcptcontext *xcp = &tcb->xcp; uint32_t regval; + /* Initialize the idle thread stack */ + + if (tcb->pid == 0) + { + tcb->stack_alloc_ptr = (void *)(g_idle_topstack - + CONFIG_IDLETHREAD_STACKSIZE); + tcb->stack_base_ptr = tcb->stack_alloc_ptr; + tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE; + +#ifdef CONFIG_STACK_COLORATION + /* If stack debug is enabled, then fill the stack with a + * recognizable value that we can use later to test for high + * water marks. + */ + + up_stack_color(tcb->stack_alloc_ptr, 0); +#endif /* CONFIG_STACK_COLORATION */ + } + /* Initialize the initial exception register context structure */ memset(xcp, 0, sizeof(struct xcptcontext)); diff --git a/boards/sparc/bm3803/xx3803/configs/nsh/defconfig b/boards/sparc/bm3803/xx3803/configs/nsh/defconfig index 2f7071257c..7e6ece2b33 100644 --- a/boards/sparc/bm3803/xx3803/configs/nsh/defconfig +++ b/boards/sparc/bm3803/xx3803/configs/nsh/defconfig @@ -7,18 +7,12 @@ # # CONFIG_ARCH_LEDS is not set # CONFIG_ARCH_RAMFUNCS is not set -# CONFIG_DISABLE_ENVIRON is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set +# CONFIG_FS_LARGEFILE is not set +# CONFIG_LIBC_LONG_LONG is not set +# CONFIG_NSH_ARGCAT is not set +# CONFIG_NSH_CMDOPT_HEXDUMP is not set +# CONFIG_NSH_CMDPARMS is not set # CONFIG_NSH_DISABLE_DATE is not set -# CONFIG_NSH_DISABLE_DD is not set -# CONFIG_NSH_DISABLE_EXEC is not set -# CONFIG_NSH_DISABLE_EXIT is not set -# CONFIG_NSH_DISABLE_GET is not set -# CONFIG_NSH_DISABLE_HEXDUMP is not set -# CONFIG_NSH_DISABLE_MKRD is not set -# CONFIG_NSH_DISABLE_PRINTF is not set -# CONFIG_NSH_DISABLE_PS is not set -# CONFIG_NSH_DISABLE_TIME is not set CONFIG_ARCH="sparc" CONFIG_ARCH_BOARD="xx3803" CONFIG_ARCH_BOARD_XX3803=y @@ -46,7 +40,9 @@ CONFIG_DEBUG_FEATURES=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DEBUG_WARN=y -CONFIG_DEFAULT_SMALL=y +CONFIG_DEFAULT_TASK_STACKSIZE=4096 +CONFIG_DISABLE_MQUEUE=y +CONFIG_DISABLE_POSIX_TIMERS=y CONFIG_ELF=y CONFIG_ELF_ALIGN_LOG2=3 CONFIG_ELF_BUFFERINCR=64 @@ -55,44 +51,86 @@ CONFIG_ELF_STACKSIZE=8192 CONFIG_ENDIAN_BIG=y CONFIG_EXAMPLES_ELF=y CONFIG_EXAMPLES_HELLO=y -CONFIG_EXAMPLES_HELLO_STACKSIZE=4096 CONFIG_EXAMPLES_NULL=y CONFIG_EXECFUNCS_HAVE_SYMTAB=y CONFIG_EXECFUNCS_SYSTEM_SYMTAB=y +CONFIG_FS_PROCFS=y CONFIG_FS_ROMFS=y +CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_INIT_ENTRYPOINT="nsh_main" -CONFIG_INIT_STACKSIZE=4096 +CONFIG_INIT_STACKSIZE=8192 CONFIG_INTELHEX_BINARY=y CONFIG_LIBM=y CONFIG_MEMSET_64BIT=y CONFIG_MEMSET_OPTSPEED=y CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_DISABLEBG=y +CONFIG_NSH_DISABLESCRIPT=y +CONFIG_NSH_DISABLE_CAT=y +CONFIG_NSH_DISABLE_CMP=y +CONFIG_NSH_DISABLE_CP=y +CONFIG_NSH_DISABLE_DF=y +CONFIG_NSH_DISABLE_ECHO=y +CONFIG_NSH_DISABLE_ENV=y +CONFIG_NSH_DISABLE_EXPORT=y +CONFIG_NSH_DISABLE_FREE=y +CONFIG_NSH_DISABLE_IFCONFIG=y +CONFIG_NSH_DISABLE_IFUPDOWN=y +CONFIG_NSH_DISABLE_KILL=y +CONFIG_NSH_DISABLE_LOSETUP=y +CONFIG_NSH_DISABLE_MKDIR=y +CONFIG_NSH_DISABLE_MOUNT=y +CONFIG_NSH_DISABLE_MV=y +CONFIG_NSH_DISABLE_PSSTACKUSAGE=y +CONFIG_NSH_DISABLE_PUT=y +CONFIG_NSH_DISABLE_PWD=y +CONFIG_NSH_DISABLE_REBOOT=y +CONFIG_NSH_DISABLE_RM=y +CONFIG_NSH_DISABLE_RMDIR=y +CONFIG_NSH_DISABLE_SEMICOLON=y +CONFIG_NSH_DISABLE_SET=y +CONFIG_NSH_DISABLE_SOURCE=y +CONFIG_NSH_DISABLE_TELNETD=y +CONFIG_NSH_DISABLE_TEST=y +CONFIG_NSH_DISABLE_TRUNCATE=y +CONFIG_NSH_DISABLE_UMOUNT=y +CONFIG_NSH_DISABLE_UNAME=y +CONFIG_NSH_DISABLE_UNSET=y +CONFIG_NSH_DISABLE_USLEEP=y +CONFIG_NSH_DISABLE_WGET=y +CONFIG_NSH_DISABLE_XD=y +CONFIG_NSH_FILEIOSIZE=512 CONFIG_NSH_FILE_APPS=y +CONFIG_NSH_LINELEN=64 +CONFIG_NSH_READLINE=y CONFIG_NUNGET_CHARS=0 CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=32768 CONFIG_PREALLOC_TIMERS=0 -CONFIG_PTHREAD_STACK_DEFAULT=4096 +CONFIG_PTHREAD_MUTEX_UNSAFE=y +CONFIG_PTHREAD_STACK_MIN=2048 CONFIG_RAM_SIZE=1048576 CONFIG_RAM_START=0x40000000 CONFIG_RAW_BINARY=y CONFIG_RR_INTERVAL=10 CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKSTACKSIZE=4096 CONFIG_SCHED_LPWORK=y CONFIG_SCHED_LPWORKPRIORITY=120 -CONFIG_SCHED_LPWORKSTACKSIZE=4096 CONFIG_SCHED_TICKLESS=y CONFIG_SCHED_WAITPID=y +CONFIG_SDCLONE_DISABLE=y +CONFIG_SIG_PREALLOC_IRQ_ACTIONS=4 CONFIG_SPECIFIC_DRIVERS=y CONFIG_STACK_COLORATION=y CONFIG_START_DAY=16 CONFIG_START_MONTH=6 CONFIG_START_YEAR=2011 CONFIG_SYSTEM_NSH=y -CONFIG_SYSTEM_NSH_STACKSIZE=4096 +CONFIG_SYSTEM_STACKMONITOR=y +CONFIG_SYSTEM_STACKMONITOR_INTERVAL=1 CONFIG_TASK_SPAWN_DEFAULT_STACKSIZE=32768 CONFIG_UART3_SERIAL_CONSOLE=y CONFIG_USEC_PER_TICK=1 CONFIG_XX3803_WDG=y CONFIG_XX3803_WDG_THREAD=y +CONFIG_XX3803_WDG_THREAD_STACKSIZE=4096 diff --git a/boards/sparc/bm3803/xx3803/scripts/Make.defs b/boards/sparc/bm3803/xx3803/scripts/Make.defs index 3896d9148d..3f9590bfdb 100644 --- a/boards/sparc/bm3803/xx3803/scripts/Make.defs +++ b/boards/sparc/bm3803/xx3803/scripts/Make.defs @@ -69,10 +69,10 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHDEFINES = -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ # ELF module definitions diff --git a/boards/sparc/bm3803/xx3803/src/bm3803_appinit.c b/boards/sparc/bm3803/xx3803/src/bm3803_appinit.c index 778a4bc2ba..407a6ede9f 100644 --- a/boards/sparc/bm3803/xx3803/src/bm3803_appinit.c +++ b/boards/sparc/bm3803/xx3803/src/bm3803_appinit.c @@ -23,7 +23,7 @@ ****************************************************************************/ #include - +#include #include #include @@ -142,5 +142,16 @@ int board_app_initialize(uintptr_t arg) } #endif +#ifdef CONFIG_FS_PROCFS + /* Mount the procfs file system */ + + ret = mount(NULL, BM3803_PROCFS_MOUNTPOINT, "procfs", 0, NULL); + if (ret < 0) + { + syslog(LOG_ERR, "Failed to mount procfs at %s: %d\n", + BM3803_PROCFS_MOUNTPOINT, ret); + } +#endif + return ret; } diff --git a/boards/sparc/bm3823/xx3823/scripts/Make.defs b/boards/sparc/bm3823/xx3823/scripts/Make.defs index aa9a7a5704..e8323f9fc0 100644 --- a/boards/sparc/bm3823/xx3823/scripts/Make.defs +++ b/boards/sparc/bm3823/xx3823/scripts/Make.defs @@ -66,10 +66,10 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHDEFINES = -CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe -CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) -pipe +CFLAGS = $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe +CXXFLAGS = $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) -CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRADEFINES) +CPPFLAGS = $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS = $(CFLAGS) -D__ASSEMBLY__ ASMEXT = .S