summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-06 14:26:00 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-10 09:50:07 +0200
commit1bf2f160e258b729c1fb5ac7abd486e4757a9149 (patch)
tree04564615088ead088a378e6a3c7dcdaa6f8c021f
parentposix: _Configuration_POSIX_Minimum_stack_size (diff)
downloadrtems-1bf2f160e258b729c1fb5ac7abd486e4757a9149.tar.bz2
posix: Avoid workspace for queued signals
-rw-r--r--cpukit/include/rtems/confdefs.h4
-rw-r--r--cpukit/include/rtems/posix/psignal.h2
-rw-r--r--cpukit/posix/src/psignal.c26
-rw-r--r--cpukit/posix/src/psignalconfig.c4
4 files changed, 18 insertions, 18 deletions
diff --git a/cpukit/include/rtems/confdefs.h b/cpukit/include/rtems/confdefs.h
index dfc917ccfe..066919a7dc 100644
--- a/cpukit/include/rtems/confdefs.h
+++ b/cpukit/include/rtems/confdefs.h
@@ -2862,6 +2862,10 @@ struct _reent *__getreent(void)
#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
const uint32_t _POSIX_signals_Maximum_queued_signals =
CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS;
+
+ POSIX_signals_Siginfo_node _POSIX_signals_Siginfo_nodes[
+ CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
+ ];
#endif
#if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
diff --git a/cpukit/include/rtems/posix/psignal.h b/cpukit/include/rtems/posix/psignal.h
index 4632128598..4a078c57aa 100644
--- a/cpukit/include/rtems/posix/psignal.h
+++ b/cpukit/include/rtems/posix/psignal.h
@@ -33,5 +33,7 @@ typedef struct {
extern const uint32_t _POSIX_signals_Maximum_queued_signals;
+extern POSIX_signals_Siginfo_node _POSIX_signals_Siginfo_nodes[];
+
#endif
/* end of file */
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c
index 3a1bd41cad..efc4bcc653 100644
--- a/cpukit/posix/src/psignal.c
+++ b/cpukit/posix/src/psignal.c
@@ -100,10 +100,7 @@ Chain_Control _POSIX_signals_Siginfo[ SIG_ARRAY_MAX ];
static void _POSIX_signals_Manager_Initialization(void)
{
- uint32_t signo;
- uint32_t maximum_queued_signals;
-
- maximum_queued_signals = _POSIX_signals_Maximum_queued_signals;
+ uint32_t signo;
memcpy(
_POSIX_signals_Vectors,
@@ -121,21 +118,16 @@ static void _POSIX_signals_Manager_Initialization(void)
/*
* Allocate the siginfo pools.
*/
- for ( signo=1 ; signo<= SIGRTMAX ; signo++ )
+ for ( signo=1 ; signo<= SIGRTMAX ; signo++ ) {
_Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] );
-
- if ( maximum_queued_signals ) {
- _Chain_Initialize(
- &_POSIX_signals_Inactive_siginfo,
- _Workspace_Allocate_or_fatal_error(
- maximum_queued_signals * sizeof( POSIX_signals_Siginfo_node )
- ),
- maximum_queued_signals,
- sizeof( POSIX_signals_Siginfo_node )
- );
- } else {
- _Chain_Initialize_empty( &_POSIX_signals_Inactive_siginfo );
}
+
+ _Chain_Initialize(
+ &_POSIX_signals_Inactive_siginfo,
+ &_POSIX_signals_Siginfo_nodes[ 0 ],
+ _POSIX_signals_Maximum_queued_signals,
+ sizeof( _POSIX_signals_Siginfo_nodes[ 0 ] )
+ );
}
RTEMS_SYSINIT_ITEM(
diff --git a/cpukit/posix/src/psignalconfig.c b/cpukit/posix/src/psignalconfig.c
index 188ba739e6..41d68eaee1 100644
--- a/cpukit/posix/src/psignalconfig.c
+++ b/cpukit/posix/src/psignalconfig.c
@@ -1,7 +1,7 @@
/*
* SPDX-License-Identifier: BSD-2-Clause
*
- * Copyright 2018, embedded brains GmbH <rtems@embedded-brains.de>
+ * Copyright 2018, 2019 embedded brains GmbH <rtems@embedded-brains.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,3 +32,5 @@
#include <rtems/posix/psignal.h>
const uint32_t _POSIX_signals_Maximum_queued_signals;
+
+POSIX_signals_Siginfo_node _POSIX_signals_Siginfo_nodes[ 0 ];