tcl/target: added support for TI OMAP/AM 3505 and 3517
[openocd.git] / src / rtos / rtos_standard_stackings.c
blob2eab86f934984202a6f33b9535cb5fd4a175158c
1 /***************************************************************************
2 * Copyright (C) 2011 by Broadcom Corporation *
3 * Evan Hunter - ehunter@broadcom.com *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
19 ***************************************************************************/
21 #ifdef HAVE_CONFIG_H
22 #include "config.h"
23 #endif
25 #include "rtos.h"
26 #include "target/armv7m.h"
28 static const struct stack_register_offset rtos_standard_Cortex_M3_stack_offsets[ARMV7M_NUM_CORE_REGS] = {
29 { 0x20, 32 }, /* r0 */
30 { 0x24, 32 }, /* r1 */
31 { 0x28, 32 }, /* r2 */
32 { 0x2c, 32 }, /* r3 */
33 { 0x00, 32 }, /* r4 */
34 { 0x04, 32 }, /* r5 */
35 { 0x08, 32 }, /* r6 */
36 { 0x0c, 32 }, /* r7 */
37 { 0x10, 32 }, /* r8 */
38 { 0x14, 32 }, /* r9 */
39 { 0x18, 32 }, /* r10 */
40 { 0x1c, 32 }, /* r11 */
41 { 0x30, 32 }, /* r12 */
42 { -2, 32 }, /* sp */
43 { 0x34, 32 }, /* lr */
44 { 0x38, 32 }, /* pc */
45 { 0x3c, 32 }, /* xPSR */
48 static const struct stack_register_offset rtos_standard_Cortex_R4_stack_offsets[] = {
49 { 0x08, 32 }, /* r0 (a1) */
50 { 0x0c, 32 }, /* r1 (a2) */
51 { 0x10, 32 }, /* r2 (a3) */
52 { 0x14, 32 }, /* r3 (a4) */
53 { 0x18, 32 }, /* r4 (v1) */
54 { 0x1c, 32 }, /* r5 (v2) */
55 { 0x20, 32 }, /* r6 (v3) */
56 { 0x24, 32 }, /* r7 (v4) */
57 { 0x28, 32 }, /* r8 (a1) */
58 { 0x2c, 32 }, /* r9 (sb) */
59 { 0x30, 32 }, /* r10 (sl) */
60 { 0x34, 32 }, /* r11 (fp) */
61 { 0x38, 32 }, /* r12 (ip) */
62 { -2, 32 }, /* sp */
63 { 0x3c, 32 }, /* lr */
64 { 0x40, 32 }, /* pc */
65 { -1, 96 }, /* FPA1 */
66 { -1, 96 }, /* FPA2 */
67 { -1, 96 }, /* FPA3 */
68 { -1, 96 }, /* FPA4 */
69 { -1, 96 }, /* FPA5 */
70 { -1, 96 }, /* FPA6 */
71 { -1, 96 }, /* FPA7 */
72 { -1, 96 }, /* FPA8 */
73 { -1, 32 }, /* FPS */
74 { 0x04, 32 }, /* CSPR */
77 static const struct stack_register_offset rtos_standard_NDS32_N1068_stack_offsets[] = {
78 { 0x88, 32 }, /* R0 */
79 { 0x8C, 32 }, /* R1 */
80 { 0x14, 32 }, /* R2 */
81 { 0x18, 32 }, /* R3 */
82 { 0x1C, 32 }, /* R4 */
83 { 0x20, 32 }, /* R5 */
84 { 0x24, 32 }, /* R6 */
85 { 0x28, 32 }, /* R7 */
86 { 0x2C, 32 }, /* R8 */
87 { 0x30, 32 }, /* R9 */
88 { 0x34, 32 }, /* R10 */
89 { 0x38, 32 }, /* R11 */
90 { 0x3C, 32 }, /* R12 */
91 { 0x40, 32 }, /* R13 */
92 { 0x44, 32 }, /* R14 */
93 { 0x48, 32 }, /* R15 */
94 { 0x4C, 32 }, /* R16 */
95 { 0x50, 32 }, /* R17 */
96 { 0x54, 32 }, /* R18 */
97 { 0x58, 32 }, /* R19 */
98 { 0x5C, 32 }, /* R20 */
99 { 0x60, 32 }, /* R21 */
100 { 0x64, 32 }, /* R22 */
101 { 0x68, 32 }, /* R23 */
102 { 0x6C, 32 }, /* R24 */
103 { 0x70, 32 }, /* R25 */
104 { 0x74, 32 }, /* R26 */
105 { 0x78, 32 }, /* R27 */
106 { 0x7C, 32 }, /* R28 */
107 { 0x80, 32 }, /* R29 */
108 { 0x84, 32 }, /* R30 (LP) */
109 { 0x00, 32 }, /* R31 (SP) */
110 { 0x04, 32 }, /* PSW */
111 { 0x08, 32 }, /* IPC */
112 { 0x0C, 32 }, /* IPSW */
113 { 0x10, 32 }, /* IFC_LP */
116 const struct rtos_register_stacking rtos_standard_Cortex_M3_stacking = {
117 0x40, /* stack_registers_size */
118 -1, /* stack_growth_direction */
119 ARMV7M_NUM_CORE_REGS, /* num_output_registers */
120 8, /* stack_alignment */
121 rtos_standard_Cortex_M3_stack_offsets /* register_offsets */
124 const struct rtos_register_stacking rtos_standard_Cortex_R4_stacking = {
125 0x48, /* stack_registers_size */
126 -1, /* stack_growth_direction */
127 26, /* num_output_registers */
128 8, /* stack_alignment */
129 rtos_standard_Cortex_R4_stack_offsets /* register_offsets */
132 const struct rtos_register_stacking rtos_standard_NDS32_N1068_stacking = {
133 0x90, /* stack_registers_size */
134 -1, /* stack_growth_direction */
135 32, /* num_output_registers */
136 8, /* stack_alignment */
137 rtos_standard_NDS32_N1068_stack_offsets /* register_offsets */