source: rtems/cpukit/score/include/rtems/score/apiext.h @ 092f142a

4.104.114.84.95
Last change on this file since 092f142a was 092f142a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 01/28/05 at 05:00:21

New header guard.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/**
2 *  @file  rtems/score/apiext.h
3 *
4 *  This is the API Extensions Handler.
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-2004.
9 *  On-Line Applications Research Corporation (OAR).
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.com/license/LICENSE.
14 *
15 *  $Id$
16 */
17
18#ifndef _RTEMS_SCORE_APIEXT_H
19#define _RTEMS_SCORE_APIEXT_H
20
21/**
22 *  @defgroup ScoreAPIExtension API Extension Handler
23 *
24 *  This group contains functionality which provides mechanisms for the
25 *  SuperCore to perform API specific actions without there being
26 *  "up-references" from the SuperCore to APIs.  If these references
27 *  were allowed in the implementation, the cohesion would be too high
28 *  and adding an API would be more difficult.  The SuperCore is supposed
29 *  to be largely independent of any API.
30 */
31/**@{*/
32
33#include <rtems/score/chain.h>
34#include <rtems/score/thread.h>
35
36/**
37 *  This type defines the prototype of the Predriver Hook.
38 */
39typedef void (*API_extensions_Predriver_hook)(void);
40
41/**
42 *  This type defines the prototype of the Postdriver Hook.
43 */
44typedef void (*API_extensions_Postdriver_hook)(void);
45
46/**
47 *  This type defines the prototype of the Postswitch Hook.
48 */
49typedef void (*API_extensions_Postswitch_hook)(
50                 Thread_Control *
51             );
52
53/**
54 *  The control structure which defines the points at which an API
55 *  can add an extension to the system initialization thread.
56 */
57typedef struct {
58  /** This field allows this structure to be used with the Chain Handler. */
59  Chain_Node                      Node;
60  /**
61   * This field is the callout invoked during RTEMS initialization after
62   * RTEMS data structures are initialized before device driver initialization
63   * has occurred.
64   *
65   * @note If this field is NULL, no extension is invoked.
66   */
67  API_extensions_Predriver_hook   predriver_hook;
68  /**
69   * This field is the callout invoked during RTEMS initialization after
70   * RTEMS data structures and device driver initialization has occurred
71   * but before multitasking is initiated.
72   *
73   * @note If this field is NULL, no extension is invoked.
74   */
75  API_extensions_Postdriver_hook  postdriver_hook;
76  /**
77   * This field is the callout invoked during each context switch
78   * in the context of the heir thread.
79   *
80   * @note If this field is NULL, no extension is invoked.
81   */
82  API_extensions_Postswitch_hook  postswitch_hook;
83}  API_extensions_Control;
84
85/**
86 *  This is the list of API extensions to the system initialization.
87 */
88SCORE_EXTERN Chain_Control _API_extensions_List;
89
90/**
91 *  This routine initializes the API extension handler.
92 */
93void _API_extensions_Initialization( void );
94
95/**
96 *  This routine adds an extension to the active set of API extensions.
97 *
98 *  @param the_extension (in) is the extension set to add.
99 */
100void _API_extensions_Add(
101  API_extensions_Control *the_extension
102);
103
104/**
105 *  This routine executes all of the predriver callouts.
106 */
107void _API_extensions_Run_predriver( void );
108
109/**
110 *  This routine executes all of the postdriver callouts.
111 */
112void _API_extensions_Run_postdriver( void );
113
114/**
115 *  This routine executes all of the post context switch callouts.
116 */
117void _API_extensions_Run_postswitch( void );
118
119/**@}*/
120
121#endif
122/* end of include file */
Note: See TracBrowser for help on using the repository browser.