Changeset 66c9ad8 in rtems


Ignore:
Timestamp:
Apr 3, 2010, 6:07:24 AM (10 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
c0c9898
Parents:
71a594af
Message:

Reflect POSIX changes to sched_param.

Location:
testsuites/psxtests
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psx07/init.c

    r71a594af r66c9ad8  
    4242  printf( "%ssched priority      = %d\n", prefix, schedparam->sched_priority );
    4343#if defined(_POSIX_SPORADIC_SERVER)
    44   printf( "%sss_low_priority     = %d\n", prefix, schedparam->ss_low_priority );
    45   printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
    46      schedparam->ss_replenish_period.tv_sec,
    47      schedparam->ss_replenish_period.tv_nsec );
    48   printf( "%sss_initial_budget = (%ld, %ld)\n", prefix,
    49      schedparam->ss_initial_budget.tv_sec,
    50      schedparam->ss_initial_budget.tv_nsec );
     44  printf( "%ssched_ss_low_priority     = %d\n",
     45     prefix, schedparam->sched_ss_low_priority );
     46  printf( "%ssched_ss_replenish_period = (%ld, %ld)\n", prefix,
     47     schedparam->sched_ss_repl_period.tv_sec,
     48     schedparam->sched_ss_repl_period.tv_nsec );
     49  printf( "%ssched_sched_ss_initial_budget = (%ld, %ld)\n", prefix,
     50     schedparam->sched_ss_init_budget.tv_sec,
     51     schedparam->sched_ss_init_budget.tv_nsec );
    5152#else
    5253  printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
     
    534535  /* now get sporadic server errors */
    535536
    536   schedparam.ss_replenish_period.tv_sec = 0;
    537   schedparam.ss_replenish_period.tv_nsec = 0;
    538   schedparam.ss_initial_budget.tv_sec = 1;
    539   schedparam.ss_initial_budget.tv_nsec = 1;
     537  schedparam.sched_ss_repl_period.tv_sec = 0;
     538  schedparam.sched_ss_repl_period.tv_nsec = 0;
     539  schedparam.sched_ss_init_budget.tv_sec = 1;
     540  schedparam.sched_ss_init_budget.tv_nsec = 1;
    540541
    541542  puts( "Init - pthread_setschedparam - EINVAL (replenish == 0)" );
     
    543544  fatal_directive_check_status_only( status, EINVAL, "replenish == 0" );
    544545
    545   schedparam.ss_replenish_period.tv_sec = 1;
    546   schedparam.ss_replenish_period.tv_nsec = 1;
    547   schedparam.ss_initial_budget.tv_sec = 0;
    548   schedparam.ss_initial_budget.tv_nsec = 0;
     546  schedparam.sched_ss_repl_period.tv_sec = 1;
     547  schedparam.sched_ss_repl_period.tv_nsec = 1;
     548  schedparam.sched_ss_init_budget.tv_sec = 0;
     549  schedparam.sched_ss_init_budget.tv_nsec = 0;
    549550
    550551  puts( "Init - pthread_setschedparam - EINVAL (budget == 0)" );
     
    552553  fatal_directive_check_status_only( status, EINVAL, "budget == 0" );
    553554
    554   schedparam.ss_replenish_period.tv_sec = 1;
    555   schedparam.ss_replenish_period.tv_nsec = 0;
    556   schedparam.ss_initial_budget.tv_sec = 1;
    557   schedparam.ss_initial_budget.tv_nsec = 1;
     555  schedparam.sched_ss_repl_period.tv_sec = 1;
     556  schedparam.sched_ss_repl_period.tv_nsec = 0;
     557  schedparam.sched_ss_init_budget.tv_sec = 1;
     558  schedparam.sched_ss_init_budget.tv_nsec = 1;
    558559
    559560  puts( "Init - pthread_setschedparam - EINVAL (replenish < budget)" );
     
    561562  fatal_directive_check_status_only( status, EINVAL, "replenish < budget" );
    562563
    563   schedparam.ss_replenish_period.tv_sec = 2;
    564   schedparam.ss_replenish_period.tv_nsec = 0;
    565   schedparam.ss_initial_budget.tv_sec = 1;
    566   schedparam.ss_initial_budget.tv_nsec = 0;
    567   schedparam.ss_low_priority = -1;
     564  schedparam.sched_ss_repl_period.tv_sec = 2;
     565  schedparam.sched_ss_repl_period.tv_nsec = 0;
     566  schedparam.sched_ss_init_budget.tv_sec = 1;
     567  schedparam.sched_ss_init_budget.tv_nsec = 0;
     568  schedparam.sched_ss_low_priority = -1;
    568569
    569570  puts( "Init - pthread_setschedparam - EINVAL (invalid priority)" );
     
    585586  rtems_test_assert(  !status );
    586587
    587   schedparam.ss_replenish_period.tv_sec = 3;
    588   schedparam.ss_replenish_period.tv_nsec = 3;
    589   schedparam.ss_initial_budget.tv_sec = 1;
    590   schedparam.ss_initial_budget.tv_nsec = 1;
     588  schedparam.sched_ss_repl_period.tv_sec = 3;
     589  schedparam.sched_ss_repl_period.tv_nsec = 3;
     590  schedparam.sched_ss_init_budget.tv_sec = 1;
     591  schedparam.sched_ss_init_budget.tv_nsec = 1;
    591592  schedparam.sched_priority = sched_get_priority_max( SCHED_FIFO );
    592   schedparam.ss_low_priority = sched_get_priority_max( SCHED_FIFO ) - 6;
     593  schedparam.sched_ss_low_priority = sched_get_priority_max( SCHED_FIFO ) - 6;
    593594
    594595  puts( "Init - pthread_attr_setschedpolicy - SUCCESSFUL" );
  • testsuites/psxtests/psx09/init.c

    r71a594af r66c9ad8  
    3232  printf( "%ssched priority      = %d\n", prefix, schedparam->sched_priority );
    3333#if defined(_POSIX_SPORADIC_SERVER)
    34   printf( "%sss_low_priority     = %d\n", prefix, schedparam->ss_low_priority );
    35   printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
    36      schedparam->ss_replenish_period.tv_sec,
    37      schedparam->ss_replenish_period.tv_nsec );
    38   printf( "%sss_initial_budget = (%ld, %ld)\n", prefix,
    39      schedparam->ss_initial_budget.tv_sec,
    40      schedparam->ss_initial_budget.tv_nsec );
     34  printf( "%ssched_ss_low_priority     = %d\n",
     35      prefix, schedparam->sched_ss_low_priority );
     36  printf( "%ssched_ss_repl_period = (%ld, %ld)\n", prefix,
     37     schedparam->sched_ss_repl_period.tv_sec,
     38     schedparam->sched_ss_repl_period.tv_nsec );
     39  printf( "%ssched_ss_init_budget = (%ld, %ld)\n", prefix,
     40     schedparam->sched_ss_init_budget.tv_sec,
     41     schedparam->sched_ss_init_budget.tv_nsec );
    4142#else
    4243  printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
     
    7980  print_current_time( "Init: ", buffer );
    8081
    81   schedparam.ss_replenish_period.tv_sec = 0;
    82   schedparam.ss_replenish_period.tv_nsec = 500000000;  /* 1/2 second */
    83   schedparam.ss_initial_budget.tv_sec = 0;
    84   schedparam.ss_initial_budget.tv_nsec = 250000000;    /* 1/4 second */
     82  schedparam.sched_ss_repl_period.tv_sec = 0;
     83  schedparam.sched_ss_repl_period.tv_nsec = 500000000;  /* 1/2 second */
     84  schedparam.sched_ss_init_budget.tv_sec = 0;
     85  schedparam.sched_ss_init_budget.tv_nsec = 250000000;    /* 1/4 second */
    8586
    8687  schedparam.sched_priority = sched_get_priority_max(SCHED_SPORADIC);
    87   schedparam.ss_low_priority = sched_get_priority_max(SCHED_SPORADIC) - 2;
     88  schedparam.sched_ss_low_priority = sched_get_priority_max(SCHED_SPORADIC) - 2;
    8889
    8990  puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" );
     
    119120  rtems_test_assert(  !status );
    120121
    121   schedparam.ss_replenish_period.tv_sec = 0;
    122   schedparam.ss_replenish_period.tv_nsec = 500000000;  /* 1/2 second */
    123   schedparam.ss_initial_budget.tv_sec = 0;
    124   schedparam.ss_initial_budget.tv_nsec = 250000000;    /* 1/4 second */
     122  schedparam.sched_ss_repl_period.tv_sec = 0;
     123  schedparam.sched_ss_repl_period.tv_nsec = 500000000;  /* 1/2 second */
     124  schedparam.sched_ss_init_budget.tv_sec = 0;
     125  schedparam.sched_ss_init_budget.tv_nsec = 250000000;    /* 1/4 second */
    125126
    126127  HIGH_PRIORITY = sched_get_priority_max( SCHED_SPORADIC );
     
    129130
    130131  schedparam.sched_priority = HIGH_PRIORITY;
    131   schedparam.ss_low_priority = LOW_PRIORITY;
     132  schedparam.sched_ss_low_priority = LOW_PRIORITY;
    132133
    133134  puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" );
  • testsuites/psxtests/psx12/init.c

    r71a594af r66c9ad8  
    2828  printf( "%ssched priority      = %d\n", prefix, schedparam->sched_priority );
    2929#if defined(_POSIX_SPORADIC_SERVER)
    30   printf( "%sss_low_priority     = %d\n", prefix, schedparam->ss_low_priority );
    31   printf( "%sss_replenish_period = (%ld, %ld)\n", prefix,
    32      schedparam->ss_replenish_period.tv_sec,
    33      schedparam->ss_replenish_period.tv_nsec );
    34   printf( "%sss_initial_budget = (%ld, %ld)\n", prefix,
    35      schedparam->ss_initial_budget.tv_sec,
    36      schedparam->ss_initial_budget.tv_nsec );
     30  printf( "%ssched_ss_low_priority     = %d\n",
     31     prefix, schedparam->sched_ss_low_priority );
     32  printf( "%ssched_ss_repl_period = (%ld, %ld)\n", prefix,
     33     schedparam->sched_ss_repl_period.tv_sec,
     34     schedparam->sched_ss_repl_period.tv_nsec );
     35  printf( "%ssched_ss_init_budget = (%ld, %ld)\n", prefix,
     36     schedparam->sched_ss_init_budget.tv_sec,
     37     schedparam->sched_ss_init_budget.tv_nsec );
    3738#else
    3839  printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" );
     
    8384  rtems_test_assert(  !status );
    8485
    85   schedparam.ss_replenish_period.tv_sec = 1;
    86   schedparam.ss_replenish_period.tv_nsec = 0;
    87   schedparam.ss_initial_budget.tv_sec = 2;
    88   schedparam.ss_initial_budget.tv_nsec = 0;
     86  schedparam.sched_ss_repl_period.tv_sec = 1;
     87  schedparam.sched_ss_repl_period.tv_nsec = 0;
     88  schedparam.sched_ss_init_budget.tv_sec = 2;
     89  schedparam.sched_ss_init_budget.tv_nsec = 0;
    8990
    9091  schedparam.sched_priority = 200;
    91   schedparam.ss_low_priority = 100;
     92  schedparam.sched_ss_low_priority = 100;
    9293
    9394  status = pthread_attr_setschedparam( &attr, &schedparam );
     
    101102  rtems_test_assert(  status == EINVAL );
    102103
    103   /* invalid ss_low_priority error */
     104  /* invalid sched_ss_low_priority error */
    104105
    105   schedparam.ss_replenish_period.tv_sec = 2;
    106   schedparam.ss_replenish_period.tv_nsec = 0;
    107   schedparam.ss_initial_budget.tv_sec = 1;
    108   schedparam.ss_initial_budget.tv_nsec = 0;
     106  schedparam.sched_ss_repl_period.tv_sec = 2;
     107  schedparam.sched_ss_repl_period.tv_nsec = 0;
     108  schedparam.sched_ss_init_budget.tv_sec = 1;
     109  schedparam.sched_ss_init_budget.tv_nsec = 0;
    109110
    110111  schedparam.sched_priority = 200;
    111   schedparam.ss_low_priority = -1;
     112  schedparam.sched_ss_low_priority = -1;
    112113
    113114  status = pthread_attr_setschedparam( &attr, &schedparam );
    114115  rtems_test_assert(  !status );
    115116
    116   puts( "Init: pthread_create - EINVAL (invalid ss_low_priority)" );
     117  puts( "Init: pthread_create - EINVAL (invalid sched_ss_low_priority)" );
    117118  status = pthread_create( &Task_id, &attr, Task_1, NULL );
    118119  rtems_test_assert(  status == EINVAL );
     
    120121  /* create a thread as a sporadic server */
    121122
    122   schedparam.ss_replenish_period.tv_sec = 2;
    123   schedparam.ss_replenish_period.tv_nsec = 0;
    124   schedparam.ss_initial_budget.tv_sec = 1;
    125   schedparam.ss_initial_budget.tv_nsec = 0;
     123  schedparam.sched_ss_repl_period.tv_sec = 2;
     124  schedparam.sched_ss_repl_period.tv_nsec = 0;
     125  schedparam.sched_ss_init_budget.tv_sec = 1;
     126  schedparam.sched_ss_init_budget.tv_nsec = 0;
    126127
    127128  schedparam.sched_priority = sched_get_priority_max( SCHED_FIFO );
    128   schedparam.ss_low_priority = sched_get_priority_max( SCHED_FIFO ) - 6;
     129  schedparam.sched_ss_low_priority = sched_get_priority_max( SCHED_FIFO ) - 6;
    129130
    130131  status = pthread_attr_setschedparam( &attr, &schedparam );
  • testsuites/psxtests/psxhdrs/pthread11.c

    r71a594af r66c9ad8  
    4343  param.sched_priority = 0;
    4444#ifdef _POSIX_SPORADIC_SERVER
    45   param.ss_low_priority = 0;
    46   param.ss_replenish_period.tv_sec = 0;
    47   param.ss_replenish_period.tv_nsec = 0;
    48   param.ss_initial_budget.tv_sec = 0;
    49   param.ss_initial_budget.tv_nsec = 0;
     45  param.sched_ss_low_priority = 0;
     46  param.sched_ss_repl_period.tv_sec = 0;
     47  param.sched_ss_repl_period.tv_nsec = 0;
     48  param.sched_ss_init_budget.tv_sec = 0;
     49  param.sched_ss_init_budget.tv_nsec = 0;
    5050#endif
    5151
  • testsuites/psxtests/psxhdrs/pthread22.c

    r71a594af r66c9ad8  
    4141  param.sched_priority = 0;
    4242#ifdef _POSIX_SPORADIC_SERVER
    43   param.ss_low_priority = 0;
    44   param.ss_replenish_period.tv_sec = 0;
    45   param.ss_replenish_period.tv_nsec = 0;
    46   param.ss_initial_budget.tv_sec = 0;
    47   param.ss_initial_budget.tv_nsec = 0;
     43  param.sched_ss_low_priority = 0;
     44  param.sched_ss_repl_period.tv_sec = 0;
     45  param.sched_ss_repl_period.tv_nsec = 0;
     46  param.sched_ss_init_budget.tv_sec = 0;
     47  param.sched_ss_init_budget.tv_nsec = 0;
    4848#endif
    4949
  • testsuites/psxtests/psxhdrs/sched01.c

    r71a594af r66c9ad8  
    3535  param.sched_priority = 0;
    3636#ifdef _POSIX_SPORADIC_SERVER
    37   param.ss_low_priority = 0;
    38   param.ss_replenish_period.tv_sec = 0;
    39   param.ss_replenish_period.tv_nsec = 0;
    40   param.ss_initial_budget.tv_sec = 0;
    41   param.ss_initial_budget.tv_nsec = 0;
     37  param.sched_ss_low_priority = 0;
     38  param.sched_ss_repl_period.tv_sec = 0;
     39  param.sched_ss_repl_period.tv_nsec = 0;
     40  param.sched_ss_init_budget.tv_sec = 0;
     41  param.sched_ss_init_budget.tv_nsec = 0;
    4242#endif
    4343
  • testsuites/psxtests/psxhdrs/sched03.c

    r71a594af r66c9ad8  
    4343  param.sched_priority = 0;
    4444#ifdef _POSIX_SPORADIC_SERVER
    45   param.ss_low_priority = 0;
    46   param.ss_replenish_period.tv_sec = 0;
    47   param.ss_replenish_period.tv_nsec = 0;
    48   param.ss_initial_budget.tv_sec = 0;
    49   param.ss_initial_budget.tv_nsec = 0;
     45  param.sched_ss_low_priority = 0;
     46  param.sched_ss_repl_period.tv_sec = 0;
     47  param.sched_ss_repl_period.tv_nsec = 0;
     48  param.sched_ss_init_budget.tv_sec = 0;
     49  param.sched_ss_init_budget.tv_nsec = 0;
    5050#endif
    5151
Note: See TracChangeset for help on using the changeset viewer.