Ticket #1407: isr.patch

File isr.patch, 3.6 KB (added by Sebastian Huber, on 07/13/09 at 13:52:52)

Implementation

  • cpukit/ChangeLog

    RCS file: /usr1/CVS/rtems/cpukit/ChangeLog,v
    retrieving revision 1.1850
    diff -u -r1.1850 ChangeLog
     
     12009-07-13      Sebastian Huber <sebastian.huber@embedded-brains.de>
     2
     3        * score/src/isrthreaddispatch.c: New file.
     4        * score/include/rtems/score/isr.h: Added prototype.
     5        * score/Makefile.am: Update.
     6
    172009-07-10      Joel Sherrill <joel.sherrill@OARcorp.com>
    28
    39        * configure.ac, score/src/threadqenqueuepriority.c: Add
  • cpukit/score/Makefile.am

    RCS file: /usr1/CVS/rtems/cpukit/score/Makefile.am,v
    retrieving revision 1.66
    diff -u -r1.66 Makefile.am
     
    196196## STD_C_FILES
    197197libscore_a_SOURCES += src/apiext.c src/chain.c src/chainappend.c \
    198198    src/chainextract.c src/chainget.c src/chaininsert.c \
    199     src/interr.c src/isr.c src/wkspace.c
     199    src/interr.c src/isr.c src/isrthreaddispatch.c src/wkspace.c
    200200
    201201EXTRA_DIST = src/Unlimited.txt
    202202
  • new file cpukit/score/src/isrthreaddispatch.c

    RCS file: cpukit/score/src/isrthreaddispatch.c
    diff -N cpukit/score/src/isrthreaddispatch.c
    - +  
     1/**
     2 * @file
     3 *
     4 * @brief Thread dispatch from interrupt context.
     5 */
     6
     7/*
     8 * Copyright (c) 2009 embedded brains GmbH
     9 *
     10 * embedded brains GmbH
     11 * Obere Lagerstr. 30
     12 * D-82178 Puchheim
     13 * Germany
     14 * <rtems@embedded-brains.de>
     15 *
     16 * Copyright (c) 2009 Till Straumann <strauman@slac.stanford.edu>
     17 *
     18 * The license and distribution terms for this file may be
     19 * found in the file LICENSE in this distribution or at
     20 * http://www.rtems.com/license/LICENSE.
     21 */
     22
     23#include <rtems.h>
     24#include <rtems/score/apiext.h>
     25
     26void _ISR_Thread_dispatch( void )
     27{
     28  if ( _Context_Switch_necessary ) {
     29    _Thread_Dispatch();
     30  } else if (_ ISR_Signals_to_thread_executing ) {
     31    _ISR_Signals_to_thread_executing = false;
     32    if (
     33      _Thread_Do_post_task_switch_extension
     34        || _Thread_Executing->do_post_task_switch_extension
     35    ) {
     36      _Thread_Executing->do_post_task_switch_extension = false;
     37      _API_extensions_Run_postswitch();
     38    }
     39  }
     40}
  • cpukit/score/include/rtems/score/isr.h

    RCS file: /usr1/CVS/rtems/cpukit/score/include/rtems/score/isr.h,v
    retrieving revision 1.29
    diff -u -r1.29 isr.h
     
    196196void _ISR_Dispatch( void );
    197197
    198198/**
     199 *  Invokes the thread dispatcher or signal extension if necessary.
     200 *
     201 *  It should be called at the end of interrupt processing.  The thread
     202 *  dispatch disable level and the interrupt nest level must be zero before
     203 *  calling this routine.
     204 *
     205 *  This is a high level replacement of _ISR_Dispatch().  It must be invoked
     206 *  within an environment such that a call to _Thread_Dispatch() is allowed.
     207 */
     208void _ISR_Thread_dispatch( void );
     209
     210/**
    199211 *  This function returns true if the processor is currently servicing
    200212 *  and interrupt and false otherwise.   A return value of true indicates
    201213 *  that the caller is an interrupt service routine, NOT a thread.  The