* config/i386/*aix*: New files.
[deliverable/binutils-gdb.git] / gdb / config / i386 / tm-i386aix.h
1 /* Macro defintions for IBM AIX PS/2 (i386).
2 Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /*
21 * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
22 * Revision: 5-May-93 00:11:35
23 */
24
25 #ifndef TM_I386AIX_H
26 #define TM_I386AIX_H 1
27
28 #include "i386/tm-i386v.h"
29 #include <sys/reg.h>
30
31 #ifndef I386
32 # define I386 1
33 #endif
34 #ifndef I386_AIX_TARGET
35 # define I386_AIX_TARGET 1
36 #endif
37
38 /* number of traps that happen between exec'ing the shell
39 * to run an inferior, and when we finally get to
40 * the inferior code. This is 2 on most implementations.
41 */
42 #undef START_INFERIOR_TRAPS_EXPECTED
43 #define START_INFERIOR_TRAPS_EXPECTED 2
44
45 /* Number of machine registers */
46 #undef NUM_REGS
47 #define NUM_REGS 24 /* 16+8 */
48
49 /* Initializer for an array of names of registers.
50 There should be NUM_REGS strings in this initializer. */
51
52 /* the order of the first 8 registers must match the compiler's
53 * numbering scheme (which is the same as the 386 scheme)
54 * also, this table must match regmap in i386-pinsn.c.
55 */
56 #undef REGISTER_NAMES
57 #define REGISTER_NAMES { "eax", "ecx", "edx", "ebx", \
58 "esp", "ebp", "esi", "edi", \
59 "eip", "eflags", "cs", "ss", \
60 "ds", "es", "fs", "gs", \
61 "st0", "st1", "st2", "st3", \
62 "st4", "st5", "st6", "st7", \
63 }
64
65 /* Register numbers of various important registers.
66 Note that some of these values are "real" register numbers,
67 and correspond to the general registers of the machine,
68 and some are "phony" register numbers which are too large
69 to be actual register numbers as far as the user is concerned
70 but do serve to get the desired values when passed to read_register. */
71
72 #undef FP_REGNUM
73 #define FP_REGNUM 5 /* (ebp) Contains address of executing stack frame */
74 #undef SP_REGNUM
75 #define SP_REGNUM 4 /* (usp) Contains address of top of stack */
76
77 #undef PC_REGNUM
78 #define PC_REGNUM 8 /* (eip) Contains program counter */
79 #undef PS_REGNUM
80 #define PS_REGNUM 9 /* (eflags) Contains processor status */
81
82 #define FP0_REGNUM 16 /* (st0) 387 register */
83
84 /* Total amount of space needed to store our copies of the machine's
85 register state, the array `registers'. */
86 /* 16 i386 registers and 8 i387 registers */
87 #undef REGISTER_BYTES
88 #define REGISTER_BYTES (16*4 + 8*10)
89
90 /* Index within `registers' of the first byte of the space for
91 register N. */
92 #undef REGISTER_BYTE
93 #define REGISTER_BYTE(N) \
94 ((N < FP0_REGNUM) ? (N * 4) : \
95 (((N - FP0_REGNUM) * 10) + 64))
96
97 /* Number of bytes of storage in the actual machine representation
98 * for register N. All registers are 4 bytes, except 387 st(0) - st(7),
99 * which are 80 bits each.
100 */
101 #undef REGISTER_RAW_SIZE
102 #define REGISTER_RAW_SIZE(N) \
103 ((N < FP0_REGNUM) ? 4 : 10)
104
105 /* Largest value REGISTER_RAW_SIZE can have. */
106 #undef MAX_REGISTER_RAW_SIZE
107 #define MAX_REGISTER_RAW_SIZE 10
108
109 /* Nonzero if register N requires conversion
110 from raw format to virtual format. */
111 #undef REGISTER_CONVERTIBLE
112 #define REGISTER_CONVERTIBLE(N) \
113 ((N < FP0_REGNUM) ? 0 : 1)
114
115 /* Convert data from raw format for register REGNUM
116 to virtual format for register REGNUM. */
117 #undef REGISTER_CONVERT_TO_VIRTUAL
118 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
119 ((REGNUM < FP0_REGNUM) ? bcopy ((FROM), (TO), 4) : \
120 i387_to_double((FROM), (TO)))
121
122 /* Convert data from virtual format for register REGNUM
123 to raw format for register REGNUM. */
124 #undef REGISTER_CONVERT_TO_RAW
125 #define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
126 ((REGNUM < FP0_REGNUM) ? bcopy ((FROM), (TO), 4) : \
127 double_to_i387((FROM), (TO)))
128
129 /* Return the GDB type object for the "standard" data type
130 of data in register N. */
131 #undef REGISTER_VIRTUAL_TYPE
132 #define REGISTER_VIRTUAL_TYPE(N) \
133 ((N < FP0_REGNUM) ? builtin_type_int : \
134 builtin_type_double)
135
136 /* Extract from an array REGBUF containing the (raw) register state
137 a function return value of type TYPE, and copy that, in virtual format,
138 into VALBUF. */
139 #undef EXTRACT_RETURN_VALUE
140 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
141 i386_extract_return_value (TYPE,REGBUF,VALBUF)
142
143 /* Write into appropriate registers a function return value
144 of type TYPE, given in virtual format. */
145 #undef STORE_RETURN_VALUE
146 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
147 { \
148 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
149 write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
150 TYPE_LENGTH (TYPE)); \
151 else \
152 write_register_bytes (0, (VALBUF), TYPE_LENGTH (TYPE)); \
153 }
154
155 #endif /* TM_I386AIX_H */
This page took 0.036723 seconds and 4 git commands to generate.