Skip to content

Commit 746966d

Browse files
committed
arch: support decouple signal related function from arch code
make the following arch can work when signal is disabled: 1. arch/arm 2. arm/arm64 3. arch/avr 4. arch/z80 5. arch/mips 6. arch/x86 7. arch/misoc 8. arch/tricore 9. arch/risc-v 10. arch/sim 11. arch/z16 12. arch/xtensa 13. arch/or1k 14. archrenesas 15. arch/sparc Signed-off-by: guoshichao <[email protected]>
1 parent a567855 commit 746966d

File tree

90 files changed

+353
-139
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+353
-139
lines changed

arch/arm/include/arm/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@
129129
#ifndef __ASSEMBLY__
130130
struct xcptcontext
131131
{
132+
#ifndef CONFIG_DISABLE_SIGNALS
132133
/* These are saved copies of the context used during
133134
* signal processing.
134135
*/
135136

136137
uint32_t *saved_regs;
138+
#endif
137139

138140
/* Register save area with XCPTCONTEXT_SIZE, only valid when:
139141
* 1.The task isn't running or

arch/arm/include/armv6-m/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ struct xcpt_syscall_s
158158

159159
struct xcptcontext
160160
{
161+
#ifndef CONFIG_DISABLE_SIGNALS
161162
/* These are saved copies of the context used during
162163
* signal processing.
163164
*/
@@ -171,6 +172,7 @@ struct xcptcontext
171172

172173
uint32_t sigreturn;
173174
#endif
175+
#endif /* !CONFIG_DISABLE_SIGNALS */
174176

175177
#ifdef CONFIG_LIB_SYSCALL
176178
/* The following array holds the return address and the exc_return value

arch/arm/include/armv7-a/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ struct xcpt_syscall_s
259259

260260
struct xcptcontext
261261
{
262+
#ifndef CONFIG_DISABLE_SIGNALS
262263
/* These are saved copies of the context used during
263264
* signal processing.
264265
*/
@@ -273,6 +274,7 @@ struct xcptcontext
273274
uint32_t sigreturn;
274275

275276
#endif
277+
#endif /* !CONFIG_DISABLE_SIGNALS */
276278

277279
/* Register save area with XCPTCONTEXT_SIZE, only valid when:
278280
* 1.The task isn't running or

arch/arm/include/armv7-m/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ struct xcpt_syscall_s
214214

215215
struct xcptcontext
216216
{
217+
#ifndef CONFIG_DISABLE_SIGNALS
217218
/* These are saved copies of the context used during
218219
* signal processing.
219220
*/
@@ -228,6 +229,7 @@ struct xcptcontext
228229
uint32_t sigreturn;
229230

230231
#endif
232+
#endif /* !CONFIG_DISABLE_SIGNALS */
231233

232234
#ifdef CONFIG_LIB_SYSCALL
233235
/* The following array holds the return address and the exc_return value

arch/arm/include/armv7-r/irq.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ struct xcpt_syscall_s
259259

260260
struct xcptcontext
261261
{
262+
#ifndef CONFIG_DISABLE_SIGNALS
262263
/* These are saved copies of the context used during
263264
* signal processing.
264265
*/
@@ -272,6 +273,7 @@ struct xcptcontext
272273

273274
uint32_t sigreturn;
274275
#endif
276+
#endif /* !CONFIG_DISABLE_SIGNALS */
275277

276278
/* Register save area with XCPTCONTEXT_SIZE, only valid when:
277279
* 1.The task isn't running or

arch/arm/include/armv8-m/irq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ struct xcpt_syscall_s
225225

226226
struct xcptcontext
227227
{
228+
#ifndef CONFIG_DISABLE_SIGNALS
228229
/* These are saved copies of the context used during
229230
* signal processing.
230231
*/
@@ -240,6 +241,8 @@ struct xcptcontext
240241

241242
#endif
242243

244+
#endif /* !CONFIG_DISABLE_SIGNALS */
245+
243246
#ifdef CONFIG_LIB_SYSCALL
244247
/* The following array holds the return address and the exc_return value
245248
* needed to return from each nested system call.

arch/arm/src/arm/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ list(
2929
arm_doirq.c
3030
arm_initialstate.c
3131
arm_prefetchabort.c
32-
arm_schedulesigaction.c
33-
arm_sigdeliver.c
3432
arm_syscall.c
3533
arm_tcbinfo.c
3634
arm_undefinedinsn.c
@@ -39,6 +37,10 @@ list(
3937
arm_vectortab.S
4038
arm_saveusercontext.S)
4139

40+
if(NOT CONFIG_DISABLE_SIGNALS)
41+
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
42+
endif()
43+
4244
if(CONFIG_PAGING)
4345
list(APPEND SRCS arm_pginitialize.c arm_checkmapping.c arm_allocpage.c
4446
arm_va2pte.c)

arch/arm/src/arm/Make.defs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ include common/Make.defs
2727
HEAD_ASRC = arm_head.S
2828

2929
CMN_CSRCS += arm_dataabort.c arm_doirq.c arm_initialstate.c
30-
CMN_CSRCS += arm_prefetchabort.c arm_schedulesigaction.c
31-
CMN_CSRCS += arm_sigdeliver.c arm_syscall.c arm_tcbinfo.c
30+
CMN_CSRCS += arm_prefetchabort.c arm_syscall.c arm_tcbinfo.c
3231
CMN_CSRCS += arm_undefinedinsn.c
3332

33+
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
34+
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
35+
endif
36+
3437
CMN_ASRCS += arm_cache.S arm_vectors.S arm_vectortab.S
3538
CMN_ASRCS += arm_saveusercontext.S
3639

arch/arm/src/armv6-m/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@ set(SRCS
2727
arm_doirq.c
2828
arm_hardfault.c
2929
arm_initialstate.c
30-
arm_schedulesigaction.c
31-
arm_sigdeliver.c
3230
arm_svcall.c
3331
arm_systemreset.c
3432
arm_tcbinfo.c
3533
arm_trigger_irq.c
3634
arm_vectors.c)
3735

36+
if(NOT CONFIG_DISABLE_SIGNALS)
37+
list(APPEND SRCS arm_schedulesigaction.c arm_sigdeliver.c)
38+
endif()
39+
3840
if((DEFINED CONFIG_DEBUG_FEATURES AND CONFIG_DEBUG_FEATURES)
3941
OR (DEFINED CONFIG_ARM_COREDUMP_REGION AND CONFIG_ARM_COREDUMP_REGION))
4042
list(APPEND SRCS arm_dumpnvic.c)

arch/arm/src/armv6-m/Make.defs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ include common/Make.defs
2727
CMN_ASRCS += arm_exception.S arm_saveusercontext.S
2828

2929
CMN_CSRCS += arm_cpuinfo.c arm_doirq.c arm_hardfault.c arm_initialstate.c
30-
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c arm_svcall.c
31-
CMN_CSRCS += arm_systemreset.c arm_tcbinfo.c
32-
CMN_CSRCS += arm_trigger_irq.c
30+
CMN_CSRCS += arm_svcall.c arm_systemreset.c arm_tcbinfo.c arm_trigger_irq.c
31+
32+
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
33+
CMN_CSRCS += arm_schedulesigaction.c arm_sigdeliver.c
34+
endif
3335

3436
ifneq ($(CONFIG_ARCH_HAVE_CUSTOM_VECTORS),y)
3537
CMN_CSRCS += arm_vectors.c

0 commit comments

Comments
 (0)