1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
27 * =================================================
\r
28 * We have two context's large and small. Large is saved on
\r
29 * interrupt and small is saved for everything else.
\r
34 * -------------------------------
\r
35 * 0--1 : context indicator, 0xde - small, 0xad - large
\r
41 * 16-- : General regs r14--r31
\r
44 * 16-- : General regs r0--r31
\r
51 #define SPR_CSRR0 58
\r
52 #define SPR_CSRR1 59
\r
54 #define SPR_SPRG0_RW_S 272
\r
55 #define SPR_SPRG1_RW_S 273
\r
60 #define SPR_SPEFSCR 512
\r
61 #define SPR_MCSR 572
\r
63 #define ESR_PTR (1<<(38-32))
\r
68 #define INTC_SSCIR7 0xFFF48027
\r
70 #if defined(_ASSEMBLER_)
\r
72 * PPC vs VLE assembler:
\r
73 * Most PPC assembler instructions can be pre-processed to VLE assembler.
\r
74 * I can't find any way to load a 32-bit immediate with just search/replace (number
\r
75 * of operators differ for addis and e_add2is )
\r
76 * Thats why there are different load macros below.
\r
80 #if defined(CFG_VLE)
\r
81 #define LOAD_IND_32( reg, addr) \
\r
83 lwz reg, addr@l(reg)
\r
85 #define LOAD_ADDR_32(reg, addr ) \
\r
86 e_lis reg, addr@ha; \
\r
87 e_add16i reg, reg, addr@l
\r
90 #define LOAD_IND_32( reg, addr) \
\r
92 lwz reg, addr@l(reg)
\r
94 #define LOAD_ADDR_32(reg, addr ) \
\r
95 addis reg, 0, addr@ha; \
\r
96 addi reg, reg, addr@l
\r
138 #if defined(CFG_VLE)
\r
143 #define lbzu e_lbzu
\r
144 #define stwu e_stwu
\r
146 #define stbu e_stbu
\r
148 //#define addi e_addi /* true ?*/
\r
149 #define addi e_add16i /* true ?*/
\r
150 //#define addis e_add16i
\r
151 #define subi e_subi /* true ?*/
\r
155 #define cmplwi e_cmpl16i
\r
158 //#define bne- e_bne-
\r
161 #define extrwi e_extrwi
\r
162 #define blrl se_blrl
\r
163 #define stmw e_stmw
\r
164 #define bdnz e_bdnz
\r
168 #endif /* _ASSEMBLER_ */
\r
170 #endif /*PPC_ASM_H_*/
\r