Mercurial > ecos
annotate packages/hal/powerpc/arch/current/include/hal_intr.h @ 3292:7f8e529b4d82 default tip
Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
| author | vae |
|---|---|
| date | Wed, 29 Apr 2015 23:31:48 +0000 |
| parents | 842a82a508f3 |
| children |
| rev | line source |
|---|---|
| 0 | 1 #ifndef CYGONCE_HAL_INTR_H |
| 2 #define CYGONCE_HAL_INTR_H | |
| 3 | |
| 2 | 4 //========================================================================== |
| 0 | 5 // |
| 6 // hal_intr.h | |
| 7 // | |
| 8 // HAL Interrupt and clock support | |
| 9 // | |
| 2 | 10 //========================================================================== |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
11 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
12 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
13 // This file is part of eCos, the Embedded Configurable Operating System. |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
14 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007 Free Software Foundation, Inc. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
136
diff
changeset
|
15 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
16 // eCos is free software; you can redistribute it and/or modify it under |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
17 // the terms of the GNU General Public License as published by the Free |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
18 // Software Foundation; either version 2 or (at your option) any later |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
19 // version. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
136
diff
changeset
|
20 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
21 // eCos is distributed in the hope that it will be useful, but WITHOUT |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
22 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
23 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
24 // for more details. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
136
diff
changeset
|
25 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
26 // You should have received a copy of the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
27 // along with eCos; if not, write to the Free Software Foundation, Inc., |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
28 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
136
diff
changeset
|
29 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
30 // As a special exception, if other files instantiate templates or use |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
31 // macros or inline functions from this file, or you compile this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
32 // and link it with other works to produce a work based on this file, |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
33 // this file does not by itself cause the resulting work to be covered by |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
34 // the GNU General Public License. However the source code for this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
35 // must still be made available in accordance with section (3) of the GNU |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
36 // General Public License v2. |
|
208
e0c0827131d1
Merge from eCos master repository on 2002-05-20-20:11:54-BST
jlarmour
parents:
136
diff
changeset
|
37 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
38 // This exception does not invalidate any other reasons why a work based |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
39 // on this file might be covered by the GNU General Public License. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
40 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
1441
diff
changeset
|
41 // ####ECOSGPLCOPYRIGHTEND#### |
| 2 | 42 //========================================================================== |
| 0 | 43 //#####DESCRIPTIONBEGIN#### |
| 44 // | |
| 2 | 45 // Author(s): nickg |
| 46 // Contributors: nickg, jskov, | |
| 47 // jlarmour | |
| 48 // Date: 1999-02-19 | |
| 49 // Purpose: Define Interrupt support | |
| 50 // Description: The macros defined here provide the HAL APIs for handling | |
| 51 // interrupts and the clock. | |
| 0 | 52 // |
| 53 // Usage: | |
| 2 | 54 // #include <cyg/hal/hal_intr.h> |
| 55 // ... | |
| 0 | 56 // |
| 57 // | |
| 58 //####DESCRIPTIONEND#### | |
| 59 // | |
| 2 | 60 //========================================================================== |
| 0 | 61 |
| 62 #include <pkgconf/hal.h> | |
| 63 | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
64 #include <cyg/infra/cyg_type.h> // types |
| 0 | 65 |
| 2 | 66 #include <cyg/hal/ppc_regs.h> // register definitions |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
67 |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
68 #include <cyg/hal/var_intr.h> // variant extensions |
| 2 | 69 |
| 70 //-------------------------------------------------------------------------- | |
| 71 // PowerPC exception vectors. These correspond to VSRs and are the values | |
| 72 // to use for HAL_VSR_GET/SET | |
| 73 | |
| 74 #define CYGNUM_HAL_VECTOR_RESERVED_0 0 | |
| 75 #define CYGNUM_HAL_VECTOR_RESET 1 | |
| 76 #define CYGNUM_HAL_VECTOR_MACHINE_CHECK 2 | |
| 77 #define CYGNUM_HAL_VECTOR_DSI 3 | |
| 78 #define CYGNUM_HAL_VECTOR_ISI 4 | |
| 79 #define CYGNUM_HAL_VECTOR_INTERRUPT 5 | |
| 80 #define CYGNUM_HAL_VECTOR_ALIGNMENT 6 | |
| 81 #define CYGNUM_HAL_VECTOR_PROGRAM 7 | |
| 82 #define CYGNUM_HAL_VECTOR_FP_UNAVAILABLE 8 | |
| 83 #define CYGNUM_HAL_VECTOR_DECREMENTER 9 | |
| 84 #define CYGNUM_HAL_VECTOR_RESERVED_A 10 | |
| 85 #define CYGNUM_HAL_VECTOR_RESERVED_B 11 | |
| 86 #define CYGNUM_HAL_VECTOR_SYSTEM_CALL 12 | |
| 87 #define CYGNUM_HAL_VECTOR_TRACE 13 | |
| 88 #define CYGNUM_HAL_VECTOR_FP_ASSIST 14 | |
| 89 | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
90 #ifdef CYGHWR_HAL_POWERPC_BOOK_E |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
91 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
92 // Additional exceptions on Book E CPUs. The numbers here do not |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
93 // necessarily correspond to the IVOR register number for the |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
94 // exception, but they must correspond to the table position in the |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
95 // rom_vectors table defined in vectors.S. |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
96 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
97 #define CYGNUM_HAL_VECTOR_RESERVED_F 15 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
98 #define CYGNUM_HAL_VECTOR_CRITICAL_INPUT 16 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
99 #define CYGNUM_HAL_VECTOR_AP_UNAVAILABLE 17 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
100 #define CYGNUM_HAL_VECTOR_FIT 18 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
101 #define CYGNUM_HAL_VECTOR_WATCHDOG 19 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
102 #define CYGNUM_HAL_VECTOR_DTLB_MISS 20 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
103 #define CYGNUM_HAL_VECTOR_ITLB_MISS 21 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
104 #define CYGNUM_HAL_VECTOR_DEBUG 22 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
105 #define CYGNUM_HAL_VECTOR_SPE_UNAVAILABLE 23 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
106 #define CYGNUM_HAL_VECTOR_SPE_FP_DATA 24 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
107 #define CYGNUM_HAL_VECTOR_SPE_FP_ROUND 25 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
108 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
109 #ifndef CYGNUM_HAL_VSR_MAX |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
110 #define CYGNUM_HAL_VSR_MAX CYGNUM_HAL_VECTOR_SPE_FP_ROUND |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
111 #endif |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
112 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
113 #endif |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
114 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
115 |
| 2 | 116 #define CYGNUM_HAL_VSR_MIN CYGNUM_HAL_VECTOR_RESERVED_0 |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
117 #ifndef CYGNUM_HAL_VSR_MAX |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
118 # define CYGNUM_HAL_VSR_MAX CYGNUM_HAL_VECTOR_FP_ASSIST |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
119 #endif |
| 2 | 120 #define CYGNUM_HAL_VSR_COUNT ( CYGNUM_HAL_VSR_MAX + 1 ) |
| 121 | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
122 #ifndef CYG_VECTOR_IS_INTERRUPT |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
123 # define CYG_VECTOR_IS_INTERRUPT(v) \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
124 (CYGNUM_HAL_VECTOR_INTERRUPT == (v) \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
125 || CYGNUM_HAL_VECTOR_DECREMENTER == (v)) |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
126 #endif |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
127 |
| 2 | 128 // The decoded interrupts. |
| 129 // Define decrementer as the first interrupt since it is guaranteed to | |
| 130 // be defined on all PowerPCs. External may expand into several interrupts | |
| 131 // depending on interrupt controller capabilities. | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
132 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
133 #ifndef CYGHWR_HAL_POWERPC_BOOK_E |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
134 |
| 2 | 135 #define CYGNUM_HAL_INTERRUPT_DECREMENTER 0 |
| 136 #define CYGNUM_HAL_INTERRUPT_EXTERNAL 1 | |
| 137 | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
138 #else |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
139 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
140 // For Book E processors, in addition the the decrementer, there are |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
141 // also a fixed interval timer and a watchdog which can generate |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
142 // asynchronous interrupts. |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
143 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
144 #define CYGNUM_HAL_INTERRUPT_DECREMENTER 0 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
145 #define CYGNUM_HAL_INTERRUPT_INTERVAL 1 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
146 #define CYGNUM_HAL_INTERRUPT_WATCHDOG 2 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
147 #define CYGNUM_HAL_INTERRUPT_EXTERNAL 3 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
148 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
149 #endif |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
150 |
| 2 | 151 #define CYGNUM_HAL_ISR_MIN CYGNUM_HAL_INTERRUPT_DECREMENTER |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
152 #ifndef CYGNUM_HAL_ISR_MAX |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
153 # define CYGNUM_HAL_ISR_MAX CYGNUM_HAL_INTERRUPT_EXTERNAL |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
154 #endif |
| 2 | 155 #define CYGNUM_HAL_ISR_COUNT ( CYGNUM_HAL_ISR_MAX + 1 ) |
| 156 | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
157 #ifndef CYGHWR_HAL_EXCEPTION_VECTORS_DEFINED |
| 2 | 158 // Exception vectors. These are the values used when passed out to an |
| 159 // external exception handler using cyg_hal_deliver_exception() | |
| 0 | 160 |
| 2 | 161 #define CYGNUM_HAL_EXCEPTION_RESERVED_0 CYGNUM_HAL_VECTOR_RESERVED_0 |
| 162 #define CYGNUM_HAL_EXCEPTION_MACHINE_CHECK CYGNUM_HAL_VECTOR_MACHINE_CHECK | |
| 163 #define CYGNUM_HAL_EXCEPTION_DATA_ACCESS CYGNUM_HAL_VECTOR_DSI | |
| 164 #define CYGNUM_HAL_EXCEPTION_CODE_ACCESS CYGNUM_HAL_VECTOR_ISI | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
165 #define CYGNUM_HAL_EXCEPTION_DATA_UNALIGNED_ACCESS CYGNUM_HAL_VECTOR_ALIGNMENT |
| 2 | 166 #define CYGNUM_HAL_EXCEPTION_FPU_NOT_AVAIL CYGNUM_HAL_VECTOR_FP_UNAVAILABLE |
| 167 #define CYGNUM_HAL_EXCEPTION_RESERVED_A CYGNUM_HAL_VECTOR_RESERVED_A | |
| 168 #define CYGNUM_HAL_EXCEPTION_RESERVED_B CYGNUM_HAL_VECTOR_RESERVED_B | |
| 169 #define CYGNUM_HAL_EXCEPTION_SYSTEM_CALL CYGNUM_HAL_VECTOR_SYSTEM_CALL | |
| 170 #define CYGNUM_HAL_EXCEPTION_TRACE CYGNUM_HAL_VECTOR_TRACE | |
| 171 #define CYGNUM_HAL_EXCEPTION_FP_ASSIST CYGNUM_HAL_VECTOR_FP_ASSIST | |
| 172 | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
173 #ifdef CYGHWR_HAL_POWERPC_BOOK_E |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
174 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
175 #define CYGNUM_HAL_EXCEPTION_RESERVED_F CYGNUM_HAL_VECTOR_RESERVED_F |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
176 #define CYGNUM_HAL_EXCEPTION_CRITICAL_INPUT CYGNUM_HAL_VECTOR_CRITICAL_INPUT |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
177 #define CYGNUM_HAL_EXCEPTION_AP_UNAVAILABLE CYGNUM_HAL_VECTOR_AP_UNAVAILABLE |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
178 #define CYGNUM_HAL_EXCEPTION_FIT CYGNUM_HAL_VECTOR_FIT |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
179 #define CYGNUM_HAL_EXCEPTION_WATCHDOG CYGNUM_HAL_VECTOR_WATCHDOG |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
180 #define CYGNUM_HAL_EXCEPTION_DTLB_MISS CYGNUM_HAL_VECTOR_DTLB_MISS |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
181 #define CYGNUM_HAL_EXCEPTION_ITLB_MISS CYGNUM_HAL_VECTOR_ITLB_MISS |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
182 #define CYGNUM_HAL_EXCEPTION_DEBUG CYGNUM_HAL_VECTOR_DEBUG |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
183 #define CYGNUM_HAL_EXCEPTION_SPE_UNAVAILABLE CYGNUM_HAL_VECTOR_SPE_UNAVAILABLE |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
184 #define CYGNUM_HAL_EXCEPTION_SPE_FP_DATA CYGNUM_HAL_VECTOR_SPE_FP_DATA |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
185 #define CYGNUM_HAL_EXCEPTION_SPE_FP_ROUND CYGNUM_HAL_VECTOR_SPE_FP_ROUND |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
186 |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
187 #endif |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
188 |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
189 #define CYGNUM_HAL_EXCEPTION_MIN CYGNUM_HAL_EXCEPTION_RESERVED_0 |
| 473 | 190 #ifndef CYGNUM_HAL_EXCEPTION_MAX |
| 191 #define CYGNUM_HAL_EXCEPTION_MAX CYGNUM_HAL_VSR_MAX | |
| 192 #endif | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
193 |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
194 #define CYGHWR_HAL_EXCEPTION_VECTORS_DEFINED |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
195 |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
196 #endif // CYGHWR_HAL_EXCEPTION_VECTORS_DEFINED |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
197 |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
198 #ifndef CYGHWR_HAL_POWERPC_BOOK_E |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
199 // FIXME: This is still rather ugly. Should probably be made variant |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
200 // specific using a decode_hal_exception macro or somesuch. |
| 2 | 201 // decoded exception vectors |
| 202 #define CYGNUM_HAL_EXCEPTION_TRAP (-1) | |
| 203 #define CYGNUM_HAL_EXCEPTION_PRIVILEGED_INSTRUCTION (-2) | |
| 204 #define CYGNUM_HAL_EXCEPTION_ILLEGAL_INSTRUCTION (-3) | |
| 205 #define CYGNUM_HAL_EXCEPTION_FPU (-4) | |
| 206 | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
207 #undef CYGNUM_HAL_EXCEPTION_MIN |
| 2 | 208 #define CYGNUM_HAL_EXCEPTION_MIN CYGNUM_HAL_EXCEPTION_FPU |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
209 #endif |
| 2 | 210 |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
211 #define CYGNUM_HAL_EXCEPTION_COUNT \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
212 ( CYGNUM_HAL_EXCEPTION_MAX - CYGNUM_HAL_EXCEPTION_MIN + 1 ) |
| 0 | 213 |
| 2 | 214 //-------------------------------------------------------------------------- |
| 0 | 215 // Static data used by HAL |
| 216 | |
| 217 // ISR tables | |
| 2 | 218 externC volatile CYG_ADDRESS hal_interrupt_handlers[CYGNUM_HAL_ISR_COUNT]; |
| 219 externC volatile CYG_ADDRWORD hal_interrupt_data[CYGNUM_HAL_ISR_COUNT]; | |
| 220 externC volatile CYG_ADDRESS hal_interrupt_objects[CYGNUM_HAL_ISR_COUNT]; | |
| 221 // VSR table | |
| 222 externC volatile CYG_ADDRESS hal_vsr_table[CYGNUM_HAL_VSR_COUNT]; | |
| 0 | 223 |
| 2 | 224 //-------------------------------------------------------------------------- |
|
14
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
225 // Default ISRs |
|
101
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
80
diff
changeset
|
226 // The #define is used to test whether this routine exists, and to allow |
|
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
80
diff
changeset
|
227 // us to call it. |
| 0 | 228 |
| 229 externC cyg_uint32 hal_default_isr(CYG_ADDRWORD vector, CYG_ADDRWORD data); | |
|
14
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
230 externC cyg_uint32 hal_default_decrementer_isr(CYG_ADDRWORD vector, |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
231 CYG_ADDRWORD data); |
| 0 | 232 |
|
101
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
80
diff
changeset
|
233 #define HAL_DEFAULT_ISR hal_default_isr |
|
c37d3a9e1b28
Merge from eCos master repository on 2000-06-16-07:47:03-BST
jlarmour
parents:
80
diff
changeset
|
234 |
| 2 | 235 //-------------------------------------------------------------------------- |
| 0 | 236 // Interrupt state storage |
| 237 | |
| 238 typedef cyg_uint32 CYG_INTERRUPT_STATE; | |
| 239 | |
| 2 | 240 //-------------------------------------------------------------------------- |
| 0 | 241 // Interrupt control macros |
| 242 | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
243 #if !defined(CYGHWR_HAL_POWERPC_BOOK_E) |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
244 #define CYGARC_REG_MSR_INTBITS CYGARC_REG_MSR_EE |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
245 #else |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
246 #define CYGARC_REG_MSR_INTBITS (CYGARC_REG_MSR_EE|CYGARC_REG_MSR_CE) |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
247 #endif |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
248 |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
249 #define HAL_DISABLE_INTERRUPTS(_old_) \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
250 CYG_MACRO_START \ |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
251 cyg_uint32 tmp1 = ~CYGARC_REG_MSR_INTBITS; \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
252 cyg_uint32 tmp2; \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
253 asm volatile ( \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
254 "mfmsr %0;" \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
255 "mr %2,%0;" \ |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
256 "and %2,%2,%1;" \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
257 "mtmsr %2;" \ |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
258 : "=r"(_old_), "+r" (tmp1), "=r" (tmp2)); \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
259 CYG_MACRO_END |
| 0 | 260 |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
261 #define HAL_ENABLE_INTERRUPTS() \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
262 CYG_MACRO_START \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
263 cyg_uint32 tmp1; \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
264 cyg_uint32 tmp2 = CYGARC_REG_MSR_INTBITS; \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
265 asm volatile ( \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
266 "mfmsr %0;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
267 "or %0,%0,%1;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
268 "mtmsr %0;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
269 : "=r" (tmp1), "+r" (tmp2)); \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
270 CYG_MACRO_END |
| 0 | 271 |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
272 #define HAL_RESTORE_INTERRUPTS(_old_) \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
273 CYG_MACRO_START \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
274 cyg_uint32 tmp1; \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
275 cyg_uint32 tmp2 = ~CYGARC_REG_MSR_INTBITS; \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
276 asm volatile ( \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
277 "mfmsr %0;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
278 "and %0,%0,%1;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
279 "not %1,%1;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
280 "and %1,%1,%2;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
281 "or %0,%0,%1;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
282 "mtmsr %0;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
283 : "=&r" (tmp1), "+r" (tmp2) \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
284 : "r" (_old_)); \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
285 CYG_MACRO_END |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
286 |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
287 #define HAL_QUERY_INTERRUPTS(_old_) \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
288 CYG_MACRO_START \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
289 cyg_uint32 tmp = CYGARC_REG_MSR_INTBITS; \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
290 asm volatile ( \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
291 "mfmsr %0;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
292 "and %0,%0,%1;" \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
293 : "=&r"(_old_) \ |
|
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
294 : "r" (tmp)); \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
295 CYG_MACRO_END |
| 0 | 296 |
| 2 | 297 //-------------------------------------------------------------------------- |
| 1441 | 298 // Machine check manipulation |
| 299 #define HAL_DISABLE_MACHINE_CHECK(_old_) \ | |
| 300 CYG_MACRO_START \ | |
| 301 cyg_uint32 tmp1, tmp2; \ | |
| 302 asm volatile ( \ | |
| 303 "mfmsr %0;" \ | |
| 304 "mr %2,%0;" \ | |
| 305 "li %1,0;" \ | |
| 306 "rlwimi %2,%1,0,19,19;" \ | |
| 307 "mtmsr %2;" \ | |
| 308 : "=r"(_old_), "=r" (tmp1), "=r" (tmp2)); \ | |
| 309 CYG_MACRO_END | |
| 310 | |
| 311 #define HAL_ENABLE_MACHINE_CHECK() \ | |
| 312 CYG_MACRO_START \ | |
| 313 cyg_uint32 tmp1, tmp2; \ | |
| 314 asm volatile ( \ | |
| 315 "mfmsr %0;" \ | |
| 316 "lis %1,%1,0x0001;" \ | |
| 317 "rlwimi %0,%1,0,19,19;" \ | |
| 318 "mtmsr %0;" \ | |
| 319 : "=r" (tmp1), "=r" (tmp2)); \ | |
| 320 CYG_MACRO_END | |
| 321 | |
| 322 #define HAL_QUERY_MACHINE_CHECK(_old_) \ | |
| 323 CYG_MACRO_START \ | |
| 324 cyg_uint32 tmp; \ | |
| 325 asm volatile ( \ | |
| 326 "mfmsr %0;" \ | |
| 327 "lis %1,0x0001;" \ | |
| 328 "and %0,%0,%1;" \ | |
| 329 : "=&r"(_old_), "=r" (tmp)); \ | |
| 330 CYG_MACRO_END | |
| 331 | |
| 332 //-------------------------------------------------------------------------- | |
| 0 | 333 // Vector translation. |
| 2 | 334 |
| 335 #ifndef HAL_TRANSLATE_VECTOR | |
| 336 // Basic PowerPC configuration only has two vectors; decrementer and | |
| 337 // external. Isr tables/chaining use same vector decoder. | |
| 338 #define HAL_TRANSLATE_VECTOR(_vector_,_index_) \ | |
| 339 (_index_) = (_vector_) | |
| 340 #endif | |
| 0 | 341 |
| 2 | 342 //-------------------------------------------------------------------------- |
|
8
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
343 #ifdef CYGIMP_HAL_COMMON_INTERRUPTS_USE_INTERRUPT_STACK |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
344 |
|
10
d3fbcdfa1b2f
Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents:
8
diff
changeset
|
345 externC void hal_interrupt_stack_call_pending_DSRs(void); |
|
d3fbcdfa1b2f
Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents:
8
diff
changeset
|
346 #define HAL_INTERRUPT_STACK_CALL_PENDING_DSRS() \ |
|
d3fbcdfa1b2f
Merge from eCos master repository on 1999-05-29-00:13:11-BST
jlarmour
parents:
8
diff
changeset
|
347 hal_interrupt_stack_call_pending_DSRs() |
|
8
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
348 |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
349 // these are offered solely for stack usage testing |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
350 // if they are not defined, then there is no interrupt stack. |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
351 #define HAL_INTERRUPT_STACK_BASE cyg_interrupt_stack_base |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
352 #define HAL_INTERRUPT_STACK_TOP cyg_interrupt_stack |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
353 // use them to declare these extern however you want: |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
354 // extern char HAL_INTERRUPT_STACK_BASE[]; |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
355 // extern char HAL_INTERRUPT_STACK_TOP[]; |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
356 // is recommended |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
357 #endif |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
358 |
|
ece80412419a
Merge from eCos master repository on 1999-05-21-22:05:54-BST
jlarmour
parents:
2
diff
changeset
|
359 //-------------------------------------------------------------------------- |
| 2 | 360 // Interrupt and VSR attachment macros |
| 0 | 361 |
|
14
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
362 #define HAL_INTERRUPT_IN_USE( _vector_, _state_) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
363 CYG_MACRO_START \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
364 cyg_uint32 _index_; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
365 HAL_TRANSLATE_VECTOR ((_vector_), _index_); \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
366 \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
367 if((hal_interrupt_handlers[_index_] \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
368 == (CYG_ADDRESS)hal_default_decrementer_isr) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
369 || (hal_interrupt_handlers[_index_] == (CYG_ADDRESS)hal_default_isr)) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
370 (_state_) = 0; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
371 else \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
372 (_state_) = 1; \ |
| 2 | 373 CYG_MACRO_END |
| 0 | 374 |
|
14
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
375 #define HAL_INTERRUPT_ATTACH( _vector_, _isr_, _data_, _object_ ) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
376 CYG_MACRO_START \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
377 cyg_uint32 _index_; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
378 HAL_TRANSLATE_VECTOR ((_vector_), _index_); \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
379 \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
380 if((hal_interrupt_handlers[_index_] \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
381 == (CYG_ADDRESS)hal_default_decrementer_isr) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
382 || (hal_interrupt_handlers[_index_] == (CYG_ADDRESS)hal_default_isr)) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
383 { \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
384 hal_interrupt_handlers[_index_] = (CYG_ADDRESS)_isr_; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
385 hal_interrupt_data[_index_] = (CYG_ADDRWORD) _data_; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
386 hal_interrupt_objects[_index_] = (CYG_ADDRESS)_object_; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
387 } \ |
| 0 | 388 CYG_MACRO_END |
| 389 | |
|
14
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
390 #define HAL_INTERRUPT_DETACH( _vector_, _isr_ ) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
391 CYG_MACRO_START \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
392 cyg_uint32 _index_; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
393 HAL_TRANSLATE_VECTOR ((_vector_), _index_); \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
394 \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
395 if( hal_interrupt_handlers[_index_] == (CYG_ADDRESS)_isr_ ) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
396 { \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
397 if (CYGNUM_HAL_INTERRUPT_DECREMENTER == (_vector_)) \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
398 hal_interrupt_handlers[_index_] = \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
399 (CYG_ADDRESS)hal_default_decrementer_isr; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
400 else \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
401 hal_interrupt_handlers[_index_] = (CYG_ADDRESS)hal_default_isr; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
402 hal_interrupt_data[_index_] = 0; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
403 hal_interrupt_objects[_index_] = 0; \ |
|
01ce82f3e11a
Merge from eCos master repository on 1999-06-11-17:05:41-BST
jlarmour
parents:
10
diff
changeset
|
404 } \ |
| 0 | 405 CYG_MACRO_END |
| 406 | |
| 407 #define HAL_VSR_GET( _vector_, _pvsr_ ) \ | |
| 408 *(CYG_ADDRESS *)(_pvsr_) = hal_vsr_table[_vector_]; | |
| 409 | |
| 410 | |
| 411 #define HAL_VSR_SET( _vector_, _vsr_, _poldvsr_ ) \ | |
| 412 CYG_MACRO_START \ | |
| 413 if( _poldvsr_ != NULL ) \ | |
| 414 *(CYG_ADDRESS *)_poldvsr_ = hal_vsr_table[_vector_]; \ | |
| 415 hal_vsr_table[_vector_] = (CYG_ADDRESS)_vsr_; \ | |
| 416 CYG_MACRO_END | |
| 417 | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
418 // This is an ugly name, but what it means is: grab the VSR back to eCos |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
419 // internal handling, or if you like, the default handler. But if |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
420 // cooperating with GDB and CygMon, the default behaviour is to pass most |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
421 // exceptions to CygMon. This macro undoes that so that eCos handles the |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
422 // exception. So use it with care. |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
423 externC void cyg_hal_default_interrupt_vsr( void ); |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
424 externC void cyg_hal_default_exception_vsr( void ); |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
425 #define HAL_VSR_SET_TO_ECOS_HANDLER( _vector_, _poldvsr_ ) \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
426 CYG_MACRO_START \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
427 if( (void*)_poldvsr_ != (void*)NULL ) \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
428 *(CYG_ADDRESS *)_poldvsr_ = hal_vsr_table[_vector_]; \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
429 hal_vsr_table[_vector_] = ( CYG_VECTOR_IS_INTERRUPT( _vector_ ) \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
430 ? (CYG_ADDRESS)cyg_hal_default_interrupt_vsr \ |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
431 : (CYG_ADDRESS)cyg_hal_default_exception_vsr ); \ |
| 2 | 432 CYG_MACRO_END |
| 433 | |
| 434 | |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
435 #ifndef CYGHWR_HAL_INTERRUPT_CONTROLLER_ACCESS_DEFINED |
| 0 | 436 |
| 437 #define HAL_INTERRUPT_MASK( _vector_ ) | |
| 438 | |
| 439 #define HAL_INTERRUPT_UNMASK( _vector_ ) | |
| 440 | |
| 441 #define HAL_INTERRUPT_ACKNOWLEDGE( _vector_ ) | |
| 442 | |
| 443 #define HAL_INTERRUPT_CONFIGURE( _vector_, _level_, _up_ ) | |
| 444 | |
| 445 #define HAL_INTERRUPT_SET_LEVEL( _vector_, _level_ ) | |
| 446 | |
| 2 | 447 #endif |
| 448 | |
| 449 //-------------------------------------------------------------------------- | |
| 0 | 450 // Clock control |
| 451 | |
|
136
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
452 #ifndef CYGHWR_HAL_CLOCK_DEFINED |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
453 // Note: variant or platform allowed to override these definitions |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
454 |
| 0 | 455 #define HAL_CLOCK_INITIALIZE( _period_ ) \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
456 CYG_MACRO_START \ |
| 0 | 457 asm volatile ( \ |
| 458 "mtdec %0;" \ | |
| 459 : \ | |
| 2 | 460 : "r"(_period_) \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
461 ); \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
462 CYG_MACRO_END |
| 0 | 463 |
| 464 #define HAL_CLOCK_RESET( _vector_, _period_ ) \ | |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
465 CYG_MACRO_START \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
466 cyg_uint32 tmp; \ |
| 0 | 467 asm volatile ( \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
468 "mfdec %0;" \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
469 "add. %0,%0,%1;" \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
470 "bgt 1f;" \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
471 "mr %0,%1;" \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
472 "1: mtdec %0;" \ |
|
80
2085233a121a
Merge from eCos master repository on 2000-04-07-07:52:29-BST
jlarmour
parents:
76
diff
changeset
|
473 : "=&r" (tmp) \ |
| 2 | 474 : "r"(_period_) \ |
|
76
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
475 : "cc" \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
476 ); \ |
|
435cced73e2f
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
jlarmour
parents:
70
diff
changeset
|
477 CYG_MACRO_END |
| 0 | 478 |
| 479 #define HAL_CLOCK_READ( _pvalue_ ) \ | |
| 480 CYG_MACRO_START \ | |
| 481 register cyg_uint32 result; \ | |
| 482 asm volatile( \ | |
| 483 "mfdec %0;" \ | |
| 484 : "=r"(result) \ | |
| 485 ); \ | |
|
2883
842a82a508f3
Add Book E architecture support. See the ChangeLog for full details.
nickg
parents:
2729
diff
changeset
|
486 *(_pvalue_) = CYGNUM_HAL_RTC_PERIOD-result; \ |
| 0 | 487 CYG_MACRO_END |
| 488 | |
| 2 | 489 #ifdef CYGVAR_KERNEL_COUNTERS_CLOCK_LATENCY |
| 490 #define HAL_CLOCK_LATENCY( _pvalue_ ) \ | |
| 491 CYG_MACRO_START \ | |
| 492 register cyg_int32 result; \ | |
| 493 asm volatile( \ | |
| 494 "mfdec %0;" \ | |
| 495 : "=r"(result) \ | |
| 496 ); \ | |
| 497 /* Pending DEC interrupts cannot be discarded. If dec is */ \ | |
| 498 /* positive it''s because a DEC interrupt occured while */ \ | |
| 499 /* eCos was getting ready to run. Just return 0 in that */ \ | |
| 500 /* case. */ \ | |
| 501 if (result > 0) \ | |
| 502 result = 0; \ | |
| 503 *(_pvalue_) = -result; \ | |
| 504 CYG_MACRO_END | |
| 505 #endif | |
| 506 | |
| 473 | 507 #ifndef HAL_DELAY_US |
| 1418 | 508 externC void hal_delay_us(int); |
|
130
eb9fd8c04db3
Merge from eCos master repository on 2000-10-23-17:01:37-BST
jlarmour
parents:
101
diff
changeset
|
509 #define HAL_DELAY_US(n) hal_delay_us(n) |
| 473 | 510 #endif |
|
130
eb9fd8c04db3
Merge from eCos master repository on 2000-10-23-17:01:37-BST
jlarmour
parents:
101
diff
changeset
|
511 |
|
136
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
512 // The vector used by the Real time clock |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
513 #ifndef CYGNUM_HAL_INTERRUPT_RTC |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
514 #define CYGNUM_HAL_INTERRUPT_RTC CYGNUM_HAL_INTERRUPT_DECREMENTER |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
515 #endif // CYGNUM_HAL_INTERRUPT_RTC |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
516 |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
517 #endif // CYGHWR_HAL_CLOCK_DEFINED |
|
a9ac27ec7abc
Merge from eCos master repository on 2000-11-17-18:24:25-GMT
jlarmour
parents:
130
diff
changeset
|
518 |
| 2 | 519 //-------------------------------------------------------------------------- |
|
70
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
520 // Variant functions |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
521 externC void hal_variant_IRQ_init(void); |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
522 |
|
c5536bad4c24
Merge from eCos master repository on 2000-02-11-15:46:40-GMT
jlarmour
parents:
68
diff
changeset
|
523 //-------------------------------------------------------------------------- |
| 0 | 524 #endif // ifndef CYGONCE_HAL_INTR_H |
| 525 // End of hal_intr.h |
