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

Subversion Repositories openrisc_me

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

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
#include 
20
 
21
/*PAGE
22
 *
23
 *  _User_extensions_Handler_initialization
24
 *
25
 *  DESCRIPTION:
26
 *
27
 *  This routine performs the initialization necessary for this handler.
28
 */
29
 
30
RTEMS_INLINE_ROUTINE void _User_extensions_Handler_initialization (
31
    unsigned32              number_of_extensions,
32
    User_extensions_Table  *initial_extensions
33
)
34
{
35
  User_extensions_Control *extension;
36
  unsigned32               i;
37
 
38
  _Chain_Initialize_empty( &_User_extensions_List );
39
 
40
  if ( initial_extensions ) {
41
    for (i=0 ; i
42
      extension =
43
         _Workspace_Allocate_or_fatal_error( sizeof(User_extensions_Control) );
44
 
45
      extension->Callouts = initial_extensions[i];
46
      _Chain_Append( &_User_extensions_List, &extension->Node );
47
    }
48
  }
49
}
50
 
51
/*PAGE
52
 *
53
 *  _User_extensions_Add_set
54
 *
55
 *  DESCRIPTION:
56
 *
57
 *  This routine is used to add a user extension set to the active list.
58
 */
59
 
60
RTEMS_INLINE_ROUTINE void _User_extensions_Add_set (
61
  User_extensions_Control *the_extension,
62
  User_extensions_Table   *extension_table
63
)
64
{
65
  the_extension->Callouts = *extension_table;
66
 
67
  _Chain_Append( &_User_extensions_List, &the_extension->Node );
68
}
69
 
70
/*PAGE
71
 *
72
 *  _User_extensions_Add_API_set
73
 *  DESCRIPTION:
74
 *
75
 *  This routine is used to add an API extension set to the active list.
76
 */
77
 
78
RTEMS_INLINE_ROUTINE void _User_extensions_Add_API_set (
79
  User_extensions_Control *the_extension
80
)
81
{
82
  _Chain_Prepend( &_User_extensions_List, &the_extension->Node );
83
}
84
 
85
/*PAGE
86
 *
87
 *  _User_extensions_Remove_set
88
 *
89
 *  DESCRIPTION:
90
 *
91
 *  This routine is used to remove a user extension set from the active list.
92
 */
93
 
94
RTEMS_INLINE_ROUTINE void _User_extensions_Remove_set (
95
  User_extensions_Control  *the_extension
96
)
97
{
98
  _Chain_Extract( &the_extension->Node );
99
}
100
 
101
/*PAGE
102
 *
103
 *  _User_extensions_Thread_switch
104
 *
105
 *  DESCRIPTION:
106
 *
107
 *  This routine is used to invoke the user extension which
108
 *  is invoked when a context switch occurs.
109
 */
110
 
111
RTEMS_INLINE_ROUTINE void _User_extensions_Thread_switch (
112
  Thread_Control *executing,
113
  Thread_Control *heir
114
)
115
{
116
  Chain_Node              *the_node;
117
  User_extensions_Control *the_extension;
118
 
119
  for ( the_node = _User_extensions_List.first ;
120
        !_Chain_Is_tail( &_User_extensions_List, the_node ) ;
121
        the_node = the_node->next ) {
122
 
123
    the_extension = (User_extensions_Control *) the_node;
124
 
125
    if ( the_extension->Callouts.thread_switch != NULL )
126
      (*the_extension->Callouts.thread_switch)( executing, heir );
127
  }
128
}
129
 
130
#endif
131
/* end of include file */

powered by: WebSVN 2.1.0

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