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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [compat/] [uitron/] [v2_0/] [src/] [uit_ifnc.cxx] - Blame information for rev 773

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

Line No. Rev Author Line
1 27 unneback
//===========================================================================
2
//
3
//      uit_ifnc.cxx
4
//
5
//      uITRON compatibility functions
6
//
7
//===========================================================================
8
//####ECOSGPLCOPYRIGHTBEGIN####
9
// -------------------------------------------
10
// This file is part of eCos, the Embedded Configurable Operating System.
11
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
12
//
13
// eCos is free software; you can redistribute it and/or modify it under
14
// the terms of the GNU General Public License as published by the Free
15
// Software Foundation; either version 2 or (at your option) any later version.
16
//
17
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
19
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
20
// for more details.
21
//
22
// You should have received a copy of the GNU General Public License along
23
// with eCos; if not, write to the Free Software Foundation, Inc.,
24
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25
//
26
// As a special exception, if other files instantiate templates or use macros
27
// or inline functions from this file, or you compile this file and link it
28
// with other works to produce a work based on this file, this file does not
29
// by itself cause the resulting work to be covered by the GNU General Public
30
// License. However the source code for this file must still be made available
31
// in accordance with section (3) of the GNU General Public License.
32
//
33
// This exception does not invalidate any other reasons why a work based on
34
// this file might be covered by the GNU General Public License.
35
//
36
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37
// at http://sources.redhat.com/ecos/ecos-license/
38
// -------------------------------------------
39
//####ECOSGPLCOPYRIGHTEND####
40
//===========================================================================
41
//#####DESCRIPTIONBEGIN####
42
//
43
// Author(s):   hmt
44
// Contributors:        hmt
45
// Date:        1998-03-13
46
// Purpose:     uITRON compatibility functions for use in ISRs
47
// Description: 
48
//
49
//####DESCRIPTIONEND####
50
//
51
//===========================================================================
52
 
53
#include <pkgconf/uitron.h>             // uITRON setup CYGNUM_UITRON_SEMAS
54
                                        // CYGPKG_UITRON et al
55
 
56
#ifdef CYGPKG_UITRON
57
 
58
// invoke the inline function definition to create static C linkage
59
// functions here:
60
#define CYGIMP_UITRON_INLINE_FUNCS 1
61
#include <cyg/compat/uitron/uit_func.h>
62
 
63
// Now ensure that we create *outline* funcs for the ixxx_yyy() functions
64
// here, with C names or whatever, as required.
65
 
66
#undef CYGPRI_UITRON_FUNCS_HERE_AND_NOW
67
#undef CYGIMP_UITRON_INLINE_FUNCS
68
#undef CYG_UIT_FUNC_EXTERN_BEGIN
69
#undef CYG_UIT_FUNC_EXTERN_END
70
 
71
#ifdef CYGIMP_UITRON_CPP_OUTLINE_FUNCS
72
#define CYG_UIT_FUNC_EXTERN_BEGIN       extern "C++" {
73
#define CYG_UIT_FUNC_EXTERN_END         }
74
#else
75
#define CYG_UIT_FUNC_EXTERN_BEGIN       extern "C" {
76
#define CYG_UIT_FUNC_EXTERN_END         }
77
#endif
78
 
79
// Get extern C prototypes (or whatever uit_func.h above did)
80
#include <cyg/compat/uitron/uit_ifnc.h>
81
 
82
#undef  CYG_UIT_FUNC_INLINE
83
#define CYG_UIT_FUNC_INLINE /* blank */
84
#define CYGPRI_UITRON_FUNCS_HERE_AND_NOW
85
#include <cyg/compat/uitron/uit_ifnc.inl>
86
 
87
volatile int cyg_uit_dsr_actions_head = 0;
88
volatile int cyg_uit_dsr_actions_tail = 0;
89
 
90
Cyg_Uit_Action::action
91
cyg_uit_dsr_actions[ CYGNUM_UITRON_ISR_ACTION_QUEUESIZE ];
92
 
93
ID
94
cyg_uit_dsr_act_ids[ CYGNUM_UITRON_ISR_ACTION_QUEUESIZE ];
95
 
96
CYG_ADDRWORD
97
cyg_uit_dsr_act_a1s[ CYGNUM_UITRON_ISR_ACTION_QUEUESIZE ];
98
 
99
void
100
cyg_uitron_dsr( unsigned int vector, unsigned int count, unsigned int data )
101
{
102
    while ( cyg_uit_dsr_actions_tail != cyg_uit_dsr_actions_head ) {
103
        switch ( cyg_uit_dsr_actions[ cyg_uit_dsr_actions_tail ] ) {
104
        case Cyg_Uit_Action::WUP_TSK:
105
            (void)wup_tsk( cyg_uit_dsr_act_ids[ cyg_uit_dsr_actions_tail ] );
106
            break;
107
#ifdef CYGPKG_UITRON_SEMAS
108
#if 0 < CYG_UITRON_NUM( SEMAS )
109
        case Cyg_Uit_Action::SIG_SEM:
110
            (void)sig_sem( cyg_uit_dsr_act_ids[ cyg_uit_dsr_actions_tail ] );
111
            break;
112
#endif // 0 < CYG_UITRON_NUM( SEMAS )
113
#endif // CYGPKG_UITRON_SEMAS
114
#ifdef CYGPKG_UITRON_FLAGS
115
#if 0 < CYG_UITRON_NUM( FLAGS )
116
        case Cyg_Uit_Action::SET_FLG:
117
            (void)set_flg( cyg_uit_dsr_act_ids[ cyg_uit_dsr_actions_tail ],
118
                     (UINT)cyg_uit_dsr_act_a1s[ cyg_uit_dsr_actions_tail ] );
119
            break;
120
#endif // 0 < CYG_UITRON_NUM( FLAGS )
121
#endif // CYGPKG_UITRON_FLAGS
122
#ifdef CYGPKG_UITRON_MBOXES
123
#if 0 < CYG_UITRON_NUM( MBOXES )
124
        case Cyg_Uit_Action::SND_MSG:
125
            (void)snd_msg( cyg_uit_dsr_act_ids[ cyg_uit_dsr_actions_tail ],
126
                  (T_MSG *)cyg_uit_dsr_act_a1s[ cyg_uit_dsr_actions_tail ] );
127
            break;
128
#endif // 0 < CYG_UITRON_NUM( MBOXES )
129
#endif // CYGPKG_UITRON_MBOXES
130
        default:
131
            CYG_FAIL( "enum Cyg_Uit_Action out of range!" );
132
        }
133
        cyg_uit_dsr_actions_tail =
134
            CYGNUM_UITRON_ISR_ACTION_QUEUEMASK & (1+cyg_uit_dsr_actions_tail);
135
    }
136
}
137
 
138
#endif // CYGPKG_UITRON
139
 
140
// EOF uit_ifnc.cxx

powered by: WebSVN 2.1.0

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