Changeset 9185d61 in rtems for testsuites/sptests/sp39/init.c


Ignore:
Timestamp:
Jan 23, 2008, 1:05:55 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.9, master
Children:
6b8da2b
Parents:
11c16a64
Message:

2008-01-23 Joel Sherrill <joel.sherrill@…>

  • sp39/init.c: Add case for long timeout on blocking operation.
  • Makefile.am, configure.ac: Add new test to exercise thread queue blokcing synchronization. sp39 and sp41 are very similar.
  • sp41/.cvsignore, sp41/Makefile.am, sp41/init.c, sp41/sp41.scn, sp41/system.h: New files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/sp39/init.c

    r11c16a64 r9185d61  
    22 *  Classic API Signal to Task from ISR
    33 *
    4  *  COPYRIGHT (c) 1989-2007.
     4 *  COPYRIGHT (c) 1989-2008.
    55 *  On-Line Applications Research Corporation (OAR).
    66 *
     
    4545}
    4646
     47rtems_timer_service_routine test_event_with_timeout_from_isr(
     48  rtems_id  timer,
     49  void     *arg
     50)
     51{
     52  rtems_status_code     status;
     53
     54  if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) {
     55    /*
     56     *  We want to catch the task while it is blocking.  Otherwise
     57     *  just send and make it happy.
     58     */
     59    case_hit = TRUE;
     60  }
     61  status = rtems_event_send( main_task, 0x01 );
     62}
     63
    4764rtems_task Init(
    4865  rtems_task_argument argument
     
    7794
    7895  /*
    79    * Test Event send successful from ISR
     96   * Test Event send successful from ISR -- receive is forever
    8097   */
    8198  case_hit = FALSE;
     
    106123   printf(
    107124     "Event sent from ISR hitting synchronization point has %soccurred\n",
     125     (( case_hit == TRUE ) ? "" : "NOT ")
     126  );
     127
     128  /*
     129   * Test Event send successful from ISR -- receive has timeout
     130   */
     131  case_hit = FALSE;
     132  iterations = 0;
     133  max = 1;
     134
     135  while (1) {
     136    if ( case_hit )
     137      break;
     138    status = rtems_timer_fire_after(
     139      timer, 1, test_event_with_timeout_from_isr, NULL );
     140    directive_failed( status, "timer_fire_after failed" );
     141
     142    for (i=0 ; i<max ; i++ )
     143      if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_SATISFIED )
     144        break;
     145
     146    status = rtems_event_receive( 0x01, RTEMS_DEFAULT_OPTIONS, 10, &out );
     147    directive_failed( status, "rtems_event_receive" );
     148    if ( case_hit == TRUE )
     149      break;
     150    max += 2;
     151
     152    /* with our clock tick, this is about 30 seconds */
     153    if ( ++iterations >= 4 * 1000 * 30)
     154      break;
     155  }
     156
     157   printf(
     158     "Event sent from ISR (with timeout) hitting synchronization "
     159       "point has %soccurred\n",
    108160     (( case_hit == TRUE ) ? "" : "NOT ")
    109161  );
Note: See TracChangeset for help on using the changeset viewer.