Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions arch/arm/include/arm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@
#ifndef __ASSEMBLY__
struct xcptcontext
{
#ifndef CONFIG_DISABLE_SIGNALS
/* These are saved copies of the context used during
* signal processing.
*/

uint32_t *saved_regs;
#endif

/* Register save area with XCPTCONTEXT_SIZE, only valid when:
* 1.The task isn't running or
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/include/armv6-m/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ struct xcpt_syscall_s

struct xcptcontext
{
#ifndef CONFIG_DISABLE_SIGNALS
/* These are saved copies of the context used during
* signal processing.
*/
Expand All @@ -171,6 +172,7 @@ struct xcptcontext

uint32_t sigreturn;
#endif
#endif /* !CONFIG_DISABLE_SIGNALS */

#ifdef CONFIG_LIB_SYSCALL
/* The following array holds the return address and the exc_return value
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/include/armv7-a/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ struct xcpt_syscall_s

struct xcptcontext
{
#ifndef CONFIG_DISABLE_SIGNALS
/* These are saved copies of the context used during
* signal processing.
*/
Expand All @@ -273,6 +274,7 @@ struct xcptcontext
uint32_t sigreturn;

#endif
#endif /* !CONFIG_DISABLE_SIGNALS */

/* Register save area with XCPTCONTEXT_SIZE, only valid when:
* 1.The task isn't running or
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/include/armv7-m/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ struct xcpt_syscall_s

struct xcptcontext
{
#ifndef CONFIG_DISABLE_SIGNALS
/* These are saved copies of the context used during
* signal processing.
*/
Expand All @@ -228,6 +229,7 @@ struct xcptcontext
uint32_t sigreturn;

#endif
#endif /* !CONFIG_DISABLE_SIGNALS */

#ifdef CONFIG_LIB_SYSCALL
/* The following array holds the return address and the exc_return value
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/include/armv7-r/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ struct xcpt_syscall_s

struct xcptcontext
{
#ifndef CONFIG_DISABLE_SIGNALS
/* These are saved copies of the context used during
* signal processing.
*/
Expand All @@ -272,6 +273,7 @@ struct xcptcontext

uint32_t sigreturn;
#endif
#endif /* !CONFIG_DISABLE_SIGNALS */

/* Register save area with XCPTCONTEXT_SIZE, only valid when:
* 1.The task isn't running or
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/include/armv8-m/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ struct xcpt_syscall_s

struct xcptcontext
{
#ifndef CONFIG_DISABLE_SIGNALS
/* These are saved copies of the context used during
* signal processing.
*/
Expand All @@ -240,6 +241,8 @@ struct xcptcontext

#endif

#endif /* !CONFIG_DISABLE_SIGNALS */

#ifdef CONFIG_LIB_SYSCALL
/* The following array holds the return address and the exc_return value
* needed to return from each nested system call.
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/src/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ list(
arm_doirq.c
arm_initialstate.c
arm_prefetchabort.c
arm_schedulesigaction.c
arm_sigdeliver.c
arm_syscall.c
arm_tcbinfo.c
arm_undefinedinsn.c
Expand All @@ -39,6 +37,10 @@ list(
arm_vectortab.S
arm_saveusercontext.S)

if(NOT CONFIG_DISABLE_SIGNALS)
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
endif()

if(CONFIG_PAGING)
list(APPEND SRCS arm_pginitialize.c arm_checkmapping.c arm_allocpage.c
arm_va2pte.c)
Expand Down
7 changes: 5 additions & 2 deletions arch/arm/src/arm/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ include common/Make.defs
HEAD_ASRC = arm_head.S

CMN_CSRCS += arm_dataabort.c arm_doirq.c arm_initialstate.c
CMN_CSRCS += arm_prefetchabort.c arm_schedulesigaction.c
CMN_CSRCS += arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c
CMN_CSRCS += arm_prefetchabort.c arm_syscall.c arm_tcbinfo.c
CMN_CSRCS += arm_undefinedinsn.c

ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
endif

CMN_ASRCS += arm_cache.S arm_vectors.S arm_vectortab.S
CMN_ASRCS += arm_saveusercontext.S

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/arm/arm_vectors.S
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ arm_vectorirq:
/* Call arm_decodeirq() on the interrupt stack */

ldr sp, .Lirqstacktop /* SP = interrupt stack top */
#else
#elif !defined(CONFIG_DISABLE_SIGNALS)
/* Call arm_decodeirq() on the user stack */

/* If the interrupt stack is disabled, reserve xcpcontext to ensure
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/src/armv6-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,16 @@ set(SRCS
arm_doirq.c
arm_hardfault.c
arm_initialstate.c
arm_schedulesigaction.c
arm_sigdeliver.c
arm_svcall.c
arm_systemreset.c
arm_tcbinfo.c
arm_trigger_irq.c
arm_vectors.c)

if(NOT CONFIG_DISABLE_SIGNALS)
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
endif()

if((DEFINED CONFIG_DEBUG_FEATURES AND CONFIG_DEBUG_FEATURES)
OR (DEFINED CONFIG_ARM_COREDUMP_REGION AND CONFIG_ARM_COREDUMP_REGION))
list(APPEND SRCS arm_dumpnvic.c)
Expand Down
8 changes: 5 additions & 3 deletions arch/arm/src/armv6-m/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ include common/Make.defs
CMN_ASRCS += arm_exception.S arm_saveusercontext.S

CMN_CSRCS += arm_cpuinfo.c arm_doirq.c arm_hardfault.c arm_initialstate.c
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c arm_svcall.c
CMN_CSRCS += arm_systemreset.c arm_tcbinfo.c
CMN_CSRCS += arm_trigger_irq.c
CMN_CSRCS += arm_svcall.c arm_systemreset.c arm_tcbinfo.c arm_trigger_irq.c

ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
endif

ifneq ($(CONFIG_ARCH_HAVE_CUSTOM_VECTORS),y)
CMN_CSRCS += arm_vectors.c
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/armv6-m/arm_doirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)

irq_dispatch(irq, regs);
#endif
#ifndef CONFIG_DISABLE_SIGNALS
if (tcb->sigdeliver)
{
/* Pendsv able to access running tcb with no critical section */

up_schedule_sigaction(tcb);
}
#endif

up_irq_save();
}
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/armv6-m/arm_exception.S
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ exception_common:
lsls r2, #(31 - EXC_RETURN_THREAD_BITNO) /* Move to bit 31 */
bpl 3f /* Test bit 31 */
mov r2, r1 /* Reserve signal context */
#ifndef CONFIG_DISABLE_SIGNALS
subs r2, r2, #XCPTCONTEXT_SIZE
#endif
msr msp, r2 /* We are using the main stack pointer */
isb sy
3:
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/src/armv7-a/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ list(
arm_initialstate.c
arm_mmu.c
arm_prefetchabort.c
arm_schedulesigaction.c
arm_sigdeliver.c
arm_syscall.c
arm_tcbinfo.c
arm_undefinedinsn.c
arm_perf.c
cp15_cacheops.c)

if(NOT CONFIG_DISABLE_SIGNALS)
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
endif()

if(CONFIG_ARMV7A_GICv2M)
list(APPEND SRCS arm_gicv2m.c)
endif()
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/src/armv7-a/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ CMN_ASRCS += arm_cpuhead.S arm_vectors.S arm_saveusercontext.S
CMN_CSRCS += arm_cache.c arm_cpuinfo.c arm_dataabort.c
CMN_CSRCS += arm_doirq.c arm_gicv2.c arm_gicv2_dump.c
CMN_CSRCS += arm_initialstate.c arm_mmu.c arm_prefetchabort.c
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
CMN_CSRCS += arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c
CMN_CSRCS += arm_perf.c cp15_cacheops.c

ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
endif

ifeq ($(CONFIG_ARMV7A_GICv2M),y)
CMN_CSRCS += arm_gicv2m.c
endif
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/src/armv7-a/arm_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ uint32_t *arm_syscall(uint32_t *regs)
break;
#endif

#ifdef CONFIG_BUILD_KERNEL
#if defined(CONFIG_BUILD_KERNEL) && !defined(CONFIG_DISABLE_SIGNALS)
/* R0=SYS_signal_handler: This a user signal handler callback
*
* void signal_handler(_sa_sigaction_t sighand, int signo,
Expand Down Expand Up @@ -439,9 +439,9 @@ uint32_t *arm_syscall(uint32_t *regs)
#endif
}
break;
#endif
#endif /* CONFIG_BUILD_KERNEL && !CONFIG_DISABLE_SIGNALS */

#ifdef CONFIG_BUILD_KERNEL
#if defined(CONFIG_BUILD_KERNEL) && !defined(CONFIG_DISABLE_SIGNALS)
/* R0=SYS_signal_handler_return: This a user signal handler callback
*
* void signal_handler_return(void);
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/src/armv7-a/arm_vectors.S
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ arm_vectorirq:
#else
/* Call arm_decodeirq() on the user stack */

#ifndef CONFIG_DISABLE_SIGNALS
/* If the interrupt stack is disabled, reserve xcpcontext to ensure
* that signal processing can have a separate xcpcontext to handle
* signal context (reference: arm_schedulesigaction.c):
Expand All @@ -234,6 +235,7 @@ arm_vectorirq:

sub sp, sp, #XCPTCONTEXT_SIZE /* Reserve signal context */
#endif
#endif /* CONFIG_ARCH_INTERRUPTSTACK > 7 */

bic sp, sp, #7 /* Force 8-byte alignment */
mov fp, r0
Expand Down Expand Up @@ -337,7 +339,7 @@ arm_vectorsvc:
/* Call arm_syscall() on the interrupt stack */

setirqstack r1, r3 /* SP = interrupt stack top */
#else
#elif !defined(CONFIG_DISABLE_SIGNALS)
/* Call arm_syscall() on the user stack */

/* If the interrupt stack is disabled, reserve xcpcontext to ensure
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/src/armv7-m/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ set(SRCS
arm_itm.c
arm_memfault.c
arm_perf.c
arm_schedulesigaction.c
arm_sigdeliver.c
arm_svcall.c
arm_systemreset.c
arm_tcbinfo.c
Expand All @@ -45,6 +43,10 @@ set(SRCS
arm_vectors.c
arm_dbgmonitor.c)

if(NOT CONFIG_DISABLE_SIGNALS)
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
endif()

if(CONFIG_ARMV7M_SYSTICK)
list(APPEND SRCS arm_systick.c)
endif()
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/src/armv7-m/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@ CMN_ASRCS += arm_exception.S arm_saveusercontext.S
CMN_CSRCS += arm_busfault.c arm_cache.c arm_cpuinfo.c arm_doirq.c
CMN_CSRCS += arm_hardfault.c arm_initialstate.c arm_itm.c
CMN_CSRCS += arm_memfault.c arm_perf.c
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
CMN_CSRCS += arm_svcall.c arm_systemreset.c arm_tcbinfo.c
CMN_CSRCS += arm_trigger_irq.c arm_usagefault.c arm_dbgmonitor.c

ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
endif

ifneq ($(CONFIG_ARCH_HAVE_CUSTOM_VECTORS),y)
CMN_CSRCS += arm_vectors.c
endif
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/src/armv7-m/arm_doirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ uint32_t *arm_doirq(int irq, uint32_t *regs)

irq_dispatch(irq, regs);
#endif
#ifndef CONFIG_DISABLE_SIGNALS
if (tcb->sigdeliver)
{
/* Pendsv able to access running tcb with no critical section */

up_schedule_sigaction(tcb);
}
#endif

up_irq_save();
}
Expand Down
6 changes: 4 additions & 2 deletions arch/arm/src/armv7-r/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ list(
arm_doirq.c
arm_initialstate.c
arm_prefetchabort.c
arm_schedulesigaction.c
arm_sigdeliver.c
arm_syscall.c
arm_tcbinfo.c
arm_undefinedinsn.c
arm_perf.c
cp15_cacheops.c)

if(NOT CONFIG_DISABLE_SIGNALS)
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
endif()

if(NOT CONFIG_ARCH_CHIP STREQUAL tms570)
list(APPEND SRCS arm_gicv2.c arm_gicv2_dump.c)
endif()
Expand Down
5 changes: 4 additions & 1 deletion arch/arm/src/armv7-r/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ HEAD_ASRC += arm_vectortab.S
CMN_CSRCS += arm_cache.c arm_cpuinfo.c arm_dataabort.c
CMN_CSRCS += arm_doirq.c arm_gicv2.c arm_gicv2_dump.c
CMN_CSRCS += arm_initialstate.c arm_prefetchabort.c
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
CMN_CSRCS += arm_syscall.c arm_tcbinfo.c arm_undefinedinsn.c
CMN_CSRCS += arm_perf.c cp15_cacheops.c

ifneq ($(CONFIG_DISABLE_SIGNALS),y)
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
endif

# Common C source files

CMN_ASRCS += arm_head.S arm_vectors.S arm_saveusercontext.S
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/src/armv7-r/arm_syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ uint32_t *arm_syscall(uint32_t *regs)
break;
#endif

#ifdef CONFIG_BUILD_PROTECTED
#if defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_DISABLE_SIGNALS)
/* R0=SYS_signal_handler: This a user signal handler callback
*
* void signal_handler(_sa_sigaction_t sighand, int signo,
Expand Down Expand Up @@ -433,9 +433,9 @@ uint32_t *arm_syscall(uint32_t *regs)
#endif
}
break;
#endif
#endif /* CONFIG_BUILD_PROTECTED && !CONFIG_DISABLE_SIGNALS */

#ifdef CONFIG_BUILD_PROTECTED
#if defined(CONFIG_BUILD_PROTECTED) && !defined(CONFIG_DISABLE_SIGNALS)
/* R0=SYS_signal_handler_return: This a user signal handler callback
*
* void signal_handler_return(void);
Expand Down
Loading