Changeset 8f548ce in rtems


Ignore:
Timestamp:
Nov 12, 2012, 4:58:48 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
00dae186
Parents:
8f1b6cde
git-author:
Sebastian Huber <sebastian.huber@…> (11/12/12 16:58:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/13/12 08:38:03)
Message:

sptests/spintrcritical09: Fix check order

The critical section check never succeeded since watchdogs are ordered
with respect to the insertion time. Now we call the watchdog routine if
appropriate and bypass the normal watchdog mechanic.

File:
1 edited

Legend:

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

    r8f1b6cde r8f548ce  
    1616#include <intrcritical.h>
    1717
    18 /* forward declarations to avoid warnings */
    19 rtems_task Init(rtems_task_argument argument);
    20 rtems_timer_service_routine test_release_from_isr(rtems_id  timer, void *arg);
    21 Thread_blocking_operation_States getState(void);
     18static rtems_id Semaphore;
     19static bool case_hit;
    2220
    23 rtems_id Main_task;
    24 rtems_id Semaphore;
    25 volatile bool case_hit;
    26 
    27 Thread_blocking_operation_States getState(void)
     21static Thread_blocking_operation_States getState(void)
    2822{
    2923  Objects_Locations  location;
     
    4135}
    4236
    43 rtems_timer_service_routine test_release_from_isr(
     37static rtems_timer_service_routine test_release_from_isr(
    4438  rtems_id  timer,
    4539  void     *arg
    4640)
    4741{
    48   if ( getState() == THREAD_BLOCKING_OPERATION_TIMEOUT ) {
    49     case_hit = true;
     42  Chain_Control *chain = &_Watchdog_Ticks_chain;
     43
     44  if ( !_Chain_Is_empty( chain ) ) {
     45    Watchdog_Control *watchdog = _Watchdog_First( chain );
     46
     47    if (
     48      watchdog->delta_interval == 0
     49        && watchdog->routine == _Thread_queue_Timeout
     50    ) {
     51      Watchdog_States state = _Watchdog_Remove( watchdog );
     52
     53      rtems_test_assert( state == WATCHDOG_ACTIVE );
     54      (*watchdog->routine)( watchdog->id, watchdog->user_data );
     55
     56      if ( getState() == THREAD_BLOCKING_OPERATION_TIMEOUT ) {
     57        case_hit = true;
     58      }
     59    }
    5060  }
    5161}
    5262
    53 rtems_task Init(
     63static rtems_task Init(
    5464  rtems_task_argument ignored
    5565)
     
    6474  sc = rtems_semaphore_create(
    6575    rtems_build_name( 'S', 'M', '1', ' ' ),
    66     1,
     76    0,
    6777    RTEMS_DEFAULT_ATTRIBUTES,
    6878    RTEMS_NO_PRIORITY,
     
    7080  );
    7181  directive_failed( sc, "rtems_semaphore_create of SM1" );
    72 
    73   Main_task = rtems_task_self();
    7482
    7583  interrupt_critical_section_test_support_initialize( test_release_from_isr );
     
    98106#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    99107
    100 #define CONFIGURE_MAXIMUM_TASKS       2
     108#define CONFIGURE_MAXIMUM_TASKS       1
    101109#define CONFIGURE_MAXIMUM_TIMERS      1
    102110#define CONFIGURE_MAXIMUM_SEMAPHORES  1
Note: See TracChangeset for help on using the changeset viewer.