]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/config/i386/tm-i386v.h
* config/sh/tm-sh.h (BELIEVE_PCC_PROMOTION): Define, so that
[thirdparty/binutils-gdb.git] / gdb / config / i386 / tm-i386v.h
CommitLineData
5076de82
FF
1/* Macro definitions for i386, Unix System V.
2 Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
3
4This file is part of GDB.
5
6This program is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program; if not, write to the Free Software
6c9638b4 18Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
5076de82 19
7ee7dc27 20#ifndef TM_I386V_H
5076de82
FF
21#define TM_I386V_H 1
22
7ee7dc27 23/* First pick up the generic *86 target file. */
5076de82 24
7ee7dc27 25#include "i386/tm-i386.h"
5076de82 26
7ee7dc27
FF
27/* Number of traps that happen between exec'ing the shell to run an
28 inferior, and when we finally get to the inferior code. This is
29 2 on most implementations. Override here to 4. */
5076de82 30
7ee7dc27 31#undef START_INFERIOR_TRAPS_EXPECTED
5076de82 32#define START_INFERIOR_TRAPS_EXPECTED 4
5076de82
FF
33
34/* Number of machine registers */
35
7ee7dc27 36#undef NUM_REGS
5076de82
FF
37#define NUM_REGS 16
38
39/* Initializer for an array of names of registers.
40 There should be NUM_REGS strings in this initializer. */
41
42/* the order of the first 8 registers must match the compiler's
43 * numbering scheme (which is the same as the 386 scheme)
44 * also, this table must match regmap in i386-pinsn.c.
45 */
7ee7dc27
FF
46
47#undef REGISTER_NAMES
5076de82
FF
48#define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
49 "esp", "ebp", "esi", "edi", \
50 "eip", "ps", "cs", "ss", \
51 "ds", "es", "fs", "gs", \
52 }
53
5076de82
FF
54/* Total amount of space needed to store our copies of the machine's
55 register state, the array `registers'. */
7ee7dc27
FF
56
57#undef REGISTER_BYTES
5076de82
FF
58#define REGISTER_BYTES (NUM_REGS * 4)
59
60/* Index within `registers' of the first byte of the space for
61 register N. */
62
7ee7dc27 63#undef REGISTER_BYTE
5076de82
FF
64#define REGISTER_BYTE(N) ((N)*4)
65
66/* Number of bytes of storage in the actual machine representation
67 for register N. */
68
7ee7dc27 69#undef REGISTER_RAW_SIZE
5076de82
FF
70#define REGISTER_RAW_SIZE(N) (4)
71
72/* Number of bytes of storage in the program's representation
73 for register N. */
74
7ee7dc27 75#undef REGISTER_VIRTUAL_SIZE
5076de82
FF
76#define REGISTER_VIRTUAL_SIZE(N) (4)
77
78/* Largest value REGISTER_RAW_SIZE can have. */
79
7ee7dc27 80#undef MAX_REGISTER_RAW_SIZE
5076de82
FF
81#define MAX_REGISTER_RAW_SIZE 4
82
83/* Largest value REGISTER_VIRTUAL_SIZE can have. */
84
7ee7dc27 85#undef MAX_REGISTER_VIRTUAL_SIZE
5076de82
FF
86#define MAX_REGISTER_VIRTUAL_SIZE 4
87
5076de82
FF
88/* Return the GDB type object for the "standard" data type
89 of data in register N. */
90/* Perhaps si and di should go here, but potentially they could be
91 used for things other than address. */
7ee7dc27
FF
92
93#undef REGISTER_VIRTUAL_TYPE
5076de82
FF
94#define REGISTER_VIRTUAL_TYPE(N) \
95 ((N) == PC_REGNUM || (N) == FP_REGNUM || (N) == SP_REGNUM ? \
96 lookup_pointer_type (builtin_type_void) : builtin_type_int)
97
98/* Store the address of the place in which to copy the structure the
99 subroutine will return. This is called from call_function. */
100
7ee7dc27 101#undef STORE_STRUCT_RETURN
5076de82 102#define STORE_STRUCT_RETURN(ADDR, SP) \
4448ace2
MA
103 { char buf[REGISTER_SIZE]; \
104 (SP) -= sizeof (ADDR); \
105 store_address (buf, sizeof (ADDR), ADDR); \
106 write_memory ((SP), buf, sizeof (ADDR)); }
5076de82
FF
107
108/* Extract from an array REGBUF containing the (raw) register state
109 a function return value of type TYPE, and copy that, in virtual format,
110 into VALBUF. */
111
7ee7dc27 112#undef EXTRACT_RETURN_VALUE
5076de82
FF
113#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
114 memcpy ((VALBUF), (REGBUF), TYPE_LENGTH (TYPE))
115
116/* Write into appropriate registers a function return value
117 of type TYPE, given in virtual format. */
118
7ee7dc27 119#undef STORE_RETURN_VALUE
5076de82
FF
120#define STORE_RETURN_VALUE(TYPE,VALBUF) \
121 write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE))
122
5076de82
FF
123\f
124/* Describe the pointer in each stack frame to the previous stack frame
125 (its caller). */
126
127/* FRAME_CHAIN takes a frame's nominal address
128 and produces the frame's chain-pointer. */
129
7ee7dc27 130#undef FRAME_CHAIN
5076de82
FF
131#define FRAME_CHAIN(thisframe) \
132 (!inside_entry_file ((thisframe)->pc) ? \
133 read_memory_integer ((thisframe)->frame, 4) :\
134 0)
135
136/* Define other aspects of the stack frame. */
137
138/* A macro that tells us whether the function invocation represented
139 by FI does not have a frame on the stack associated with it. If it
140 does not, FRAMELESS is set to 1, else 0. */
7ee7dc27
FF
141
142#undef FRAMELESS_FUNCTION_INVOCATION
5076de82
FF
143#define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
144 (FRAMELESS) = frameless_look_for_prologue(FI)
145
7ee7dc27 146#undef FRAME_SAVED_PC
5076de82
FF
147#define FRAME_SAVED_PC(FRAME) (read_memory_integer ((FRAME)->frame + 4, 4))
148
5076de82
FF
149/* Return number of args passed to a frame.
150 Can return -1, meaning no way to tell. */
151
7ee7dc27 152#undef FRAME_NUM_ARGS
56eec3c7 153#define FRAME_NUM_ARGS(numargs, fi) (numargs) = -1
5076de82
FF
154
155#ifdef __STDC__ /* Forward decl's for prototypes */
156struct frame_info;
157struct frame_saved_regs;
158#endif
159
160extern int
161i386_frame_num_args PARAMS ((struct frame_info *));
162
7ee7dc27 163#endif /* ifndef TM_I386V_H */