4e6b2df48fb98018f8ed2fb2da9992ac7fda0005
1 /* Macro defintions for IBM AIX PS/2 (i386).
2 Copyright 1986, 1987, 1989, 1992, 1993 Free Software Foundation, Inc.
4 This file is part of GDB.
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.
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.
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. */
21 * Changes for IBM AIX PS/2 by Minh Tran-Le (tranle@intellicorp.com)
22 * Revision: 5-May-93 00:11:35
26 #define TM_I386AIX_H 1
28 #include "i386/tm-i386v.h"
34 #ifndef I386_AIX_TARGET
35 # define I386_AIX_TARGET 1
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.
42 #undef START_INFERIOR_TRAPS_EXPECTED
43 #define START_INFERIOR_TRAPS_EXPECTED 2
45 /* Number of machine registers */
47 #define NUM_REGS 24 /* 16+8 */
49 /* Initializer for an array of names of registers.
50 There should be NUM_REGS strings in this initializer. */
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.
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", \
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. */
73 #define FP_REGNUM 5 /* (ebp) Contains address of executing stack frame */
75 #define SP_REGNUM 4 /* (usp) Contains address of top of stack */
78 #define PC_REGNUM 8 /* (eip) Contains program counter */
80 #define PS_REGNUM 9 /* (eflags) Contains processor status */
82 #define FP0_REGNUM 16 /* (st0) 387 register */
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 */
88 #define REGISTER_BYTES (16*4 + 8*10)
90 /* Index within `registers' of the first byte of the space for
93 #define REGISTER_BYTE(N) \
94 ((N < FP0_REGNUM) ? (N * 4) : \
95 (((N - FP0_REGNUM) * 10) + 64))
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.
101 #undef REGISTER_RAW_SIZE
102 #define REGISTER_RAW_SIZE(N) \
103 ((N < FP0_REGNUM) ? 4 : 10)
105 /* Largest value REGISTER_RAW_SIZE can have. */
106 #undef MAX_REGISTER_RAW_SIZE
107 #define MAX_REGISTER_RAW_SIZE 10
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)
115 /* Convert data from raw format for register REGNUM in buffer FROM
116 to virtual format with type TYPE in buffer TO. */
118 #undef REGISTER_CONVERT_TO_VIRTUAL
119 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
122 i387_to_double ((FROM), (char *)&val); \
123 store_floating ((TO), TYPE_LENGTH (TYPE), val); \
126 i387_to_double
PARAMS ((char *, char *));
128 /* Convert data from virtual format with type TYPE in buffer FROM
129 to raw format for register REGNUM in buffer TO. */
131 #undef REGISTER_CONVERT_TO_RAW
132 #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO) \
134 double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
135 double_to_i387((char *)&val, (TO)))
138 double_to_i387
PARAMS ((char *, char *));
140 /* Return the GDB type object for the "standard" data type
141 of data in register N. */
142 #undef REGISTER_VIRTUAL_TYPE
143 #define REGISTER_VIRTUAL_TYPE(N) \
144 ((N < FP0_REGNUM) ? builtin_type_int : \
147 /* Extract from an array REGBUF containing the (raw) register state
148 a function return value of type TYPE, and copy that, in virtual format,
150 #undef EXTRACT_RETURN_VALUE
151 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
152 i386_extract_return_value (TYPE,REGBUF,VALBUF)
154 /* Write into appropriate registers a function return value
155 of type TYPE, given in virtual format. */
156 #undef STORE_RETURN_VALUE
157 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
159 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
160 write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
161 TYPE_LENGTH (TYPE)); \
163 write_register_bytes (0, (VALBUF), TYPE_LENGTH (TYPE)); \
166 #endif /* TM_I386AIX_H */
This page took 0.031771 seconds and 3 git commands to generate.