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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [compat/] [uitron/] [current/] [src/] [uit_ifnc.cxx] - Blame information for rev 786

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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