source: rtems/cpukit/score/include/rtems/score/apiext.h @ 20f02c6

4.104.115
Last change on this file since 20f02c6 was 27b961a, checked in by Joel Sherrill <joel.sherrill@…>, on 07/03/09 at 20:25:35

2009-07-03 Joel Sherrill <joel.sherrill@…>

  • itron/src/task.c, posix/src/pthread.c, rtems/src/tasks.c, sapi/src/exinit.c, score/include/rtems/score/apiext.h, score/src/apiext.c: No APIs currently implemented use the predriver_hook so disable it until such time as it is used.
  • Property mode set to 100644
File size: 3.7 KB
Line 
1/**
2 *  @file  rtems/score/apiext.h
3 *
4 *  This is the API Extensions Handler.
5 */
6
7/*
8 *  COPYRIGHT (c) 1989-2009.
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 handler encapsulates functionality which provides mechanisms for the
25 *  SuperCore to perform API specific actions without there beingg
26 *  "up-references" from the SuperCore to APIs.  If these referencesg
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#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
37  /**
38   *  This type defines the prototype of the Predriver Hook.
39   */
40  typedef void (*API_extensions_Predriver_hook)(void);
41#endif
42
43/**
44 *  This type defines the prototype of the Postdriver Hook.
45 */
46typedef void (*API_extensions_Postdriver_hook)(void);
47
48/**
49 *  This type defines the prototype of the Postswitch Hook.
50 */
51typedef void (*API_extensions_Postswitch_hook)(
52                 Thread_Control *
53             );
54
55/**
56 *  The control structure which defines the points at which an API
57 *  can add an extension to the system initialization thread.
58 */
59typedef struct {
60  /** This field allows this structure to be used with the Chain Handler. */
61  Chain_Node                      Node;
62  #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
63    /**
64     * This field is the callout invoked during RTEMS initialization after
65     * RTEMS data structures are initialized before device driver initialization
66     * has occurred.
67     *
68     * @note If this field is NULL, no extension is invoked.
69     */
70    API_extensions_Predriver_hook   predriver_hook;
71  #endif
72  /**
73   * This field is the callout invoked during RTEMS initialization after
74   * RTEMS data structures and device driver initialization has occurred
75   * but before multitasking is initiated.
76   *
77   * @note If this field is NULL, no extension is invoked.
78   */
79  API_extensions_Postdriver_hook  postdriver_hook;
80  /**
81   * This field is the callout invoked during each context switch
82   * in the context of the heir thread.
83   *
84   * @note If this field is NULL, no extension is invoked.
85   */
86  API_extensions_Postswitch_hook  postswitch_hook;
87}  API_extensions_Control;
88
89/**
90 *  This is the list of API extensions to the system initialization.
91 */
92SCORE_EXTERN Chain_Control _API_extensions_List;
93
94/** @brief Initialize the API Extensions Handler
95 *
96 *  This routine initializes the API extension handler.
97 */
98void _API_extensions_Initialization( void );
99
100/** @brief Add Extension Set to the Active Set
101 *
102 *  This routine adds an extension to the active set of API extensions.
103 *
104 *  @param[in] the_extension is the extension set to add.
105 */
106void _API_extensions_Add(
107  API_extensions_Control *the_extension
108);
109
110#if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API)
111  /** @brief Execute all Pre-Driver Extensions
112   *
113   *  This routine executes all of the predriver callouts.
114   */
115  void _API_extensions_Run_predriver( void );
116#endif
117
118/** @brief Execute all Post-Driver Extensions
119 *
120 *  This routine executes all of the postdriver callouts.
121 */
122void _API_extensions_Run_postdriver( void );
123
124/** @brief Execute all Post Context Switch Extensions
125 *
126 *  This routine executes all of the post context switch callouts.
127 */
128void _API_extensions_Run_postswitch( void );
129
130/**@}*/
131
132#endif
133/* end of include file */
Note: See TracBrowser for help on using the repository browser.