Changeset 6baf5a5 in rtems


Ignore:
Timestamp:
Oct 4, 2010, 3:53:45 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master
Children:
f564c32b
Parents:
9eb5c8ee
Message:

2010-10-04 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, configure.ac, psx07/init.c, psx07/psx07.scn, psxhdrs/Makefile.am, psxstack01/init.c: Add pthread_attr_getstack, pthread_attr_setstack, pthread_attr_getguardsize, and pthread_attr_setguardsize.
  • psxstack02/.cvsignore, psxstack02/Makefile.am, psxstack02/init.c, psxstack02/psxstack02.doc, psxstack02/psxstack02.scn: New files.
Location:
testsuites/psxtests
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    r9eb5c8ee r6baf5a5  
     12010-10-04      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile.am, configure.ac, psx07/init.c, psx07/psx07.scn,
     4        psxhdrs/Makefile.am, psxstack01/init.c: Add pthread_attr_getstack,
     5        pthread_attr_setstack, pthread_attr_getguardsize, and
     6        pthread_attr_setguardsize.
     7        * psxstack02/.cvsignore, psxstack02/Makefile.am, psxstack02/init.c,
     8        psxstack02/psxstack02.doc, psxstack02/psxstack02.scn: New files.
     9
    1102010-10-01      Ralf Corsépius <ralf.corsepius@rtems.org>
    211
  • testsuites/psxtests/Makefile.am

    r9eb5c8ee r6baf5a5  
    1616    psxsignal03 psxsignal04 psxsignal05 psxspin01 psxspin02 psxsysconf \
    1717    psxtime psxtimer01 psxtimer02 psxualarm psxusleep psxfatal01 psxfatal02 \
    18     psxintrcritical01 psxstack01
     18    psxintrcritical01 psxstack01 psxstack02
    1919endif
    2020
  • testsuites/psxtests/configure.ac

    r9eb5c8ee r6baf5a5  
    4242AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include <pthread.h>]])
    4343
     44# FIXME: RTEMS presumes pthread_attr_getcputime to be IEEE Std 1003.1
     45# Likely an anachronism in RTEMS.
     46AC_CHECK_DECLS([pthread_attr_getcputime],[],[],[[#include <pthread.h>]])
     47
    4448# FIXME: RTEMS presumes pthread_attr_setcputime to be IEEE Std 1003.1
    4549# Likely an anachronism in RTEMS.
    4650AC_CHECK_DECLS([pthread_attr_setcputime],[],[],[[#include <pthread.h>]])
     51
     52# Added to pthreads after initial revision.  May not be in toolset
     53AC_CHECK_DECLS([pthread_attr_getstack],[],[],[[#include <pthread.h>]])
     54
     55# Added to pthreads after initial revision.  May not be in toolset
     56AC_CHECK_DECLS([pthread_attr_setstack],[],[],[[#include <pthread.h>]])
     57
     58# Added to pthreads after initial revision.  May not be in toolset
     59AC_CHECK_DECLS([pthread_attr_getguardsize],[],[],[[#include <pthread.h>]])
     60
     61# Added to pthreads after initial revision.  May not be in toolset
     62AC_CHECK_DECLS([pthread_attr_setguardsize],[],[],[[#include <pthread.h>]])
    4763
    4864# FIXME: adjtime is a non-standardized BSD/Linux extension
     
    130146psxspin02/Makefile
    131147psxstack01/Makefile
     148psxstack02/Makefile
    132149psxstat/Makefile
    133150psxsysconf/Makefile
  • testsuites/psxtests/psx07/init.c

    r9eb5c8ee r6baf5a5  
    6464  int                 schedpolicy;
    6565  size_t              stacksize;
     66  size_t              guardsize;
    6667  void               *stackaddr;
    6768  int                 detachstate;
     
    128129  posix_service_failed( status, "pthread_attr_init");
    129130
     131#if HAVE_DECL_PTHREAD_ATTR_SETSTACKADDR
    130132  attr.stacksize = rtems_configuration_get_work_space_size() * 10;
    131133  puts( "Init - pthread_create - EAGAIN (stacksize too large)" );
    132134  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    133135  fatal_directive_check_status_only( status, EAGAIN, "stacksize too large" );
     136#endif
    134137
    135138  status = pthread_attr_init( &attr );
     
    374377
    375378  /* exercise get and set stack address */
    376 
    377379  empty_line();
    378380
     
    382384
    383385  puts( "Init - pthread_attr_setstackaddr - EINVAL (not initialized attr)" );
    384   status =
    385      pthread_attr_setstackaddr( &destroyed_attr, NULL );
     386  status = pthread_attr_setstackaddr( &destroyed_attr, NULL );
    386387  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
    387388
     
    390391  posix_service_failed( status, "");
    391392
     393  /* get stack addr */
    392394  puts( "Init - pthread_attr_getstackaddr - EINVAL (NULL attr)" );
    393395  status = pthread_attr_getstackaddr( NULL, &stackaddr );
     
    407409  printf( "Init - current stack address attribute = %p\n", stackaddr );
    408410
     411  /* exercise get and set stack (as pair) */
     412  empty_line();
     413
     414#if HAVE_DECL_PTHREAD_ATTR_SETSTACK
     415  puts( "Init - pthread_attr_setstack- EINVAL (NULL attr)" );
     416  status = pthread_attr_setstack( NULL, &stackaddr, 1024 );
     417  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
     418
     419  puts( "Init - pthread_attr_setstack- EINVAL (destroyed attr)" );
     420  status = pthread_attr_setstack( &destroyed_attr, &stackaddr, 1024 );
     421  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
     422
     423  puts( "Init - pthread_attr_setstack- SUCCESSFUL (< min stack)" );
     424  status = pthread_attr_setstack( &attr, stackaddr, 0 );
     425  posix_service_failed( status, "OK");
     426
     427  puts( "Init - pthread_attr_setstack- SUCCESSFUL (big stack)" );
     428  status = pthread_attr_setstack( &attr, stackaddr, STACK_MINIMUM_SIZE * 2 );
     429  posix_service_failed( status, "OK");
     430#endif
     431
     432#if HAVE_DECL_PTHREAD_ATTR_GETSTACK
     433  puts( "Init - pthread_attr_getstack- EINVAL (NULL attr)" );
     434  status = pthread_attr_getstack( NULL, &stackaddr, &stacksize );
     435  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
     436
     437  puts( "Init - pthread_attr_getstack- EINVAL (destroyed attr)" );
     438  status = pthread_attr_getstack( &destroyed_attr, &stackaddr, &stacksize );
     439  fatal_directive_check_status_only( status, EINVAL, "&destroyed attr" );
     440
     441  puts( "Init - pthread_attr_getstack- EINVAL (NULL stack)" );
     442  status = pthread_attr_getstack( &attr, NULL, &stacksize );
     443  fatal_directive_check_status_only( status, EINVAL, "&NULL stack" );
     444
     445  puts( "Init - pthread_attr_getstack- EINVAL (NULL stacksize)" );
     446  status = pthread_attr_getstack( &attr, &stackaddr, NULL );
     447  fatal_directive_check_status_only( status, EINVAL, "&NULL size" );
     448
     449  puts( "Init - pthread_attr_getstack- SUCCESSFUL" );
     450  status = pthread_attr_getstack( &attr, &stackaddr, &stacksize );
     451  posix_service_failed( status, "pthread_attr_getstack");
     452#endif
     453
    409454  /* exercise get and set detach state */
    410 
     455  empty_line();
     456
     457#if HAVE_DECL_PTHREAD_ATTR_SETGUARDSIZE
     458  puts( "Init - pthread_attr_setguardsize - EINVAL (NULL attr)" );
     459  status = pthread_attr_setguardsize( NULL, 0 );
     460  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
     461
     462  puts( "Init - pthread_attr_setguardsize - EINVAL (not initialized attr)" );
     463  status = pthread_attr_setguardsize( &destroyed_attr, 0 );
     464  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
     465
     466  puts( "Init - pthread_attr_setguardsize - SUCCESSFUL (low guardsize)" );
     467  status = pthread_attr_setguardsize( &attr, 0 );
     468  posix_service_failed( status, "pthread_attr_setguardsize");
     469
     470  puts( "Init - pthread_attr_setguardsize - SUCCESSFUL (high guardsize)" );
     471  status = pthread_attr_setguardsize( &attr, STACK_MINIMUM_SIZE * 2 );
     472  posix_service_failed( status, "");
     473#endif
     474
     475#if HAVE_DECL_PTHREAD_ATTR_GETGUARDSIZE
     476  puts( "Init - pthread_attr_getguardsize - EINVAL (NULL attr)" );
     477  status = pthread_attr_getguardsize( NULL, &guardsize );
     478  fatal_directive_check_status_only( status, EINVAL, "NULL attr" );
     479
     480  puts( "Init - pthread_attr_getguardsize - EINVAL (NULL guardsize)" );
     481  status = pthread_attr_getguardsize( &attr, NULL );
     482  fatal_directive_check_status_only( status, EINVAL, "NULL guardsize" );
     483
     484  puts( "Init - pthread_attr_getguardsize - EINVAL (not initialized attr)" );
     485  status = pthread_attr_getguardsize( &destroyed_attr, &guardsize );
     486  fatal_directive_check_status_only( status, EINVAL, "not initialized attr" );
     487
     488  puts( "Init - pthread_attr_getguardsize - SUCCESSFUL" );
     489  status = pthread_attr_getguardsize( &attr, &guardsize );
     490  posix_service_failed( status, "pthread_attr_getguardsize");
     491#endif
     492
     493  /* exercise get and set detach state */
    411494  empty_line();
    412495
  • testsuites/psxtests/psx07/psx07.scn

    r9eb5c8ee r6baf5a5  
    7272Init - current stack address attribute = 0x0
    7373
     74Init - pthread_attr_setstack- EINVAL (NULL attr)
     75Init - pthread_attr_setstack- EINVAL (destroyed attr)
     76Init - pthread_attr_setstack- SUCCESSFUL (< min stack)
     77Init - pthread_attr_setstack- SUCCESSFUL (big stack)
     78Init - pthread_attr_getstack- EINVAL (NULL attr)
     79Init - pthread_attr_getstack- EINVAL (destroyed attr)
     80Init - pthread_attr_getstack- EINVAL (NULL stack)
     81Init - pthread_attr_getstack- EINVAL (NULL stacksize)
     82Init - pthread_attr_getstack- SUCCESSFUL
     83
     84Init - pthread_attr_setguardsize - EINVAL (NULL attr)
     85Init - pthread_attr_setguardsize - EINVAL (not initialized attr)
     86Init - pthread_attr_setguardsize - SUCCESSFUL (low guardsize)
     87Init - pthread_attr_setguardsize - SUCCESSFUL (high guardsize)
     88Init - pthread_attr_getguardsize - EINVAL (NULL attr)
     89Init - pthread_attr_getguardsize - EINVAL (NULL guardsize)
     90Init - pthread_attr_getguardsize - EINVAL (not initialized attr)
     91Init - pthread_attr_getguardsize - SUCCESSFUL
     92
    7493Init - pthread_attr_setdetachstate - EINVAL (NULL attr)
    7594Init - pthread_attr_setdetachstate - EINVAL (not initialized attr)
     
    84103Init - pthread_attr_getschedparam - SUCCESSFUL
    85104Init - sched priority      = 2
    86 Init - ss_low_priority     = 0
    87 Init - ss_replenish_period = (0, 0)
    88 Init - ss_initial_budget = (0, 0)
     105Init - sched_ss_low_priority     = 0
     106Init - sched_ss_replenish_period = (0, 0)
     107Init - sched_sched_ss_initial_budget = (0, 0)
    89108Init - pthread_attr_setschedparam - EINVAL (NULL attr)
    90109Init - pthread_attr_setschedparam - EINVAL (not initialized attr)
     
    101120Init - policy = 1
    102121Init - sched priority      = 2
    103 Init - ss_low_priority     = 0
    104 Init - ss_replenish_period = (0, 0)
    105 Init - ss_initial_budget = (0, 0)
     122Init - sched_ss_low_priority     = 0
     123Init - sched_ss_replenish_period = (0, 0)
     124Init - sched_sched_ss_initial_budget = (0, 0)
    106125
    107126Init - pthread_setschedparam - EINVAL (NULL schedparam)
  • testsuites/psxtests/psxhdrs/Makefile.am

    r9eb5c8ee r6baf5a5  
    1515    pthread25.c pthread26.c pthread27.c pthread28.c pthread29.c pthread30.c \
    1616    pthread31.c pthread32.c pthread33.c pthread34.c pthread35.c pthread36.c \
     17    pthread37.c pthread38.c pthread39.c pthread40.c \
    1718    proc01.c proc02.c proc03.c proc04.c proc05.c proc06.c proc07.c proc08.c \
    1819    proc09.c proc10.c proc11.c proc12.c proc13.c proc14.c sched01.c \
  • testsuites/psxtests/psxstack01/init.c

    r9eb5c8ee r6baf5a5  
    5656  puts( "Init - Allocate stack from heap" );
    5757  Stack_Low = malloc(PTHREAD_MINIMUM_STACK_SIZE);
    58   rtems_test_assert(  Stack_Low );
     58  rtems_test_assert( Stack_Low );
    5959  Stack_High = Stack_Low + PTHREAD_MINIMUM_STACK_SIZE;
    6060
Note: See TracChangeset for help on using the changeset viewer.