Commit | Line | Data |
---|---|---|
d6ea322f | 1 | /* Target machine definitions for GDB for an embedded SPARC. |
d0e51077 | 2 | Copyright 1996 Free Software Foundation, Inc. |
d6ea322f DP |
3 | |
4 | This file is part of GDB. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | |
19 | ||
20 | #include "sparc/tm-sparc.h" | |
21 | ||
22 | #define TARGET_SPARCLET 1 | |
23 | ||
24 | /* overrides of tm-sparc.h */ | |
25 | ||
d0e51077 DE |
26 | #undef TARGET_BYTE_ORDER |
27 | #define TARGET_BYTE_ORDER_SELECTABLE | |
28 | ||
29 | /* Sequence of bytes for breakpoint instruction (ta 1). */ | |
30 | #undef BREAKPOINT | |
31 | #define BIG_BREAKPOINT {0x91, 0xd0, 0x20, 0x01} | |
32 | #define LITTLE_BREAKPOINT {0x01, 0x20, 0xd0, 0x91} | |
33 | ||
d6ea322f DP |
34 | /* Initializer for an array of names of registers. |
35 | There should be NUM_REGS strings in this initializer. */ | |
36 | /* Sparclet has no fp! */ | |
37 | /* Compiler maps types for floats by number, so can't | |
38 | change the numbers here. */ | |
39 | ||
40 | #undef REGISTER_NAMES | |
41 | /* g0 removed - Sparclet returns error if attempt to access. */ | |
42 | /* psr removed - Sparclet does not return ": " in response, | |
43 | the monitor is therefore unable to get the expected response delimiter, | |
44 | causing a timeout. */ | |
45 | #define REGISTER_NAMES \ | |
46 | { "", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \ | |
47 | "o0", "o1", "o2", "o3", "o4", "o5", "o6", "o7", \ | |
48 | "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \ | |
49 | "i0", "i1", "i2", "i3", "i4", "i5", "i6", "i7", \ | |
50 | \ | |
51 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
52 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
53 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
54 | 0, 0, 0, 0, 0, 0, 0, 0, \ | |
55 | \ | |
56 | "y", 0, "wim", "tbr", "pc", "npc", 0, 0 } | |
57 | ||
58 | /* Remove FP dependant code which was defined in tm-sparc.h */ | |
59 | #undef FP0_REGNUM /* Floating point register 0 */ | |
60 | #undef FPS_REGNUM /* Floating point status register */ | |
61 | #undef CPS_REGNUM /* Coprocessor status register */ | |
62 | ||
63 | #undef EXTRACT_RETURN_VALUE | |
64 | #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \ | |
65 | { \ | |
66 | memcpy ((VALBUF), \ | |
67 | (char *)(REGBUF) + REGISTER_RAW_SIZE (O0_REGNUM) * 8 + \ | |
68 | (TYPE_LENGTH(TYPE) >= REGISTER_RAW_SIZE (O0_REGNUM) \ | |
69 | ? 0 : REGISTER_RAW_SIZE (O0_REGNUM) - TYPE_LENGTH(TYPE)), \ | |
70 | TYPE_LENGTH(TYPE)); \ | |
71 | } | |
72 | #undef STORE_RETURN_VALUE | |
73 | #define STORE_RETURN_VALUE(TYPE,VALBUF) \ | |
74 | { \ | |
75 | /* Other values are returned in register %o0. */ \ | |
76 | write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \ | |
77 | TYPE_LENGTH (TYPE)); \ | |
78 | } | |
79 | #undef PRINT_REGISTER_HOOK | |
80 | #define PRINT_REGISTER_HOOK(regno) | |
81 | ||
82 | /* Override the standard gdb prompt when compiled for this target. */ | |
83 | ||
84 | #define DEFAULT_PROMPT "(gdbslet) " | |
85 | ||
86 | /* Offsets into jmp_buf. Not defined by Sun, but at least documented in a | |
87 | comment in <machine/setjmp.h>! */ | |
88 | ||
89 | #define JB_ELEMENT_SIZE 4 /* Size of each element in jmp_buf */ | |
90 | ||
91 | #define JB_ONSSTACK 0 | |
92 | #define JB_SIGMASK 1 | |
93 | #define JB_SP 2 | |
94 | #define JB_PC 3 | |
95 | #define JB_NPC 4 | |
96 | #define JB_PSR 5 | |
97 | #define JB_G1 6 | |
98 | #define JB_O0 7 | |
99 | #define JB_WBCNT 8 | |
100 | ||
101 | /* Figure out where the longjmp will land. We expect that we have just entered | |
102 | longjmp and haven't yet setup the stack frame, so the args are still in the | |
103 | output regs. %o0 (O0_REGNUM) points at the jmp_buf structure from which we | |
104 | extract the pc (JB_PC) that we will land at. The pc is copied into ADDR. | |
105 | This routine returns true on success */ | |
106 | ||
107 | extern int | |
108 | get_longjmp_target PARAMS ((CORE_ADDR *)); | |
109 | ||
110 | #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR) |