mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
Revert "include/nuttx/sched.h: Add storage for a previous signal mask. arch/: In all syscall implementations, block all signals before dispatching a system call; resotre signal mask when the system call returns."
Using the sigprocmask() for this purpose has too many side-effects.
This reverts commit 344f7bc9f6.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/misoc/src/lm32/lm32_swint.c
|
||||
*
|
||||
* Copyright (C) 2016. 2019 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Ramtin Amin <keytwo@gmail.com>
|
||||
*
|
||||
@@ -47,7 +47,6 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/sched.h>
|
||||
#include <nuttx/signal.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "lm32.h"
|
||||
@@ -227,11 +226,6 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
|
||||
g_current_regs[REG_EPC] = rtcb->xcp.syscall[index].sysreturn;
|
||||
#error "Missing logic -- need to restore the original mode"
|
||||
rtcb->xcp.nsyscalls = index;
|
||||
|
||||
/* Restore the signal mask when the syscall returns */
|
||||
|
||||
(void)nxsig_procmask(SIG_SETMASK, &rtcb->sigoldmask, NULL);
|
||||
sigemptyset(rtcb->sigoldmask);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -246,7 +240,6 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR struct tcb_s *rtcb = sched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
sigset_t set;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
||||
@@ -270,11 +263,6 @@ int lm32_swint(int irq, FAR void *context, FAR void *arg)
|
||||
/* Offset R0 to account for the reserved values */
|
||||
|
||||
g_current_regs[REG_A0] -= CONFIG_SYS_RESERVED;
|
||||
|
||||
/* Block all signals while the system call runs */
|
||||
|
||||
sigfillset(&set);
|
||||
(void)nxsig_procmask(SIG_BLOCK, &set, &rtcb->sigoldmask);
|
||||
#else
|
||||
svcerr("ERROR: Bad SYS call: %d\n", regs[REG_A0]);
|
||||
#endif
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/sched.h>
|
||||
#include <nuttx/signal.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "minerva.h"
|
||||
@@ -214,11 +213,6 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
|
||||
g_current_regs[REG_CSR_MEPC] = rtcb->xcp.syscall[index].sysreturn;
|
||||
#error "Missing logic -- need to restore the original mode"
|
||||
rtcb->xcp.nsyscalls = index;
|
||||
|
||||
/* Restore the signal mask when the syscall returns */
|
||||
|
||||
(void)nxsig_procmask(SIG_SETMASK, &rtcb->sigoldmask, NULL);
|
||||
sigemptyset(rtcb->sigoldmask);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -233,7 +227,6 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
|
||||
#ifdef CONFIG_BUILD_KERNEL
|
||||
FAR struct tcb_s *rtcb = sched_self();
|
||||
int index = rtcb->xcp.nsyscalls;
|
||||
sigset_t set;
|
||||
|
||||
/* Verify that the SYS call number is within range */
|
||||
|
||||
@@ -258,11 +251,6 @@ int minerva_swint(int irq, FAR void *context, FAR void *arg)
|
||||
/* Offset R0 to account for the reserved values */
|
||||
|
||||
g_current_regs[REG_A0] -= CONFIG_SYS_RESERVED;
|
||||
|
||||
/* Block all signals while the system call runs */
|
||||
|
||||
sigfillset(&set);
|
||||
(void)nxsig_procmask(SIG_BLOCK, &set, &rtcb->sigoldmask);
|
||||
#else
|
||||
svcerr("ERROR: Bad SYS call: %d\n", regs[REG_A0]);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user