summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog7
-rw-r--r--nuttx/Documentation/NuttxPortingGuide.html2
-rw-r--r--nuttx/arch/arm/src/common/up_stackframe.c2
-rw-r--r--nuttx/arch/avr/src/avr/up_stackframe.c2
-rw-r--r--nuttx/arch/avr/src/avr32/up_stackframe.c2
-rw-r--r--nuttx/arch/hc/src/common/up_stackframe.c2
-rw-r--r--nuttx/arch/mips/src/common/up_stackframe.c2
-rw-r--r--nuttx/arch/sh/src/common/up_stackframe.c2
-rw-r--r--nuttx/arch/sim/src/up_stackframe.c2
-rw-r--r--nuttx/arch/x86/src/i486/up_stackframe.c2
-rw-r--r--nuttx/arch/z16/src/common/up_stackframe.c2
-rw-r--r--nuttx/arch/z80/src/common/up_stackframe.c2
-rw-r--r--nuttx/include/nuttx/arch.h2
-rw-r--r--nuttx/sched/sig_deliver.c15
14 files changed, 32 insertions, 14 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 3c427ff29..5d454cda3 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -4410,4 +4410,9 @@
all system call inline functions with > 3 parameters (2013-03-20)
* arch/*/src/common/up_stackframe.c and include/nuttx/arch.h: Add
and new interface to set aside memory on the stack. This will be
- used at least in the kernel build to hold task arguments 2013-03-21).
+ used at least in the kernel build to hold task arguments (2013-03-21).
+ * sched/sig_deliver.c: When dispatching signals to user threads,
+ copy the siginfo_t from the sigq to the stack. The signal queue
+ is allocated from kernel memory; however, the current stack is
+ the user's stack and the user code will be able to access the
+ signinfo_t data from the stack copy (2013-03-21).
diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html
index 2fa0b2a71..a7082a0ec 100644
--- a/nuttx/Documentation/NuttxPortingGuide.html
+++ b/nuttx/Documentation/NuttxPortingGuide.html
@@ -1713,7 +1713,7 @@ The system can be re-made subsequently by just typing <code>make</code>.
This function may be called anytime after <code>up_create_stack()</code> or <code>up_use_stack()</code> have been called but before the task has been started.
</p>
<p>
- Thread data may be kept in the stack (instead of in the TCB) if it is accessed by the user code directory.
+ Thread data may be kept in the stack (instead of in the TCB) if it is accessed by the user code directly.
This includes such things as <code>argv[]</code>.
The stack memory is guaranteed to be in the same protection domain as the thread.
</p>
diff --git a/nuttx/arch/arm/src/common/up_stackframe.c b/nuttx/arch/arm/src/common/up_stackframe.c
index 3720d334a..f509556af 100644
--- a/nuttx/arch/arm/src/common/up_stackframe.c
+++ b/nuttx/arch/arm/src/common/up_stackframe.c
@@ -96,7 +96,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/avr/src/avr/up_stackframe.c b/nuttx/arch/avr/src/avr/up_stackframe.c
index 39253e2b5..f9748f2e7 100644
--- a/nuttx/arch/avr/src/avr/up_stackframe.c
+++ b/nuttx/arch/avr/src/avr/up_stackframe.c
@@ -73,7 +73,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/avr/src/avr32/up_stackframe.c b/nuttx/arch/avr/src/avr32/up_stackframe.c
index 08c4cf51e..d7c0a0fc3 100644
--- a/nuttx/arch/avr/src/avr32/up_stackframe.c
+++ b/nuttx/arch/avr/src/avr32/up_stackframe.c
@@ -85,7 +85,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/hc/src/common/up_stackframe.c b/nuttx/arch/hc/src/common/up_stackframe.c
index 0daa4f7da..266881ec5 100644
--- a/nuttx/arch/hc/src/common/up_stackframe.c
+++ b/nuttx/arch/hc/src/common/up_stackframe.c
@@ -85,7 +85,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/mips/src/common/up_stackframe.c b/nuttx/arch/mips/src/common/up_stackframe.c
index 9b473ecc6..fd055d5e6 100644
--- a/nuttx/arch/mips/src/common/up_stackframe.c
+++ b/nuttx/arch/mips/src/common/up_stackframe.c
@@ -88,7 +88,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/sh/src/common/up_stackframe.c b/nuttx/arch/sh/src/common/up_stackframe.c
index b1ef4c6b4..f3e7f294a 100644
--- a/nuttx/arch/sh/src/common/up_stackframe.c
+++ b/nuttx/arch/sh/src/common/up_stackframe.c
@@ -84,7 +84,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/sim/src/up_stackframe.c b/nuttx/arch/sim/src/up_stackframe.c
index 4d62e6ec0..f634005cb 100644
--- a/nuttx/arch/sim/src/up_stackframe.c
+++ b/nuttx/arch/sim/src/up_stackframe.c
@@ -85,7 +85,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/x86/src/i486/up_stackframe.c b/nuttx/arch/x86/src/i486/up_stackframe.c
index ea4edc07a..f2ab91f95 100644
--- a/nuttx/arch/x86/src/i486/up_stackframe.c
+++ b/nuttx/arch/x86/src/i486/up_stackframe.c
@@ -86,7 +86,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/z16/src/common/up_stackframe.c b/nuttx/arch/z16/src/common/up_stackframe.c
index c11106542..11eec6c2e 100644
--- a/nuttx/arch/z16/src/common/up_stackframe.c
+++ b/nuttx/arch/z16/src/common/up_stackframe.c
@@ -84,7 +84,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/arch/z80/src/common/up_stackframe.c b/nuttx/arch/z80/src/common/up_stackframe.c
index 01a7b0881..228311633 100644
--- a/nuttx/arch/z80/src/common/up_stackframe.c
+++ b/nuttx/arch/z80/src/common/up_stackframe.c
@@ -84,7 +84,7 @@
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h
index 6595b3911..b8e62e6c2 100644
--- a/nuttx/include/nuttx/arch.h
+++ b/nuttx/include/nuttx/arch.h
@@ -228,7 +228,7 @@ int up_use_stack(FAR struct tcb_s *tcb, FAR void *stack, size_t stack_size);
* up_use_stack() have been called but before the task has been started.
*
* Thread data may be kept in the stack (instead of in the TCB) if it is
- * accessed by the user code directory. This includes such things as
+ * accessed by the user code directly. This includes such things as
* argv[]. The stack memory is guaranteed to be in the same protection
* domain as the thread.
*
diff --git a/nuttx/sched/sig_deliver.c b/nuttx/sched/sig_deliver.c
index bb6ca71a4..9b1e8cebe 100644
--- a/nuttx/sched/sig_deliver.c
+++ b/nuttx/sched/sig_deliver.c
@@ -136,12 +136,25 @@ void sig_deliver(FAR struct tcb_s *stcb)
#ifdef CONFIG_NUTTX_KERNEL
if ((stcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
{
+ /* The sigq_t pointed to by sigq resides in kernel space. So we
+ * cannot pass a reference to sigq->info to the user space.
+ * Instead, we will copy the siginfo_t structure onto that stack.
+ * We are currently executing on the stack of the user thread
+ * (albeit temporarily in kernel mode), so the copy of the
+ * siginfo_t structure will be accessible by the user thread.
+ */
+
+ siginfo_t info;
+ memcpy(&info, sigq->info, sizeof(siginfo_t));
+
up_signal_handler(sigq->action.sighandler, sigq->info.si_signo,
- &sigq->info, NULL);
+ &info, NULL);
}
else
#endif
{
+ /* The kernel thread signal handler is much simpler. */
+
(*sigq->action.sighandler)(sigq->info.si_signo, &sigq->info,
NULL);
}