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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [mips/] [mips32/] [v2_0/] [include/] [variant.inc] - Blame information for rev 289

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

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_HAL_VARIANT_INC
2
#define CYGONCE_HAL_VARIANT_INC
3
##=============================================================================
4
##
5
##      variant.inc
6
##
7
##      MIPS 32/64 family assembler header file
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):   dmoseley
46
## Contributors:        dmoseley
47
## Date:        2000-06-07
48
## Purpose:     MIPS32 family definitions.
49
## Description: This file contains various definitions and macros that are
50
##              useful for writing assembly code for the MIPS32 CPU family.
51
## Usage:
52
##              #include 
53
##              ...
54
##
55
##
56
######DESCRIPTIONEND####
57
##
58
##=============================================================================
59
 
60
#include 
61
 
62
#include 
63
 
64
#include 
65
 
66
#define CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
67
#include 
68
#include 
69
 
70
##-----------------------------------------------------------------------------
71
## Define CPU variant for architecture HAL.
72
 
73
#define CYG_HAL_MIPS_MIPS32
74
 
75
#------------------------------------------------------------------------------
76
# Cache macros.
77
 
78
#ifndef CYGPKG_HAL_MIPS_CACHE_DEFINED
79
 
80
        .macro  hal_cache_init
81
 
82
        # Setup a temporary stack pointer for running C code.
83
        la      a0,__interrupt_stack
84
        move    sp,a0
85
        CYGARC_ADDRESS_REG_UNCACHED(sp)
86
 
87
        # Read the CONFIG1 register into a0
88
        mfc0    a0, C0_CONFIG, 1
89
        nop
90
        nop
91
        nop
92
 
93
        # Jump to C-code to initialize caches (uncached)
94
        lar     k0, hal_c_cache_init
95
        CYGARC_ADDRESS_REG_UNCACHED(k0)
96
        jalr    k0
97
        nop
98
        .endm
99
 
100
#define CYGPKG_HAL_MIPS_CACHE_DEFINED
101
 
102
#endif
103
 
104
#------------------------------------------------------------------------------
105
# Monitor initialization.
106
 
107
#ifndef CYGPKG_HAL_MIPS_MON_DEFINED
108
 
109
#if     defined(CYG_HAL_STARTUP_ROM) ||                 \
110
        (       defined(CYG_HAL_STARTUP_RAM) &&         \
111
                !defined(CYGSEM_HAL_USE_ROM_MONITOR))
112
        # If we are starting up from ROM, or we are starting in
113
        # RAM and NOT using a ROM monitor, initialize the VSR table.
114
 
115
        .macro  hal_mon_init
116
        # Set default exception VSR for all vectors
117
        ori     a0,zero,16  # CYGNUM_HAL_VSR_COUNT
118
        la      a1,__default_exception_vsr
119
        la      a2,hal_vsr_table
120
1:      sw      a1,0(a2)
121
        addi    a2,a2,4
122
        addi    a0,a0,-1
123
        bne     a0,zero,1b
124
         nop
125
 
126
        # Now set special VSRs
127
        la      a0,hal_vsr_table
128
        # Set interrupt VSR
129
        la      a1,__default_interrupt_vsr
130
        sw      a1,0*4(a0)  # CYGNUM_HAL_VECTOR_INTERRUPT
131
        # Add special handler on breakpoint vector to allow GDB and
132
        # GCC to both use 'break' without conflicts.
133
        la      a1,__break_vsr_springboard
134
        sw      a1,9*4(a0)  # CYGNUM_HAL_VECTOR_BREAKPOINT
135
        # Set exception handler on special vectors
136
        # FIXME: Should use proper definitions
137
        la      a1,__default_exception_vsr
138
        sw      a1,32*4(a0)             # debug
139
        sw      a1,33*4(a0)             # utlb
140
        sw      a1,34*4(a0)             # nmi
141
        .endm
142
 
143
#elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR)
144
 
145
        # Initialize the VSR table entries
146
        # We only take control of the interrupt vector,
147
        # the rest are left to the ROM for now...
148
 
149
        .macro  hal_mon_init
150
        la      a0,__default_interrupt_vsr
151
        la      a3,hal_vsr_table
152
        sw      a0,0(a3)
153
        .endm
154
 
155
#else
156
 
157
        .macro  hal_mon_init
158
        .endm
159
 
160
#endif
161
 
162
 
163
#define CYGPKG_HAL_MIPS_MON_DEFINED
164
 
165
#endif
166
 
167
#------------------------------------------------------------------------------
168
# Decide whether the VSR table is defined externally, or is to be defined
169
# here.
170
 
171
#if defined(CYGPKG_HAL_MIPS_SIM) ||        \
172
    ( defined(CYGPKG_HAL_MIPS_ATLAS) &&    \
173
      defined(CYG_HAL_STARTUP_RAM) &&      \
174
      !defined(CYGSEM_HAL_USE_ROM_MONITOR) \
175
    )
176
 
177
## VSR table defined in linker script
178
 
179
#else
180
 
181
#define CYG_HAL_MIPS_VSR_TABLE_DEFINED
182
 
183
#endif
184
 
185
#------------------------------------------------------------------------------
186
#endif // ifndef CYGONCE_HAL_VARIANT_INC
187
# end of variant.inc

powered by: WebSVN 2.1.0

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