Mercurial > ecos-v3_0-branch
annotate packages/hal/coldfire/mcf5272/current/src/var_misc.c @ 2729:74dbf4c3f2e1 after-copyright-change-20090129
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
| author | jlarmour |
|---|---|
| date | Thu, 29 Jan 2009 17:47:46 +0000 |
| parents | a62600d0e7b5 |
| children |
| rev | line source |
|---|---|
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
1 //========================================================================== |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
2 // |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
3 // var_misc.c |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
4 // |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
5 // Miscellaneous functions specific to the processor variant |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
6 // |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
7 //========================================================================== |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
8 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
9 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
10 // This file is part of eCos, the Embedded Configurable Operating System. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc. |
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
12 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
13 // 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:
2201
diff
changeset
|
14 // 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:
2201
diff
changeset
|
15 // 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:
2201
diff
changeset
|
16 // version. |
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
17 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
18 // 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:
2201
diff
changeset
|
19 // 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:
2201
diff
changeset
|
20 // 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:
2201
diff
changeset
|
21 // for more details. |
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
22 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
23 // 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:
2201
diff
changeset
|
24 // 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:
2201
diff
changeset
|
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
26 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
27 // 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:
2201
diff
changeset
|
28 // 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:
2201
diff
changeset
|
29 // 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:
2201
diff
changeset
|
30 // 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:
2201
diff
changeset
|
31 // 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:
2201
diff
changeset
|
32 // 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:
2201
diff
changeset
|
33 // General Public License v2. |
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
34 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
35 // 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:
2201
diff
changeset
|
36 // 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:
2201
diff
changeset
|
37 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2201
diff
changeset
|
38 // ####ECOSGPLCOPYRIGHTEND#### |
|
2201
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
39 //========================================================================== |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
40 //#####DESCRIPTIONBEGIN#### |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
41 // |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
42 // Author(s): Enrico Piria |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
43 // Contributors: |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
44 // Date: 2005-25-06 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
45 // Purpose: Miscellaneous functions specific to the MCF5272 processor. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
46 // |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
47 //####DESCRIPTIONEND#### |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
48 //======================================================================== |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
49 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
50 #include <pkgconf/hal.h> |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
51 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
52 #include <cyg/infra/cyg_type.h> |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
53 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
54 #include <cyg/hal/hal_intr.h> |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
55 #include <cyg/hal/hal_arch.h> |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
56 #include <cyg/hal/hal_io.h> |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
57 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
58 #include CYGHWR_MEMORY_LAYOUT_H |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
59 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
60 // ------------------------------------------------------------------------- |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
61 // VSR table |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
62 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
63 // For the MCF5272, we can point the VBR directly to the VSR table. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
64 // However, the table must be on a 1 MB boundary. Locate the VSR table where |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
65 // the linker tells us to. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
66 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
67 volatile CYG_ADDRESS cyg_hal_vsr_table[CYGNUM_HAL_VSR_COUNT] |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
68 __attribute__ ((section (".ramvec"))); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
69 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
70 // ------------------------------------------------------------------------- |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
71 // Function prototypes |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
72 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
73 static void hal_update_interrupt_controller(int vector); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
74 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
75 // ------------------------------------------------------------------------- |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
76 // Interrupt controller management |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
77 // |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
78 // With the MCF5272 interrupt controller, it is not possible to mask an |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
79 // interrupt while retaining its associated priority. Moreover, if we enabled |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
80 // the use of interrupts with different priorities, we don't have a means to |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
81 // retrieve the priority of the current interrupt, after having raised the |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
82 // IPL to the maximum, in the first instruction of the HAL ISR handler. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
83 // So, we use an auxiliary table (cyg_hal_ILVL_table) that records all the |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
84 // priorities set for the various interrupts. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
85 // The purpose of the cyg_hal_IMASK_table table is to record wether an |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
86 // interrupt is currently masked (0) or not (1). |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
87 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
88 volatile cyg_uint8 cyg_hal_ILVL_table[CYGNUM_HAL_ISR_COUNT]; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
89 volatile cyg_uint8 cyg_hal_IMASK_table[CYGNUM_HAL_ISR_COUNT]; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
90 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
91 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
92 // Update priority table and interrupt controller |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
93 void hal_interrupt_set_level(int vector, int level) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
94 { |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
95 cyg_uint32 index; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
96 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
97 CYG_ASSERT((0 <= (level) && 7 >= (level)), "Illegal level"); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
98 CYG_ASSERT((CYGNUM_HAL_ISR_MIN <= (vector) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
99 && CYGNUM_HAL_ISR_MAX >= (vector)), "Illegal vector"); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
100 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
101 HAL_TRANSLATE_VECTOR(vector, index); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
102 cyg_hal_ILVL_table[index] = (cyg_uint8) level; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
103 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
104 hal_update_interrupt_controller(vector); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
105 } |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
106 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
107 // Update mask table and interrupt controller |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
108 void hal_interrupt_mask(int vector) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
109 { |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
110 cyg_uint32 index; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
111 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
112 CYG_ASSERT((CYGNUM_HAL_ISR_MIN <= (vector) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
113 && CYGNUM_HAL_ISR_MAX >= (vector)), "Illegal vector"); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
114 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
115 HAL_TRANSLATE_VECTOR(vector, index); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
116 cyg_hal_IMASK_table[index] = 0; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
117 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
118 hal_update_interrupt_controller(vector); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
119 } |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
120 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
121 // Update mask table and interrupt controller |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
122 void hal_interrupt_unmask(int vector) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
123 { |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
124 cyg_uint32 index; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
125 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
126 CYG_ASSERT((CYGNUM_HAL_ISR_MIN <= (vector) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
127 && CYGNUM_HAL_ISR_MAX >= (vector)), "Illegal vector"); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
128 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
129 HAL_TRANSLATE_VECTOR(vector, index); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
130 cyg_hal_IMASK_table[index] = 1; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
131 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
132 hal_update_interrupt_controller(vector); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
133 } |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
134 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
135 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
136 // Set the priority in the interrupt control register. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
137 // Disable all interrupts while we access the hardware registers. |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
138 static void hal_update_interrupt_controller(int vector) |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
139 { |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
140 cyg_uint32 index; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
141 cyg_uint8 level; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
142 cyg_uint32 vec_offset; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
143 cyg_uint32 icr, icr_msk_offset, icr_msk, icr_val, icr_oldval; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
144 CYG_INTERRUPT_STATE intr_state; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
145 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
146 HAL_TRANSLATE_VECTOR(vector, index); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
147 level = cyg_hal_IMASK_table[index] ? cyg_hal_ILVL_table[index] : 0; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
148 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
149 vec_offset = (vector) - HAL_PROG_INT_VEC_BASE - 1; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
150 icr = vec_offset / 8; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
151 icr_msk_offset = ((8-1)*4) - (vec_offset % 8) * 4; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
152 icr_msk = 0x0F << (icr_msk_offset); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
153 icr_val = (0x08 | (level & 0x07)) << icr_msk_offset; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
154 |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
155 HAL_DISABLE_INTERRUPTS(intr_state); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
156 HAL_READ_UINT32(&MCF5272_DEVS->intc.icr[icr], icr_oldval); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
157 icr_val |= icr_oldval & 0x77777777 & ~icr_msk; |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
158 HAL_WRITE_UINT32(&MCF5272_DEVS->intc.icr[icr], icr_val); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
159 HAL_RESTORE_INTERRUPTS(intr_state); |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
160 } |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
161 // ------------------------------------------------------------------------- |
|
a62600d0e7b5
Import of the new ColdFire architecture HAL and M52272C port, with
asl
parents:
diff
changeset
|
162 // End of var_misc.c |
