source: rtems/cpukit/score/macros/rtems/score/userext.inl @ dd687d9

4.104.114.84.95
Last change on this file since dd687d9 was dd687d9, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 4, 2003 at 6:56:05 PM

2003-09-04 Joel Sherrill <joel@…>

  • include/rtems/debug.h, include/rtems/seterr.h, include/rtems/system.h, include/rtems/score/address.h, include/rtems/score/apiext.h, include/rtems/score/apimutex.h, include/rtems/score/bitfield.h, include/rtems/score/chain.h, include/rtems/score/context.h, include/rtems/score/copyrt.h, include/rtems/score/coremsg.h, include/rtems/score/coremutex.h, include/rtems/score/coresem.h, include/rtems/score/heap.h, include/rtems/score/interr.h, include/rtems/score/isr.h, include/rtems/score/mpci.h, include/rtems/score/mppkt.h, include/rtems/score/object.h, include/rtems/score/objectmp.h, include/rtems/score/priority.h, include/rtems/score/stack.h, include/rtems/score/states.h, include/rtems/score/sysstate.h, include/rtems/score/thread.h, include/rtems/score/threadmp.h, include/rtems/score/threadq.h, include/rtems/score/tod.h, include/rtems/score/tqdata.h, include/rtems/score/userext.h, include/rtems/score/watchdog.h, include/rtems/score/wkspace.h, inline/rtems/score/address.inl, inline/rtems/score/chain.inl, inline/rtems/score/coremsg.inl, inline/rtems/score/coremutex.inl, inline/rtems/score/coresem.inl, inline/rtems/score/heap.inl, inline/rtems/score/isr.inl, inline/rtems/score/mppkt.inl, inline/rtems/score/object.inl, inline/rtems/score/objectmp.inl, inline/rtems/score/priority.inl, inline/rtems/score/stack.inl, inline/rtems/score/states.inl, inline/rtems/score/sysstate.inl, inline/rtems/score/thread.inl, inline/rtems/score/threadmp.inl, inline/rtems/score/tod.inl, inline/rtems/score/tqdata.inl, inline/rtems/score/userext.inl, inline/rtems/score/watchdog.inl, inline/rtems/score/wkspace.inl, macros/rtems/score/address.inl, macros/rtems/score/chain.inl, macros/rtems/score/coremsg.inl, macros/rtems/score/coremutex.inl, macros/rtems/score/coresem.inl, macros/rtems/score/heap.inl, macros/rtems/score/isr.inl, macros/rtems/score/mppkt.inl, macros/rtems/score/object.inl, macros/rtems/score/objectmp.inl, macros/rtems/score/priority.inl, macros/rtems/score/stack.inl, macros/rtems/score/states.inl, macros/rtems/score/sysstate.inl, macros/rtems/score/thread.inl, macros/rtems/score/threadmp.inl, macros/rtems/score/tod.inl, macros/rtems/score/tqdata.inl, macros/rtems/score/userext.inl, macros/rtems/score/watchdog.inl, macros/rtems/score/wkspace.inl, src/apiext.c, src/chain.c, src/coremsg.c, src/coremsgbroadcast.c, src/coremsgclose.c, src/coremsgflush.c, src/coremsgflushsupp.c, src/coremsgflushwait.c, src/coremsginsert.c, src/coremsgseize.c, src/coremsgsubmit.c, src/coremutex.c, src/coremutexflush.c, src/coremutexseize.c, src/coremutexsurrender.c, src/coresem.c, src/coresemflush.c, src/coresemseize.c, src/coresemsurrender.c, src/coretod.c, src/coretodset.c, src/coretodtickle.c, src/coretodtoseconds.c, src/coretodvalidate.c, src/heap.c, src/heapallocate.c, src/heapextend.c, src/heapfree.c, src/heapgetinfo.c, src/heapsizeofuserarea.c, src/heapwalk.c, src/interr.c, src/isr.c, src/iterateoverthreads.c, src/mpci.c, src/object.c, src/objectallocate.c, src/objectallocatebyindex.c, src/objectclearname.c, src/objectcomparenameraw.c, src/objectcomparenamestring.c, src/objectcopynameraw.c, src/objectcopynamestring.c, src/objectextendinformation.c, src/objectfree.c, src/objectget.c, src/objectgetbyindex.c, src/objectgetisr.c, src/objectgetnext.c, src/objectgetnoprotection.c, src/objectidtoname.c, src/objectinitializeinformation.c, src/objectmp.c, src/objectnametoid.c, src/objectshrinkinformation.c, src/thread.c, src/threadchangepriority.c, src/threadclearstate.c, src/threadclose.c, src/threadcreateidle.c, src/threaddelayended.c, src/threaddispatch.c, src/threadevaluatemode.c, src/threadget.c, src/threadhandler.c, src/threadidlebody.c, src/threadinitialize.c, src/threadloadenv.c, src/threadmp.c, src/threadq.c, src/threadqdequeue.c, src/threadqdequeuefifo.c, src/threadqdequeuepriority.c, src/threadqenqueue.c, src/threadqenqueuefifo.c, src/threadqenqueuepriority.c, src/threadqextract.c, src/threadqextractfifo.c, src/threadqextractpriority.c, src/threadqextractwithproxy.c, src/threadqfirst.c, src/threadqfirstfifo.c, src/threadqfirstpriority.c, src/threadqflush.c, src/threadqtimeout.c, src/threadready.c, src/threadreset.c, src/threadresettimeslice.c, src/threadrestart.c, src/threadresume.c, src/threadrotatequeue.c, src/threadsetpriority.c, src/threadsetstate.c, src/threadsettransient.c, src/threadstackallocate.c, src/threadstackfree.c, src/threadstart.c, src/threadstartmultitasking.c, src/threadsuspend.c, src/threadtickletimeslice.c, src/threadyieldprocessor.c, src/userext.c, src/watchdog.c, src/watchdogadjust.c, src/watchdoginsert.c, src/watchdogremove.c, src/watchdogtickle.c, src/wkspace.c: URL for license changed.
  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*  userext.inl
2 *
3 *  This file contains the macro implementation of the inlined routines
4 *  from the User Extension Handler
5 *
6 *  COPYRIGHT (c) 1989-1999.
7 *  On-Line Applications Research Corporation (OAR).
8 *
9 *  The license and distribution terms for this file may be
10 *  found in the file LICENSE in this distribution or at
11 *  http://www.rtems.com/license/LICENSE.
12 *
13 *  $Id$
14 */
15
16#ifndef __USER_EXTENSIONS_inl
17#define __USER_EXTENSIONS_inl
18
19#include <rtems/score/wkspace.h>
20
21/*PAGE
22 *
23 *  _User_extensions_Add_set
24 *
25 *  NOTE: Must be before _User_extensions_Handler_initialization to
26 *        ensure proper inlining.
27 */
28 
29#define _User_extensions_Add_set( _the_extension, _extension_table ) \
30  do { \
31    (_the_extension)->Callouts = *(_extension_table); \
32    \
33    _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
34    \
35    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
36      (_the_extension)->Switch.thread_switch = \
37        (_the_extension)->Callouts.thread_switch; \
38      _Chain_Append( \
39        &_User_extensions_Switches_list, \
40        &(_the_extension)->Switch.Node \
41     ); \
42    } \
43  } while ( 0 )
44 
45
46/*PAGE
47 *
48 *  _User_extensions_Handler_initialization
49 *
50 */
51
52#define _User_extensions_Handler_initialization( \
53  _number_of_extensions, _initial_extensions \
54) \
55  { \
56    User_extensions_Control *extension; \
57    unsigned32               i; \
58    \
59    _Chain_Initialize_empty( &_User_extensions_List ); \
60    _Chain_Initialize_empty( &_User_extensions_Switches_list ); \
61    \
62    if ( (_initial_extensions) ) { \
63      extension = _Workspace_Allocate_or_fatal_error( \
64          sizeof(User_extensions_Control) * _number_of_extensions ); \
65      \
66      memset ( \
67        extension, \
68        0, \
69        _number_of_extensions * sizeof( User_extensions_Control ) \
70      ); \
71      \
72      for ( i = 0 ; i < _number_of_extensions ; i++ ) { \
73        _User_extensions_Add_set (extension, &_initial_extensions[i]); \
74        extension++; \
75      } \
76    } \
77  }
78
79/*PAGE
80 *
81 *  _User_extensions_Add_API_set
82 */
83 
84#define _User_extensions_Add_API_set( _the_extension ) \
85  do { \
86    _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
87    \
88    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
89      (_the_extension)->Switch.thread_switch = \
90          (_the_extension)->Callouts.thread_switch; \
91      _Chain_Append( \
92        &_User_extensions_Switches_list, &(_the_extension)->Switch.Node ); \
93    } \
94  } while ( 0 )
95 
96/*PAGE
97 *
98 *  _User_extensions_Remove_set
99 */
100
101#define _User_extensions_Remove_set( _the_extension ) \
102  do { \
103    _Chain_Extract( &(_the_extension)->Node ); \
104    \
105    if ( (_the_extension)->Callouts.thread_switch != NULL ) { \
106      _Chain_Extract( &(_the_extension)->Node ); \
107    } \
108  } while (0)
109
110/*PAGE
111 *
112 *  _User_extensions_Thread_switch
113 *
114 */
115
116#define _User_extensions_Thread_switch( _executing, _heir ) \
117  do { \
118    Chain_Node                     *the_node; \
119    User_extensions_Switch_control *the_extension_switch; \
120    \
121    for ( the_node = _User_extensions_Switches_list.first ; \
122          !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; \
123          the_node = the_node->next ) { \
124      \
125      the_extension_switch = (User_extensions_Switch_control *) the_node; \
126      \
127      (*the_extension_switch->thread_switch)( _executing, _heir ); \
128    } \
129  } while (0)
130
131#endif
132/* end of include file */
Note: See TracBrowser for help on using the repository browser.