Changeset fd27bae in rtems


Ignore:
Timestamp:
Aug 7, 2018, 4:25:47 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
f51aec8
Parents:
97417bb
git-author:
Sebastian Huber <sebastian.huber@…> (08/07/18 04:25:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/08/18 06:15:13)
Message:

CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE

Make CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE configurable by the user.

Update #3434.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/confdefs.h

    r97417bb rfd27bae  
    11661166 * twice that recommended for the port.
    11671167 */
     1168#ifndef CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
    11681169#define CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE \
    11691170  (2 * CONFIGURE_MINIMUM_TASK_STACK_SIZE)
     1171#endif
    11701172
    11711173/**
     
    30513053      CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
    30523054    };
     3055
     3056    const size_t _Configuration_POSIX_Minimum_stack_size =
     3057      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
    30533058  #endif
    30543059
  • cpukit/include/rtems/posix/pthread.h

    r97417bb rfd27bae  
    3838/**@{**/
    3939
     40extern const size_t _Configuration_POSIX_Minimum_stack_size;
     41
    4042/**
    4143 * @brief POSIX threads initialize user threads body.
  • cpukit/include/rtems/posix/pthreadimpl.h

    r97417bb rfd27bae  
    4141 * The following sets the minimum stack size for POSIX threads.
    4242 */
    43 #define PTHREAD_MINIMUM_STACK_SIZE (_Stack_Minimum() * 2)
     43#define PTHREAD_MINIMUM_STACK_SIZE _Configuration_POSIX_Minimum_stack_size
    4444
    4545/**
  • testsuites/psxtests/psxconfig01/init.c

    r97417bb rfd27bae  
    2626#endif
    2727
     28#define _GNU_SOURCE
     29
    2830#include <rtems/test.h>
    2931#include <tmacros.h>
     
    6567#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 41
    6668#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
     69
     70#define CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE CPU_STACK_MINIMUM_SIZE
    6771
    6872#define CONFIGURE_MAXIMUM_POSIX_THREADS 3
     
    463467  for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_THREADS; ++i) {
    464468    pthread_t thread;
     469    pthread_attr_t attr;
     470    size_t stack_size;
     471
    465472    eno = pthread_create(&thread, NULL, posix_thread, NULL);
     473    rtems_test_assert(eno == 0);
     474
     475    eno = pthread_getattr_np(thread, &attr);
     476    rtems_test_assert(eno == 0);
     477
     478    eno = pthread_attr_getstacksize(&attr, &stack_size);
     479    rtems_test_assert(eno == 0);
     480    rtems_test_assert(stack_size == CPU_STACK_MINIMUM_SIZE);
     481
     482    eno = pthread_attr_destroy(&attr);
    466483    rtems_test_assert(eno == 0);
    467484  }
Note: See TracChangeset for help on using the changeset viewer.