1 |
786 |
skrzyp |
#ifndef CYGONCE_HAL_VARIANT_INC
|
2 |
|
|
#define CYGONCE_HAL_VARIANT_INC
|
3 |
|
|
|
4 |
|
|
|==========================================================================
|
5 |
|
|
|
|
6 |
|
|
| variant.inc
|
7 |
|
|
|
|
8 |
|
|
| MCF5272 variant assembler header file
|
9 |
|
|
|
|
10 |
|
|
|==========================================================================
|
11 |
|
|
| ####ECOSGPLCOPYRIGHTBEGIN####
|
12 |
|
|
| -------------------------------------------
|
13 |
|
|
| This file is part of eCos, the Embedded Configurable Operating System.
|
14 |
|
|
| Copyright (C) 1998, 1999, 2000, 2001, 2002, 2006 Free Software Foundation, Inc.
|
15 |
|
|
|
|
16 |
|
|
| eCos is free software; you can redistribute it and/or modify it under
|
17 |
|
|
| the terms of the GNU General Public License as published by the Free
|
18 |
|
|
| Software Foundation; either version 2 or (at your option) any later
|
19 |
|
|
| version.
|
20 |
|
|
|
|
21 |
|
|
| eCos is distributed in the hope that it will be useful, but WITHOUT
|
22 |
|
|
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
23 |
|
|
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
24 |
|
|
| for more details.
|
25 |
|
|
|
|
26 |
|
|
| You should have received a copy of the GNU General Public License
|
27 |
|
|
| along with eCos; if not, write to the Free Software Foundation, Inc.,
|
28 |
|
|
| 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
29 |
|
|
|
|
30 |
|
|
| As a special exception, if other files instantiate templates or use
|
31 |
|
|
| macros or inline functions from this file, or you compile this file
|
32 |
|
|
| and link it with other works to produce a work based on this file,
|
33 |
|
|
| this file does not by itself cause the resulting work to be covered by
|
34 |
|
|
| the GNU General Public License. However the source code for this file
|
35 |
|
|
| must still be made available in accordance with section (3) of the GNU
|
36 |
|
|
| General Public License v2.
|
37 |
|
|
|
|
38 |
|
|
| This exception does not invalidate any other reasons why a work based
|
39 |
|
|
| on this file might be covered by the GNU General Public License.
|
40 |
|
|
| -------------------------------------------
|
41 |
|
|
| ####ECOSGPLCOPYRIGHTEND####
|
42 |
|
|
|=============================================================================
|
43 |
|
|
|#####DESCRIPTIONBEGIN####
|
44 |
|
|
|
|
45 |
|
|
| Author(s): Enrico Piria
|
46 |
|
|
| Contributors:
|
47 |
|
|
| Date: 2005-25-06
|
48 |
|
|
| Purpose: MCF5272 variant definitions.
|
49 |
|
|
| Description: This file contains the definitions specific to the
|
50 |
|
|
| CPU variant, used in the architecture HAL assembler file.
|
51 |
|
|
| Usage: Included by "vectors.S". Do not use directly.
|
52 |
|
|
|
|
53 |
|
|
|####DESCRIPTIONEND####
|
54 |
|
|
|==========================================================================
|
55 |
|
|
|
56 |
|
|
#include
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
| -----------------------------------------------------------------------------
|
60 |
|
|
| CPU specific macros. These provide a common assembler interface to
|
61 |
|
|
| operations that may have CPU specific implementations on different
|
62 |
|
|
| variants of the architecture.
|
63 |
|
|
|
64 |
|
|
| CPU initialization macro
|
65 |
|
|
.macro hal_cpu_init
|
66 |
|
|
|
67 |
|
|
| Invalidate and disable the cache and ACRs.
|
68 |
|
|
move.l #0x01000000,%d0
|
69 |
|
|
movec %d0,%cacr
|
70 |
|
|
|
71 |
|
|
move.l #0x0,%d0
|
72 |
|
|
movec %d0,%acr0
|
73 |
|
|
movec %d0,%acr1
|
74 |
|
|
.endm
|
75 |
|
|
|
76 |
|
|
|
77 |
|
|
| ----------------------------------------------------------------------------
|
78 |
|
|
| This macro retrieves the IPL of the current interrupt from the
|
79 |
|
|
| interrupt controller register. This is needed because on inetrrupt entry
|
80 |
|
|
| all interrupts are disabled by writing to the status register, and thus
|
81 |
|
|
| loosing the current IPL.
|
82 |
|
|
| Input: interrupt vector number in d0
|
83 |
|
|
| Output: IPL associated to interrupt in d0
|
84 |
|
|
|
85 |
|
|
.macro hal_variant_retrieve_ipl
|
86 |
|
|
|
87 |
|
|
| Subtract minimum interrupt vector number
|
88 |
|
|
sub.l #CYGNUM_HAL_ISR_MIN,%d0
|
89 |
|
|
|
90 |
|
|
| Load IPL table address in a0
|
91 |
|
|
lea cyg_hal_ILVL_table,%a0
|
92 |
|
|
|
93 |
|
|
| Retrieve IPL level for current interrupt
|
94 |
|
|
move.b (%a0,%d0.l),%d0
|
95 |
|
|
|
96 |
|
|
.endm
|
97 |
|
|
|
98 |
|
|
| ----------------------------------------------------------------------------
|
99 |
|
|
| end of variant.inc
|
100 |
|
|
#endif // ifndef CYGONCE_HAL_VARIANT_INC
|