]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/m68k/xm-altos.h
1 /* OBSOLETE /* Definitions to make GDB run on an Altos 3068 (m68k running SVR2) */
2 /* OBSOLETE Copyright (C) 1987,1989 Free Software Foundation, Inc. */
4 /* OBSOLETE This file is part of GDB. */
6 /* OBSOLETE This program is free software; you can redistribute it and/or modify */
7 /* OBSOLETE it under the terms of the GNU General Public License as published by */
8 /* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
9 /* OBSOLETE (at your option) any later version. */
11 /* OBSOLETE This program is distributed in the hope that it will be useful, */
12 /* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* OBSOLETE GNU General Public License for more details. */
16 /* OBSOLETE You should have received a copy of the GNU General Public License */
17 /* OBSOLETE along with this program; if not, write to the Free Software */
18 /* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *x/ */
20 /* OBSOLETE #define HOST_BYTE_ORDER BIG_ENDIAN */
22 /* OBSOLETE /* The altos support would make a good base for a port to other USGR2 systems */
23 /* OBSOLETE (like the 3b1 and the Convergent miniframe). *x/ */
25 /* OBSOLETE /* This is only needed in one file, but it's cleaner to put it here than */
26 /* OBSOLETE putting in more #ifdef's. *x/ */
27 /* OBSOLETE #include <sys/page.h> */
28 /* OBSOLETE #include <sys/net.h> */
30 /* OBSOLETE #define USG */
32 /* OBSOLETE #define HAVE_TERMIO */
34 /* OBSOLETE #define CBREAK XTABS /* It takes all kinds... *x/ */
36 /* OBSOLETE #ifndef R_OK */
37 /* OBSOLETE #define R_OK 4 */
38 /* OBSOLETE #define W_OK 2 */
39 /* OBSOLETE #define X_OK 1 */
40 /* OBSOLETE #define F_OK 0 */
43 /* OBSOLETE /* Get sys/wait.h ie. from a Sun and edit it a little (mc68000 to m68k) *x/ */
44 /* OBSOLETE /* Why bother? *x/ */
46 /* OBSOLETE #define HAVE_WAIT_STRUCT */
49 /* OBSOLETE /* This is the amount to subtract from u.u_ar0 */
50 /* OBSOLETE to get the offset in the core file of the register values. *x/ */
52 /* OBSOLETE #define KERNEL_U_ADDR 0x1fbf000 */
54 /* OBSOLETE #define REGISTER_U_ADDR(addr, blockend, regno) \ */
55 /* OBSOLETE { if (regno <= SP_REGNUM) \ */
56 /* OBSOLETE addr = blockend + regno * 4; \ */
57 /* OBSOLETE else if (regno == PS_REGNUM) \ */
58 /* OBSOLETE addr = blockend + regno * 4 + 4; \ */
59 /* OBSOLETE else if (regno == PC_REGNUM) \ */
60 /* OBSOLETE addr = blockend + regno * 4 + 2; \ */
63 /* OBSOLETE #define REGISTER_ADDR(u_ar0, regno) \ */
64 /* OBSOLETE (((regno) < PS_REGNUM) \ */
65 /* OBSOLETE ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)]) \ */
66 /* OBSOLETE : (((regno) == PS_REGNUM) \ */
67 /* OBSOLETE ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS)) \ */
68 /* OBSOLETE : (&((struct exception_stack *) (u_ar0))->e_PC))) */
70 /* OBSOLETE #define FP_REGISTER_ADDR(u, regno) \ */
71 /* OBSOLETE (((char *) \ */
72 /* OBSOLETE (((regno) < FPC_REGNUM) \ */
73 /* OBSOLETE ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \ */
74 /* OBSOLETE : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)]))) \ */
75 /* OBSOLETE - ((char *) (& u))) */
78 /* OBSOLETE #ifndef __GNUC__ */
79 /* OBSOLETE #undef USE_GAS */
80 /* OBSOLETE #define ALTOS_AS */
82 /* OBSOLETE #define USE_GAS */
85 /* OBSOLETE /* Motorola assembly format *x/ */
86 /* OBSOLETE #if !defined(USE_GAS) && !defined(ALTOS) */
87 /* OBSOLETE #define MOTOROLA */
90 /* OBSOLETE /* Interface definitions for kernel debugger KDB. *x/ */
92 /* OBSOLETE /* Map machine fault codes into signal numbers. */
93 /* OBSOLETE First subtract 0, divide by 4, then index in a table. */
94 /* OBSOLETE Faults for which the entry in this table is 0 */
95 /* OBSOLETE are not handled by KDB; the program's own trap handler */
96 /* OBSOLETE gets to handle then. *x/ */
98 /* OBSOLETE #define FAULT_CODE_ORIGIN 0 */
99 /* OBSOLETE #define FAULT_CODE_UNITS 4 */
100 /* OBSOLETE #define FAULT_TABLE \ */
101 /* OBSOLETE { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ */
102 /* OBSOLETE 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ */
103 /* OBSOLETE 0, 0, 0, 0, 0, 0, 0, 0, \ */
104 /* OBSOLETE SIGILL } */
106 /* OBSOLETE /* Start running with a stack stretching from BEG to END. */
107 /* OBSOLETE BEG and END should be symbols meaningful to the assembler. */
108 /* OBSOLETE This is used only for kdb. *x/ */
110 /* OBSOLETE #ifdef MOTOROLA */
111 /* OBSOLETE #define INIT_STACK(beg, end) \ */
112 /* OBSOLETE { asm (".globl end"); \ */
113 /* OBSOLETE asm ("move.l $ end, sp"); \ */
114 /* OBSOLETE asm ("clr.l fp"); } */
116 /* OBSOLETE #ifdef ALTOS_AS */
117 /* OBSOLETE #define INIT_STACK(beg, end) \ */
118 /* OBSOLETE { asm ("global end"); \ */
119 /* OBSOLETE asm ("mov.l &end,%sp"); \ */
120 /* OBSOLETE asm ("clr.l %fp"); } */
122 /* OBSOLETE #define INIT_STACK(beg, end) \ */
123 /* OBSOLETE { asm (".globl end"); \ */
124 /* OBSOLETE asm ("movel $ end, sp"); \ */
125 /* OBSOLETE asm ("clrl fp"); } */
126 /* OBSOLETE #endif */
127 /* OBSOLETE #endif */
129 /* OBSOLETE /* Push the frame pointer register on the stack. *x/ */
130 /* OBSOLETE #ifdef MOTOROLA */
131 /* OBSOLETE #define PUSH_FRAME_PTR \ */
132 /* OBSOLETE asm ("move.l fp, -(sp)"); */
134 /* OBSOLETE #ifdef ALTOS_AS */
135 /* OBSOLETE #define PUSH_FRAME_PTR \ */
136 /* OBSOLETE asm ("mov.l %fp, -(%sp)"); */
138 /* OBSOLETE #define PUSH_FRAME_PTR \ */
139 /* OBSOLETE asm ("movel fp, -(sp)"); */
140 /* OBSOLETE #endif */
141 /* OBSOLETE #endif */
143 /* OBSOLETE /* Copy the top-of-stack to the frame pointer register. *x/ */
144 /* OBSOLETE #ifdef MOTOROLA */
145 /* OBSOLETE #define POP_FRAME_PTR \ */
146 /* OBSOLETE asm ("move.l (sp), fp"); */
148 /* OBSOLETE #ifdef ALTOS_AS */
149 /* OBSOLETE #define POP_FRAME_PTR \ */
150 /* OBSOLETE asm ("mov.l (%sp), %fp"); */
152 /* OBSOLETE #define POP_FRAME_PTR \ */
153 /* OBSOLETE asm ("movl (sp), fp"); */
154 /* OBSOLETE #endif */
155 /* OBSOLETE #endif */
157 /* OBSOLETE /* After KDB is entered by a fault, push all registers */
158 /* OBSOLETE that GDB thinks about (all NUM_REGS of them), */
159 /* OBSOLETE so that they appear in order of ascending GDB register number. */
160 /* OBSOLETE The fault code will be on the stack beyond the last register. *x/ */
162 /* OBSOLETE #ifdef MOTOROLA */
163 /* OBSOLETE #define PUSH_REGISTERS \ */
164 /* OBSOLETE { asm ("clr.w -(sp)"); \ */
165 /* OBSOLETE asm ("pea (10,sp)"); \ */
166 /* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */
168 /* OBSOLETE #ifdef ALTOS_AS */
169 /* OBSOLETE #define PUSH_REGISTERS \ */
170 /* OBSOLETE { asm ("clr.w -(%sp)"); \ */
171 /* OBSOLETE asm ("pea (10,%sp)"); \ */
172 /* OBSOLETE asm ("movm.l &0xfffe,-(%sp)"); } */
174 /* OBSOLETE #define PUSH_REGISTERS \ */
175 /* OBSOLETE { asm ("clrw -(sp)"); \ */
176 /* OBSOLETE asm ("pea 10(sp)"); \ */
177 /* OBSOLETE asm ("movem $ 0xfffe,-(sp)"); } */
178 /* OBSOLETE #endif */
179 /* OBSOLETE #endif */
181 /* OBSOLETE /* Assuming the registers (including processor status) have been */
182 /* OBSOLETE pushed on the stack in order of ascending GDB register number, */
183 /* OBSOLETE restore them and return to the address in the saved PC register. *x/ */
185 /* OBSOLETE #ifdef MOTOROLA */
186 /* OBSOLETE #define POP_REGISTERS \ */
187 /* OBSOLETE { asm ("subi.l $8,28(sp)"); \ */
188 /* OBSOLETE asm ("movem (sp),$ 0xffff"); \ */
189 /* OBSOLETE asm ("rte"); } */
191 /* OBSOLETE #ifdef ALTOS_AS */
192 /* OBSOLETE #define POP_REGISTERS \ */
193 /* OBSOLETE { asm ("sub.l &8,28(%sp)"); \ */
194 /* OBSOLETE asm ("movem (%sp),&0xffff"); \ */
195 /* OBSOLETE asm ("rte"); } */
197 /* OBSOLETE #define POP_REGISTERS \ */
198 /* OBSOLETE { asm ("subil $8,28(sp)"); \ */
199 /* OBSOLETE asm ("movem (sp),$ 0xffff"); \ */
200 /* OBSOLETE asm ("rte"); } */
201 /* OBSOLETE #endif */
202 /* OBSOLETE #endif */