1 #ifndef __ASM_SH64_REGISTERS_H
2 #define __ASM_SH64_REGISTERS_H
5 * This file is subject to the terms and conditions of the GNU General Public
6 * License. See the file "COPYING" in the main directory of this archive
9 * include/asm-sh64/registers.h
11 * Copyright (C) 2000, 2001 Paolo Alberelli
16 /* =====================================================================
18 ** Section 1: acts on assembly sources pre-processed by GPP ( <source.S>).
19 ** Assigns symbolic names to control & target registers.
23 * Concerning registers name, the assembly sources follows the
24 * CDC naming convention.
25 * This section converts CDC registers names into RedHat style.
45 /* cr14-cr15 UNDEFINED */
49 /* cr19-cr31 UNDEFINED */
50 /* cr32-cr61 RESERVED */
55 * ABI dependent registers (general purpose set)
56 * Note: this set of registers name could be shared by the
57 * CDC and RedHat toolchain
75 * Target registers need name convertion...
76 * (defines only those used by assembly code)
88 ** RedHat style compatibility macros:
90 ** _loada: loads the address the address of the symbol (first
91 ** argument) into the general purpose register (second
94 .macro _loada symbol, gp_reg
98 .macro _ptar symbol, tr_reg
102 .macro _ptaru symbol, tr_reg
103 pt/u \symbol, \tr_reg
106 .macro _pta disp_b, tr_reg
107 pta $+\disp_b, \tr_reg
111 * Status register defines: used only by assembly sources (and
112 * syntax independednt)
114 #define SR_RESET_VAL 0x0000000050008000
115 #define SR_HARMLESS 0x00000000500080f0 /* Write ignores for most */
116 #define SR_ENABLE_FPU 0xffffffffffff7fff /* AND with this */
118 #if defined (CONFIG_SH64_SR_WATCH)
119 #define SR_ENABLE_MMU 0x0000000084000000 /* OR with this */
121 #define SR_ENABLE_MMU 0x0000000080000000 /* OR with this */
124 #define SR_UNBLOCK_EXC 0xffffffffefffffff /* AND with this */
125 #define SR_BLOCK_EXC 0x0000000010000000 /* OR with this */
127 #else /* Not __ASSEMBLY__ syntax */
129 /* =====================================================================
131 ** Section 2: this is required to manage __asm__ statement expanded
135 ** RedHat style symbolic address resolution inside "asm" blocks
137 asm ("\t.macro _loada symbol, gp_reg\n"
138 "\tmovi \\symbol, \\gp_reg\n"
141 "\t.macro _ptar symbol, tr_reg\n"
142 "\tpt \\symbol, \\tr_reg\n"
145 "\t.macro _pta disp_b, tr_reg\n"
146 "\tpta $+\\disp_b, \\tr_reg\n"
149 "\t.macro _fgetscr f_reg63\n"
150 "\tfgetscr \\f_reg63\n"
153 "\t.macro _fputscr f_reg63\n"
154 "\tfputscr \\f_reg63\n"
160 ** RedHat style target register name inside "asm" blocks
162 # define __t0 __str(tr0)
163 # define __t1 __str(tr1)
164 # define __t2 __str(tr2)
165 # define __t3 __str(tr3)
166 # define __t4 __str(tr4)
167 # define __t5 __str(tr5)
168 # define __t6 __str(tr6)
169 # define __t7 __str(tr7)
172 ** RedHat style control register name inside "asm" blocks
174 # define __c0 __str(cr0) /* SR */
175 # define __c1 __str(cr1) /* SSR */
176 # define __c2 __str(cr2) /* PSSR */
177 # define __c4 __str(cr4) /* INTEVT */
178 # define __c5 __str(cr5) /* EXPEVT */
179 # define __c6 __str(cr6) /* PEXPEVT */
180 # define __c8 __str(cr8) /* SPC */
181 # define __c9 __str(cr9) /* PSPC */
182 # define __c13 __str(cr13) /* TEA */
183 # define __c17 __str(cr17) /* KCR0 */
184 # define __c18 __str(cr18) /* KCR1 */
187 ** RedHat style float and double register name inside "asm" blocks
188 ** defines below are used only in .../arch/sh5/kernel/fpu.c
190 # define __f(x) __str(fr##x)
191 # define __p(x) __str(fp##x)
192 # define __d(x) __str(dr##x)
195 ** Stringify reg. name (common for CDC & RedHat)
199 #endif /* __ASSEMBLY__ */
200 #endif /* __ASM_SH64_REGISTERS_H */