OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [exec/] [score/] [macros/] [rtems/] [score/] [userext.inl] - Blame information for rev 578

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  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.OARcorp.com/rtems/license.html.
12
 *
13
 *  $Id: userext.inl,v 1.2 2001-09-27 11:59:34 chris Exp $
14
 */
15
 
16
#ifndef __USER_EXTENSIONS_inl
17
#define __USER_EXTENSIONS_inl
18
 
19
/*PAGE
20
 *
21
 *  _User_extensions_Handler_initialization
22
 *
23
 */
24
 
25
#define _User_extensions_Handler_initialization( \
26
  number_of_extensions, _initial_extensions \
27
) \
28
  { \
29
    User_extensions_Control *extension; \
30
    unsigned32               i; \
31
    _Chain_Initialize_empty( &_User_extensions_List ); \
32
    \
33
    if ( (_initial_extensions) ) { \
34
      for (i=0 ; i
35
        extension = \
36
           _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) ); \
37
        \
38
        extension->Callouts = _initial_extensions[i]; \
39
        _Chain_Append( &_User_extensions_List, &extension->Node ); \
40
      } \
41
    } \
42
  }
43
 
44
/*PAGE
45
 *
46
 *  _User_extensions_Add_set
47
 */
48
 
49
#define _User_extensions_Add_set( _the_extension, _extension_table ) \
50
  do { \
51
    (_the_extension)->Callouts = *(_extension_table); \
52
    \
53
    _Chain_Append( &_User_extensions_List, &(_the_extension)->Node ); \
54
  } while ( 0 )
55
 
56
/*PAGE
57
 *
58
 *  _User_extensions_Add_API_set
59
 */
60
 
61
#define _User_extensions_Add_API_set( _the_extension ) \
62
  _Chain_Prepend( &_User_extensions_List, &(_the_extension)->Node )
63
 
64
 
65
/*PAGE
66
 *
67
 *  _User_extensions_Remove_set
68
 */
69
 
70
#define _User_extensions_Remove_set( _the_extension ) \
71
  _Chain_Extract( &(_the_extension)->Node )
72
 
73
/*PAGE
74
 *
75
 *  _User_extensions_Run_list_forward
76
 *
77
 *  NOTE:  No parentheses around macro names here to avoid
78
 *         messing up the name and function call expansion.
79
 */
80
 
81
#define _User_extensions_Run_list_forward( _name, _arguments ) \
82
  do { \
83
    Chain_Node              *the_node; \
84
    User_extensions_Control *the_extension; \
85
    \
86
    for ( the_node = _User_extensions_List.first ; \
87
          !_Chain_Is_tail( &_User_extensions_List, the_node ) ; \
88
          the_node = the_node->next ) { \
89
      the_extension = (User_extensions_Control *) the_node; \
90
      \
91
      if ( the_extension->Callouts.## _name != NULL ) \
92
        (*the_extension->Callouts.## _name) _arguments; \
93
      \
94
    } \
95
    \
96
  } while ( 0 )
97
 
98
/*PAGE
99
 *
100
 *  _User_extensions_Run_list_backward
101
 *
102
 *  NOTE:  No parentheses around macro names here to avoid
103
 *         messing up the name and function call expansion.
104
 */
105
 
106
#define _User_extensions_Run_list_backward( _name, _arguments ) \
107
  do { \
108
    Chain_Node              *the_node; \
109
    User_extensions_Control *the_extension; \
110
    \
111
    for ( the_node = _User_extensions_List.last ; \
112
          !_Chain_Is_head( &_User_extensions_List, the_node ) ; \
113
          the_node = the_node->previous ) { \
114
      the_extension = (User_extensions_Control *) the_node; \
115
      \
116
      if ( the_extension->Callouts.## _name != NULL ) \
117
        (*the_extension->Callouts.## _name) _arguments; \
118
      \
119
    } \
120
    \
121
  } while ( 0 )
122
 
123
/*PAGE
124
 *
125
 *  _User_extensions_Thread_switch
126
 *
127
 */
128
 
129
#define _User_extensions_Thread_switch( _executing, _heir ) \
130
  _User_extensions_Run_list_forward(thread_switch, (_executing, _heir) )
131
 
132
#endif
133
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.