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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [powerpc/] [ppc40x/] [v2_0/] [include/] [var_intr.h] - Blame information for rev 723

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

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_VAR_INTR_H
2
#define CYGONCE_VAR_INTR_H
3
//=============================================================================
4
//
5
//      var_intr.h
6
//
7
//      Variant HAL interrupt and clock support
8
//
9
//=============================================================================
10
//####ECOSGPLCOPYRIGHTBEGIN####
11
// -------------------------------------------
12
// This file is part of eCos, the Embedded Configurable Operating System.
13
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14
//
15
// eCos is free software; you can redistribute it and/or modify it under
16
// the terms of the GNU General Public License as published by the Free
17
// Software Foundation; either version 2 or (at your option) any later version.
18
//
19
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
// for more details.
23
//
24
// You should have received a copy of the GNU General Public License along
25
// with eCos; if not, write to the Free Software Foundation, Inc.,
26
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
//
28
// As a special exception, if other files instantiate templates or use macros
29
// or inline functions from this file, or you compile this file and link it
30
// with other works to produce a work based on this file, this file does not
31
// by itself cause the resulting work to be covered by the GNU General Public
32
// License. However the source code for this file must still be made available
33
// in accordance with section (3) of the GNU General Public License.
34
//
35
// This exception does not invalidate any other reasons why a work based on
36
// this file might be covered by the GNU General Public License.
37
//
38
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
// at http://sources.redhat.com/ecos/ecos-license/
40
// -------------------------------------------
41
//####ECOSGPLCOPYRIGHTEND####
42
//=============================================================================
43
//#####DESCRIPTIONBEGIN####
44
//
45
// Author(s):   nickg
46
// Contributors:nickg, jskov, jlarmour, hmt, gthomas
47
// Date:        2000-04-02
48
// Purpose:     Variant interrupt support
49
// Description: The macros defined here provide the HAL APIs for handling
50
//              interrupts and the clock on the PPC40x variant CPUs.
51
// Usage:       Is included via the architecture interrupt header:
52
//              #include <cyg/hal/hal_intr.h>
53
//              ...
54
//
55
//####DESCRIPTIONEND####
56
//
57
//=============================================================================
58
 
59
#include <cyg/hal/plf_intr.h>
60
 
61
// Special handling for additional exceptions
62
 
63
#define CYGNUM_HAL_VECTOR_TIMERS            16   // Note: must handle all 3!
64
#define CYGNUM_HAL_VECTOR_DATA_TLB_MISS     17
65
#define CYGNUM_HAL_VECTOR_INSTR_TLB_MISS    18
66
#define CYGNUM_HAL_VECTOR_DEBUG             32
67
 
68
// No 'trace'/'single step' trap on this processor
69
#define CYGNUM_HAL_NO_VECTOR_TRACE
70
 
71
#define CYGNUM_HAL_VSR_MAX                  CYGNUM_HAL_VECTOR_DEBUG
72
 
73
// Special handling for interrupts
74
 
75
#define CYGHWR_HAL_INTERRUPT_CONTROLLER_ACCESS_DEFINED
76
 
77
// Additional interrupt sources which are supported by the 40x
78
#define CYGNUM_HAL_INTERRUPT_CRITICAL         2
79
#define CYGNUM_HAL_INTERRUPT_SERIAL_RCV       3
80
#define CYGNUM_HAL_INTERRUPT_SERIAL_XMT       4
81
#define CYGNUM_HAL_INTERRUPT_JTAG_RCV         5
82
#define CYGNUM_HAL_INTERRUPT_JTAG_XMT         6
83
#define CYGNUM_HAL_INTERRUPT_DMA0             7
84
#define CYGNUM_HAL_INTERRUPT_DMA1             8
85
#define CYGNUM_HAL_INTERRUPT_DMA2             9
86
#define CYGNUM_HAL_INTERRUPT_DMA3            10
87
#define CYGNUM_HAL_INTERRUPT_EXT0            11
88
#define CYGNUM_HAL_INTERRUPT_EXT1            12
89
#define CYGNUM_HAL_INTERRUPT_EXT2            13
90
#define CYGNUM_HAL_INTERRUPT_EXT3            14
91
#define CYGNUM_HAL_INTERRUPT_EXT4            15
92
#define CYGNUM_HAL_INTERRUPT_VAR_TIMER       16
93
#define CYGNUM_HAL_INTERRUPT_FIXED_TIMER     17
94
#define CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER  18
95
 
96
#define CYGNUM_HAL_ISR_MAX                   CYGNUM_HAL_INTERRUPT_WATCHDOG_TIMER
97
 
98
//--------------------------------------------------------------------------
99
// Interrupt controller access
100
 
101
externC void hal_ppc40x_interrupt_mask(int);
102
externC void hal_ppc40x_interrupt_unmask(int);
103
externC void hal_ppc40x_interrupt_acknowledge(int);
104
externC void hal_ppc40x_interrupt_configure(int, int, int);
105
externC void hal_ppc40x_interrupt_set_level(int, int);
106
 
107
#define HAL_INTERRUPT_MASK( _vector_ )                     \
108
    hal_ppc40x_interrupt_mask( _vector_ )
109
#define HAL_INTERRUPT_UNMASK( _vector_ )                   \
110
    hal_ppc40x_interrupt_unmask( _vector_ )
111
#define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ )              \
112
    hal_ppc40x_interrupt_acknowledge( _vector_ )
113
#define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) \
114
    hal_ppc40x_interrupt_configure( _vector_, _level_, _up_ )
115
#define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ )       \
116
    hal_ppc40x_interrupt_set_level( _vector_, _level_ )
117
 
118
//--------------------------------------------------------------------------
119
// Clock control
120
 
121
externC void hal_ppc40x_clock_initialize(cyg_uint32);
122
externC void hal_ppc40x_clock_read(cyg_uint32 *);
123
externC void hal_ppc40x_clock_reset(cyg_uint32, cyg_uint32);
124
externC void hal_ppc40x_delay_us(int);
125
 
126
#define CYGHWR_HAL_CLOCK_DEFINED
127
#define HAL_CLOCK_INITIALIZE( _period_ )   hal_ppc40x_clock_initialize( _period_ )
128
#define HAL_CLOCK_RESET( _vec_, _period_ ) hal_ppc40x_clock_reset( _vec_, _period_ )
129
#define HAL_CLOCK_READ( _pvalue_ )         hal_ppc40x_clock_read( _pvalue_ )
130
#ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY
131
#define HAL_CLOCK_LATENCY( _pvalue_ )      HAL_CLOCK_READ( (cyg_uint32 *)_pvalue_ )
132
#endif
133
 
134
#define HAL_DELAY_US(n) hal_ppc40x_delay_us(n)
135
#define CYGNUM_HAL_INTERRUPT_RTC             CYGNUM_HAL_INTERRUPT_VAR_TIMER
136
 
137
//-----------------------------------------------------------------------------
138
// Symbols used by assembly code
139
#define CYGARC_VARIANT_DEFS                                                     \
140
    DEFINE(CYGNUM_HAL_VECTOR_TIMERS, CYGNUM_HAL_VECTOR_TIMERS);                 \
141
    DEFINE(CYGNUM_HAL_INTERRUPT_VAR_TIMER,CYGNUM_HAL_INTERRUPT_VAR_TIMER);
142
 
143
//-----------------------------------------------------------------------------
144
#endif // ifndef CYGONCE_VAR_INTR_H
145
// End of var_intr.h

powered by: WebSVN 2.1.0

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