OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [VER_5_3/] [gdb-5.3/] [gdb/] [config/] [i386/] [tm-ptx.h] - Blame information for rev 1182

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1181 sfurman
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
2
   with Weitek 1167 and i387 support.
3
   Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 2000
4
   Free Software Foundation, Inc.
5
   Symmetry version by Jay Vosburgh (fubar@sequent.com).
6
 
7
   This file is part of GDB.
8
 
9
   This program is free software; you can redistribute it and/or modify
10
   it under the terms of the GNU General Public License as published by
11
   the Free Software Foundation; either version 2 of the License, or
12
   (at your option) any later version.
13
 
14
   This program is distributed in the hope that it will be useful,
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
   GNU General Public License for more details.
18
 
19
   You should have received a copy of the GNU General Public License
20
   along with this program; if not, write to the Free Software
21
   Foundation, Inc., 59 Temple Place - Suite 330,
22
   Boston, MA 02111-1307, USA.  */
23
 
24
#ifndef TM_PTX_H
25
#define TM_PTX_H 1
26
 
27
/* I don't know if this will work for cross-debugging, even if you do get
28
   a copy of the right include file.  */
29
 
30
#include <sys/reg.h>
31
 
32
#ifdef SEQUENT_PTX4
33
#include "i386/tm-i386v4.h"
34
#else /* !SEQUENT_PTX4 */
35
#include "i386/tm-i386.h"
36
#endif
37
 
38
/* Amount PC must be decremented by after a breakpoint.  This is often the
39
   number of bytes in BREAKPOINT but not always (such as now). */
40
 
41
#undef DECR_PC_AFTER_BREAK
42
#define DECR_PC_AFTER_BREAK 0
43
 
44
#if 0
45
-- -this code can 't be used unless we know we are running native,
46
since it uses host specific ptrace calls.
47
/* code for 80387 fpu.  Functions are from i386-dep.c, copied into
48
 * symm-dep.c.
49
 */
50
#define FLOAT_INFO { i386_float_info(); }
51
#endif
52
 
53
/* Number of machine registers */
54
 
55
#undef  NUM_REGS
56
#define NUM_REGS 49
57
 
58
/* Initializer for an array of names of registers.  There should be at least
59
   NUM_REGS strings in this initializer.  Any excess ones are simply ignored.
60
   The order of the first 8 registers must match the compiler's numbering
61
   scheme (which is the same as the 386 scheme) and also regmap in the various
62
   *-nat.c files. */
63
 
64
#undef REGISTER_NAME
65
#define REGISTER_NAMES { "eax",  "ecx",    "edx",  "ebx",  \
66
                         "esp",  "ebp",    "esi",  "edi",  \
67
                         "eip",  "eflags", "st0",  "st1",  \
68
                         "st2",  "st3",    "st4",  "st5",  \
69
                         "st6",  "st7",    "fp1",  "fp2",  \
70
                         "fp3",  "fp4",    "fp5",  "fp6",  \
71
                         "fp7",  "fp8",    "fp9",  "fp10", \
72
                         "fp11", "fp12",   "fp13", "fp14", \
73
                         "fp15", "fp16",   "fp17", "fp18", \
74
                         "fp19", "fp20",   "fp21", "fp22", \
75
                         "fp23", "fp24",   "fp25", "fp26", \
76
                         "fp27", "fp28",   "fp29", "fp30", \
77
                         "fp31" }
78
 
79
/* Register numbers of various important registers.
80
   Note that some of these values are "real" register numbers,
81
   and correspond to the general registers of the machine,
82
   and some are "phony" register numbers which are too large
83
   to be actual register numbers as far as the user is concerned
84
   but do serve to get the desired values when passed to read_register.  */
85
 
86
#define EAX_REGNUM      0
87
#define ECX_REGNUM      1
88
#define EDX_REGNUM      2
89
#define EBX_REGNUM      3
90
 
91
#define ESP_REGNUM      4
92
#define EBP_REGNUM      5
93
 
94
#define ESI_REGNUM      6
95
#define EDI_REGNUM      7
96
 
97
#define EIP_REGNUM      8
98
#define EFLAGS_REGNUM   9
99
 
100
#define ST0_REGNUM      10
101
#define ST1_REGNUM      11
102
#define ST2_REGNUM      12
103
#define ST3_REGNUM      13
104
 
105
#define ST4_REGNUM      14
106
#define ST5_REGNUM      15
107
#define ST6_REGNUM      16
108
#define ST7_REGNUM      17
109
 
110
#define FP1_REGNUM 18           /* first 1167 register */
111
/* Get %fp2 - %fp31 by addition, since they are contiguous */
112
 
113
#undef  SP_REGNUM
114
#define SP_REGNUM ESP_REGNUM    /* Contains address of top of stack */
115
#undef  FP_REGNUM
116
#define FP_REGNUM EBP_REGNUM    /* Contains address of executing stack frame */
117
#undef  PC_REGNUM
118
#define PC_REGNUM EIP_REGNUM    /* Contains program counter */
119
#undef  PS_REGNUM
120
#define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */
121
 
122
/*
123
 * For ptx, this is a little bit bizarre, since the register block
124
 * is below the u area in memory.  This means that blockend here ends
125
 * up being negative (for the call from coredep.c) since the value in
126
 * u.u_ar0 will be less than KERNEL_U_ADDR (and coredep.c passes us
127
 * u.u_ar0 - KERNEL_U_ADDR in blockend).  Since we also define
128
 * FETCH_INFERIOR_REGISTERS (and supply our own functions for that),
129
 * the core file case will be the only use of this function.
130
 */
131
 
132
#define REGISTER_U_ADDR(addr, blockend, regno) \
133
{ (addr) = ptx_register_u_addr((blockend), (regno)); }
134
 
135
extern int ptx_register_u_addr (int, int);
136
 
137
/* Total amount of space needed to store our copies of the machine's
138
   register state, the array `registers'.  10 i*86 registers, 8 i387
139
   registers, and 31 Weitek 1167 registers */
140
 
141
#undef  REGISTER_BYTES
142
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
143
 
144
/* Largest value REGISTER_RAW_SIZE can have.  */
145
 
146
#undef  MAX_REGISTER_RAW_SIZE
147
#define MAX_REGISTER_RAW_SIZE 10
148
 
149
/* Nonzero if register N requires conversion
150
   from raw format to virtual format.  */
151
 
152
#undef REGISTER_CONVERTIBLE
153
#define REGISTER_CONVERTIBLE(N) \
154
((N < ST0_REGNUM) ? 0 : \
155
 (N < FP1_REGNUM) ? 1 : \
156
 0)
157
 
158
/* Convert data from raw format for register REGNUM
159
   to virtual format for register REGNUM.  */
160
extern const struct floatformat floatformat_i387_ext;   /* from floatformat.h */
161
 
162
#undef REGISTER_CONVERT_TO_VIRTUAL
163
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO)        \
164
((REGNUM < ST0_REGNUM) ?  (void)memcpy ((TO), (FROM), 4) : \
165
 (REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \
166
                                                       (FROM),(TO)) : \
167
 (void)memcpy ((TO), (FROM), 4))
168
 
169
/* Convert data from virtual format for register REGNUM
170
   to raw format for register REGNUM.  */
171
 
172
#undef REGISTER_CONVERT_TO_RAW
173
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)    \
174
((REGNUM < ST0_REGNUM) ?  (void)memcpy ((TO), (FROM), 4) : \
175
 (REGNUM < FP1_REGNUM) ? (void)floatformat_from_double(&floatformat_i387_ext, \
176
                                                       (FROM),(TO)) : \
177
 (void)memcpy ((TO), (FROM), 4))
178
 
179
/* Return the GDB type object for the "standard" data type
180
   of data in register N.  */
181
/*
182
 * Note: the 1167 registers (the last line, builtin_type_float) are
183
 * generally used in pairs, with each pair being treated as a double.
184
 * It it also possible to use them singly as floats.  I'm not sure how
185
 * in gdb to treat the register pair pseudo-doubles. -fubar
186
 */
187
#undef REGISTER_VIRTUAL_TYPE
188
#define REGISTER_VIRTUAL_TYPE(N) \
189
((N < ST0_REGNUM) ? builtin_type_int : \
190
 (N < FP1_REGNUM) ? builtin_type_double : \
191
 builtin_type_float)
192
 
193
/* Extract from an array REGBUF containing the (raw) register state
194
   a function return value of type TYPE, and copy that, in virtual format,
195
   into VALBUF.  */
196
 
197
#undef  DEPRECATED_EXTRACT_RETURN_VALUE
198
#define DEPRECATED_EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
199
  symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
200
 
201
/*
202
   #undef  FRAME_FIND_SAVED_REGS
203
   #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
204
   { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
205
 */
206
 
207
#endif /* ifndef TM_PTX_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.