summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-14 19:09:56 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-02-25 07:18:26 +0100
commitba74ebde7461b28bf0261523d4e91e7c0e17b622 (patch)
tree0929ec50a724db8418a8d1f1b6a5d8d4c847f1dd /testsuites
parentba46b9368eaf57e8c2361c215ceb0d6335ce80fe (diff)
downloadrtems-ba74ebde7461b28bf0261523d4e91e7c0e17b622.tar.bz2
libio: Add POSIX user environment pointer to TCB
The IO library used a POSIX key to store an optional POSIX user environment pointer. This pulled in the POSIX keys support in every application configuration. Add a user environment pointer to the thread control block (TCB) instead. Applications which do not need the POSIX user environment will just get an overhead of one pointer per thread. Close #3882.
Diffstat (limited to '')
-rw-r--r--testsuites/fstests/fsdosfsname01/init.c1
-rw-r--r--testsuites/fstests/imfs_support/fs_support.c1
-rw-r--r--testsuites/fstests/jffs2_support/fs_support.c2
-rw-r--r--testsuites/fstests/mdosfs_support/fs_support.c1
-rw-r--r--testsuites/fstests/mimfs_support/fs_support.c1
-rw-r--r--testsuites/fstests/mrfs_support/fs_support.c1
-rw-r--r--testsuites/libtests/ftp01/init.c2
-rw-r--r--testsuites/psxtests/psxchroot01/main.c2
-rw-r--r--testsuites/psxtests/psxconfig01/init.c2
-rw-r--r--testsuites/psxtests/psxmount/main.c2
-rw-r--r--testsuites/sptests/Makefile.am9
-rw-r--r--testsuites/sptests/configure.ac1
-rw-r--r--testsuites/sptests/spfatal27/init.c34
-rw-r--r--testsuites/sptests/spfatal27/spfatal27.doc23
-rw-r--r--testsuites/sptests/spfatal27/spfatal27.scn3
-rw-r--r--testsuites/sptests/spprivenv01/init.c3
-rw-r--r--testsuites/sptests/spsysinit01/init.c41
17 files changed, 41 insertions, 88 deletions
diff --git a/testsuites/fstests/fsdosfsname01/init.c b/testsuites/fstests/fsdosfsname01/init.c
index c76c8b48e1..1cae87f432 100644
--- a/testsuites/fstests/fsdosfsname01/init.c
+++ b/testsuites/fstests/fsdosfsname01/init.c
@@ -1437,7 +1437,6 @@ size_t rtems_ramdisk_configuration_size = RTEMS_ARRAY_SIZE(rtems_ramdisk_configu
#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
#define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
#define CONFIGURE_MAXIMUM_SEMAPHORES (2 * RTEMS_DOSFS_SEMAPHORES_PER_INSTANCE)
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 2
#define CONFIGURE_APPLICATION_EXTRA_DRIVERS RAMDISK_DRIVER_TABLE_ENTRY
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
diff --git a/testsuites/fstests/imfs_support/fs_support.c b/testsuites/fstests/imfs_support/fs_support.c
index 5e3f7db84b..db64fbf830 100644
--- a/testsuites/fstests/imfs_support/fs_support.c
+++ b/testsuites/fstests/imfs_support/fs_support.c
@@ -41,7 +41,6 @@ test_shutdown_filesystem (void)
#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 40
#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
diff --git a/testsuites/fstests/jffs2_support/fs_support.c b/testsuites/fstests/jffs2_support/fs_support.c
index b714183be7..31dbd50f19 100644
--- a/testsuites/fstests/jffs2_support/fs_support.c
+++ b/testsuites/fstests/jffs2_support/fs_support.c
@@ -157,8 +157,6 @@ void test_shutdown_filesystem(void)
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
-
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT
diff --git a/testsuites/fstests/mdosfs_support/fs_support.c b/testsuites/fstests/mdosfs_support/fs_support.c
index 4d740bb0ad..a0b233b8d7 100644
--- a/testsuites/fstests/mdosfs_support/fs_support.c
+++ b/testsuites/fstests/mdosfs_support/fs_support.c
@@ -90,7 +90,6 @@ void test_shutdown_filesystem(void)
#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 40
#define CONFIGURE_INIT_TASK_STACK_SIZE (16 * 1024)
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
diff --git a/testsuites/fstests/mimfs_support/fs_support.c b/testsuites/fstests/mimfs_support/fs_support.c
index 66192faff0..8ac430c06a 100644
--- a/testsuites/fstests/mimfs_support/fs_support.c
+++ b/testsuites/fstests/mimfs_support/fs_support.c
@@ -63,7 +63,6 @@ test_shutdown_filesystem (void)
#define CONFIGURE_MAXIMUM_TASKS 10
#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 40
#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
#define CONFIGURE_FILESYSTEM_IMFS
diff --git a/testsuites/fstests/mrfs_support/fs_support.c b/testsuites/fstests/mrfs_support/fs_support.c
index f2fea75f8e..6e8ef9fa29 100644
--- a/testsuites/fstests/mrfs_support/fs_support.c
+++ b/testsuites/fstests/mrfs_support/fs_support.c
@@ -69,7 +69,6 @@ test_shutdown_filesystem (void)
#define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 40
#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024)
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
#define CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
diff --git a/testsuites/libtests/ftp01/init.c b/testsuites/libtests/ftp01/init.c
index 620a0682cd..aa9193873c 100644
--- a/testsuites/libtests/ftp01/init.c
+++ b/testsuites/libtests/ftp01/init.c
@@ -262,8 +262,6 @@ static rtems_task Init(rtems_task_argument argument)
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 2
-
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT
diff --git a/testsuites/psxtests/psxchroot01/main.c b/testsuites/psxtests/psxchroot01/main.c
index 4059dc9203..2c1c48942f 100644
--- a/testsuites/psxtests/psxchroot01/main.c
+++ b/testsuites/psxtests/psxchroot01/main.c
@@ -32,8 +32,6 @@ rtems_task Init(
#define CONFIGURE_MAXIMUM_TASKS 1
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
-
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
diff --git a/testsuites/psxtests/psxconfig01/init.c b/testsuites/psxtests/psxconfig01/init.c
index c17c433ff1..2d0a0df497 100644
--- a/testsuites/psxtests/psxconfig01/init.c
+++ b/testsuites/psxtests/psxconfig01/init.c
@@ -301,7 +301,7 @@ static rtems_task Init(rtems_task_argument argument)
rtems_test_assert(eno == EAGAIN);
rtems_resource_snapshot_take(&snapshot);
rtems_test_assert(
- snapshot.active_posix_keys == _CONFIGURE_POSIX_KEYS
+ snapshot.active_posix_keys == CONFIGURE_MAXIMUM_POSIX_KEYS
);
rtems_test_assert(
snapshot.active_posix_key_value_pairs == CONFIGURE_MAXIMUM_POSIX_KEYS
diff --git a/testsuites/psxtests/psxmount/main.c b/testsuites/psxtests/psxmount/main.c
index 6473e7c81e..cbac28d948 100644
--- a/testsuites/psxtests/psxmount/main.c
+++ b/testsuites/psxtests/psxmount/main.c
@@ -36,8 +36,6 @@ rtems_task Init(
#define CONFIGURE_MAXIMUM_TASKS 1
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 1
-
#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am
index 1b47cad4a9..071ce13216 100644
--- a/testsuites/sptests/Makefile.am
+++ b/testsuites/sptests/Makefile.am
@@ -1030,15 +1030,6 @@ spfatal26_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal26) \
$(support_includes)
endif
-if TEST_spfatal27
-sp_tests += spfatal27
-sp_screens += spfatal27/spfatal27.scn
-sp_docs += spfatal27/spfatal27.doc
-spfatal27_SOURCES = spfatal27/init.c
-spfatal27_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_spfatal27) \
- $(support_includes)
-endif
-
if TEST_spfatal28
sp_tests += spfatal28
sp_screens += spfatal28/spfatal28.scn
diff --git a/testsuites/sptests/configure.ac b/testsuites/sptests/configure.ac
index e30f96d1c4..9476e3b0d7 100644
--- a/testsuites/sptests/configure.ac
+++ b/testsuites/sptests/configure.ac
@@ -152,7 +152,6 @@ RTEMS_TEST_CHECK([spfatal16])
RTEMS_TEST_CHECK([spfatal24])
RTEMS_TEST_CHECK([spfatal25])
RTEMS_TEST_CHECK([spfatal26])
-RTEMS_TEST_CHECK([spfatal27])
RTEMS_TEST_CHECK([spfatal28])
RTEMS_TEST_CHECK([spfatal29])
RTEMS_TEST_CHECK([spfatal30])
diff --git a/testsuites/sptests/spfatal27/init.c b/testsuites/sptests/spfatal27/init.c
deleted file mode 100644
index 7f2cf8668f..0000000000
--- a/testsuites/sptests/spfatal27/init.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "../spfatal_support/spfatal.h"
-
-/*
- * Copyright (c) 2014 embedded brains GmbH. All rights reserved.
- *
- * embedded brains GmbH
- * Dornierstrasse 4
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
- */
-
-#define FATAL_ERROR_TEST_NAME "27"
-#define FATAL_ERROR_DESCRIPTION "libio init no posix key left"
-#define FATAL_ERROR_EXPECTED_SOURCE INTERNAL_ERROR_CORE
-#define FATAL_ERROR_EXPECTED_ERROR INTERNAL_ERROR_LIBIO_USER_ENV_KEY_CREATE_FAILED
-
-#define CONFIGURE_MAXIMUM_POSIX_KEYS (-1)
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS (0)
-
-static void force_error(void)
-{
- /* we should not reach this */
-}
-
-#include "../spfatal_support/spfatalimpl.h"
diff --git a/testsuites/sptests/spfatal27/spfatal27.doc b/testsuites/sptests/spfatal27/spfatal27.doc
deleted file mode 100644
index f8da1bfbc9..0000000000
--- a/testsuites/sptests/spfatal27/spfatal27.doc
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright (c) 2014 embedded brains GmbH. All rights reserved.
-#
-# embedded brains GmbH
-# Dornierstrasse 4
-# 82178 Puchheim
-# Germany
-# <rtems@embedded-brains.de>
-#
-# The license and distribution terms for this file may be
-# found in the file LICENSE in this distribution or at
-# http://www.rtems.org/license/LICENSE.
-
-This file describes the directives and concepts tested by this test set.
-
-test set name: spfatal27
-
-directives:
-
- rtems_libio_init
-
-concepts:
-
-+ Force the fatal error when no POSIX key is left.
diff --git a/testsuites/sptests/spfatal27/spfatal27.scn b/testsuites/sptests/spfatal27/spfatal27.scn
deleted file mode 100644
index 41f6ae58bc..0000000000
--- a/testsuites/sptests/spfatal27/spfatal27.scn
+++ /dev/null
@@ -1,3 +0,0 @@
-*** BEGIN OF TEST FATAL 27 ***
-Fatal error (libio init no posix key left) hit
-*** END OF TEST FATAL 27 ***
diff --git a/testsuites/sptests/spprivenv01/init.c b/testsuites/sptests/spprivenv01/init.c
index 11d6c203c0..2ba21b0e68 100644
--- a/testsuites/sptests/spprivenv01/init.c
+++ b/testsuites/sptests/spprivenv01/init.c
@@ -123,9 +123,6 @@ rtems_task Init(
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
-#define CONFIGURE_MAXIMUM_POSIX_KEYS 1
-#define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 2
-
#define CONFIGURE_INIT
#include <rtems/confdefs.h>
diff --git a/testsuites/sptests/spsysinit01/init.c b/testsuites/sptests/spsysinit01/init.c
index 224eac468f..407ff26624 100644
--- a/testsuites/sptests/spsysinit01/init.c
+++ b/testsuites/sptests/spsysinit01/init.c
@@ -125,6 +125,8 @@ typedef enum {
IDLE_THREADS_POST,
LIBIO_PRE,
LIBIO_POST,
+ USER_ENVIRONMENT_PRE,
+ USER_ENVIRONMENT_POST,
ROOT_FILESYSTEM_PRE,
ROOT_FILESYSTEM_POST,
BSP_PRE_DRIVERS_PRE,
@@ -513,7 +515,7 @@ FIRST(RTEMS_SYSINIT_POSIX_KEYS)
LAST(RTEMS_SYSINIT_POSIX_KEYS)
{
- assert(info_is_init(&_POSIX_Keys_Information, 2));
+ assert(info_is_init(&_POSIX_Keys_Information, 1));
next_step(POSIX_KEYS_POST);
}
@@ -541,6 +543,24 @@ LAST(RTEMS_SYSINIT_LIBIO)
next_step(LIBIO_POST);
}
+static size_t user_extensions_pre_user_env;
+
+FIRST(RTEMS_SYSINIT_USER_ENVIRONMENT)
+{
+ user_extensions_pre_user_env =
+ _Chain_Node_count_unprotected(&_User_extensions_List.Active);
+ next_step(USER_ENVIRONMENT_PRE);
+}
+
+LAST(RTEMS_SYSINIT_USER_ENVIRONMENT)
+{
+ assert(
+ user_extensions_pre_user_env + 1 ==
+ _Chain_Node_count_unprotected(&_User_extensions_List.Active)
+ );
+ next_step(USER_ENVIRONMENT_POST);
+}
+
FIRST(RTEMS_SYSINIT_ROOT_FILESYSTEM)
{
struct stat st;
@@ -842,6 +862,18 @@ static void do_cleanup_push_pop(void)
pthread_cleanup_pop(0);
}
+static void do_posix_key_create(void)
+{
+ pthread_key_t key;
+ int eno;
+
+ eno = pthread_key_create(&key, NULL);
+ rtems_test_assert(eno == 0);
+
+ eno = pthread_key_delete(key);
+ rtems_test_assert(eno == 0);
+}
+
static void do_posix_mq_open(void)
{
struct mq_attr attr;
@@ -925,6 +957,11 @@ static void check_config(void)
rtems_test_assert(config->User_initialization_tasks_table != NULL);
}
+static void do_use_global_user_env(void)
+{
+ rtems_libio_use_global_env();
+}
+
static void Init(rtems_task_argument arg)
{
next_step(INIT_TASK);
@@ -939,10 +976,12 @@ static void Init(rtems_task_argument arg)
do_task_create();
do_timer_create();
do_cleanup_push_pop();
+ do_posix_key_create();
do_posix_mq_open();
do_posix_sem_open();
do_posix_shm_open();
do_posix_timer_create();
+ do_use_global_user_env();
check_config();
TEST_END();
exit(0);