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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [config/] [i386/] [tm-ptx.h] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
/* Target machine definitions for GDB on a Sequent Symmetry under ptx
   with Weitek 1167 and i387 support.
   with Weitek 1167 and i387 support.
   Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
   Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
   Symmetry version by Jay Vosburgh (fubar@sequent.com).
   Symmetry version by Jay Vosburgh (fubar@sequent.com).
 
 
   This file is part of GDB.
   This file is part of GDB.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */
   Boston, MA 02111-1307, USA.  */
 
 
#ifndef TM_PTX_H
#ifndef TM_PTX_H
#define TM_PTX_H 1
#define TM_PTX_H 1
 
 
/* I don't know if this will work for cross-debugging, even if you do get
/* I don't know if this will work for cross-debugging, even if you do get
   a copy of the right include file.  */
   a copy of the right include file.  */
 
 
#include <sys/reg.h>
#include <sys/reg.h>
 
 
#ifdef SEQUENT_PTX4
#ifdef SEQUENT_PTX4
#include "i386/tm-i386v4.h"
#include "i386/tm-i386v4.h"
#else /* !SEQUENT_PTX4 */
#else /* !SEQUENT_PTX4 */
#include "i386/tm-i386v.h"
#include "i386/tm-i386v.h"
#endif
#endif
 
 
/* Number of traps that happen between exec'ing the shell to run an
/* Number of traps that happen between exec'ing the shell to run an
   inferior, and when we finally get to the inferior code.  This is 2
   inferior, and when we finally get to the inferior code.  This is 2
   on most implementations. Here we have to undo what tm-i386v.h gave
   on most implementations. Here we have to undo what tm-i386v.h gave
   us and restore the default. */
   us and restore the default. */
 
 
#undef START_INFERIOR_TRAPS_EXPECTED
#undef START_INFERIOR_TRAPS_EXPECTED
#define START_INFERIOR_TRAPS_EXPECTED 2
#define START_INFERIOR_TRAPS_EXPECTED 2
 
 
/* Amount PC must be decremented by after a breakpoint.  This is often the
/* Amount PC must be decremented by after a breakpoint.  This is often the
   number of bytes in BREAKPOINT but not always (such as now). */
   number of bytes in BREAKPOINT but not always (such as now). */
 
 
#undef DECR_PC_AFTER_BREAK
#undef DECR_PC_AFTER_BREAK
#define DECR_PC_AFTER_BREAK 0
#define DECR_PC_AFTER_BREAK 0
 
 
#if 0
#if 0
-- -this code can 't be used unless we know we are running native,
-- -this code can 't be used unless we know we are running native,
since it uses host specific ptrace calls.
since it uses host specific ptrace calls.
/* code for 80387 fpu.  Functions are from i386-dep.c, copied into
/* code for 80387 fpu.  Functions are from i386-dep.c, copied into
 * symm-dep.c.
 * symm-dep.c.
 */
 */
#define FLOAT_INFO { i386_float_info(); }
#define FLOAT_INFO { i386_float_info(); }
#endif
#endif
 
 
/* Number of machine registers */
/* Number of machine registers */
 
 
#undef  NUM_REGS
#undef  NUM_REGS
#define NUM_REGS 49
#define NUM_REGS 49
 
 
/* Initializer for an array of names of registers.  There should be at least
/* Initializer for an array of names of registers.  There should be at least
   NUM_REGS strings in this initializer.  Any excess ones are simply ignored.
   NUM_REGS strings in this initializer.  Any excess ones are simply ignored.
   The order of the first 8 registers must match the compiler's numbering
   The order of the first 8 registers must match the compiler's numbering
   scheme (which is the same as the 386 scheme) and also regmap in the various
   scheme (which is the same as the 386 scheme) and also regmap in the various
   *-nat.c files. */
   *-nat.c files. */
 
 
#undef  REGISTER_NAMES
#undef  REGISTER_NAMES
#define REGISTER_NAMES { "eax",  "ecx",    "edx",  "ebx",  \
#define REGISTER_NAMES { "eax",  "ecx",    "edx",  "ebx",  \
                         "esp",  "ebp",    "esi",  "edi",  \
                         "esp",  "ebp",    "esi",  "edi",  \
                         "eip",  "eflags", "st0",  "st1",  \
                         "eip",  "eflags", "st0",  "st1",  \
                         "st2",  "st3",    "st4",  "st5",  \
                         "st2",  "st3",    "st4",  "st5",  \
                         "st6",  "st7",    "fp1",  "fp2",  \
                         "st6",  "st7",    "fp1",  "fp2",  \
                         "fp3",  "fp4",    "fp5",  "fp6",  \
                         "fp3",  "fp4",    "fp5",  "fp6",  \
                         "fp7",  "fp8",    "fp9",  "fp10", \
                         "fp7",  "fp8",    "fp9",  "fp10", \
                         "fp11", "fp12",   "fp13", "fp14", \
                         "fp11", "fp12",   "fp13", "fp14", \
                         "fp15", "fp16",   "fp17", "fp18", \
                         "fp15", "fp16",   "fp17", "fp18", \
                         "fp19", "fp20",   "fp21", "fp22", \
                         "fp19", "fp20",   "fp21", "fp22", \
                         "fp23", "fp24",   "fp25", "fp26", \
                         "fp23", "fp24",   "fp25", "fp26", \
                         "fp27", "fp28",   "fp29", "fp30", \
                         "fp27", "fp28",   "fp29", "fp30", \
                         "fp31" }
                         "fp31" }
 
 
/* Register numbers of various important registers.
/* Register numbers of various important registers.
   Note that some of these values are "real" register numbers,
   Note that some of these values are "real" register numbers,
   and correspond to the general registers of the machine,
   and correspond to the general registers of the machine,
   and some are "phony" register numbers which are too large
   and some are "phony" register numbers which are too large
   to be actual register numbers as far as the user is concerned
   to be actual register numbers as far as the user is concerned
   but do serve to get the desired values when passed to read_register.  */
   but do serve to get the desired values when passed to read_register.  */
 
 
#define EAX_REGNUM      0
#define EAX_REGNUM      0
#define ECX_REGNUM      1
#define ECX_REGNUM      1
#define EDX_REGNUM      2
#define EDX_REGNUM      2
#define EBX_REGNUM      3
#define EBX_REGNUM      3
 
 
#define ESP_REGNUM      4
#define ESP_REGNUM      4
#define EBP_REGNUM      5
#define EBP_REGNUM      5
 
 
#define ESI_REGNUM      6
#define ESI_REGNUM      6
#define EDI_REGNUM      7
#define EDI_REGNUM      7
 
 
#define EIP_REGNUM      8
#define EIP_REGNUM      8
#define EFLAGS_REGNUM   9
#define EFLAGS_REGNUM   9
 
 
#define ST0_REGNUM      10
#define ST0_REGNUM      10
#define ST1_REGNUM      11
#define ST1_REGNUM      11
#define ST2_REGNUM      12
#define ST2_REGNUM      12
#define ST3_REGNUM      13
#define ST3_REGNUM      13
 
 
#define ST4_REGNUM      14
#define ST4_REGNUM      14
#define ST5_REGNUM      15
#define ST5_REGNUM      15
#define ST6_REGNUM      16
#define ST6_REGNUM      16
#define ST7_REGNUM      17
#define ST7_REGNUM      17
 
 
#define FP1_REGNUM 18           /* first 1167 register */
#define FP1_REGNUM 18           /* first 1167 register */
/* Get %fp2 - %fp31 by addition, since they are contiguous */
/* Get %fp2 - %fp31 by addition, since they are contiguous */
 
 
#undef  SP_REGNUM
#undef  SP_REGNUM
#define SP_REGNUM ESP_REGNUM    /* Contains address of top of stack */
#define SP_REGNUM ESP_REGNUM    /* Contains address of top of stack */
#undef  FP_REGNUM
#undef  FP_REGNUM
#define FP_REGNUM EBP_REGNUM    /* Contains address of executing stack frame */
#define FP_REGNUM EBP_REGNUM    /* Contains address of executing stack frame */
#undef  PC_REGNUM
#undef  PC_REGNUM
#define PC_REGNUM EIP_REGNUM    /* Contains program counter */
#define PC_REGNUM EIP_REGNUM    /* Contains program counter */
#undef  PS_REGNUM
#undef  PS_REGNUM
#define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */
#define PS_REGNUM EFLAGS_REGNUM /* Contains processor status */
 
 
/*
/*
 * For ptx, this is a little bit bizarre, since the register block
 * For ptx, this is a little bit bizarre, since the register block
 * is below the u area in memory.  This means that blockend here ends
 * is below the u area in memory.  This means that blockend here ends
 * up being negative (for the call from coredep.c) since the value in
 * up being negative (for the call from coredep.c) since the value in
 * u.u_ar0 will be less than KERNEL_U_ADDR (and coredep.c passes us
 * u.u_ar0 will be less than KERNEL_U_ADDR (and coredep.c passes us
 * u.u_ar0 - KERNEL_U_ADDR in blockend).  Since we also define
 * u.u_ar0 - KERNEL_U_ADDR in blockend).  Since we also define
 * FETCH_INFERIOR_REGISTERS (and supply our own functions for that),
 * FETCH_INFERIOR_REGISTERS (and supply our own functions for that),
 * the core file case will be the only use of this function.
 * the core file case will be the only use of this function.
 */
 */
 
 
#define REGISTER_U_ADDR(addr, blockend, regno) \
#define REGISTER_U_ADDR(addr, blockend, regno) \
{ (addr) = ptx_register_u_addr((blockend), (regno)); }
{ (addr) = ptx_register_u_addr((blockend), (regno)); }
 
 
extern int
extern int
ptx_register_u_addr PARAMS ((int, int));
ptx_register_u_addr PARAMS ((int, int));
 
 
/* Total amount of space needed to store our copies of the machine's
/* Total amount of space needed to store our copies of the machine's
   register state, the array `registers'.  10 i*86 registers, 8 i387
   register state, the array `registers'.  10 i*86 registers, 8 i387
   registers, and 31 Weitek 1167 registers */
   registers, and 31 Weitek 1167 registers */
 
 
#undef  REGISTER_BYTES
#undef  REGISTER_BYTES
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
#define REGISTER_BYTES ((10 * 4) + (8 * 10) + (31 * 4))
 
 
/* Index within `registers' of the first byte of the space for register N. */
/* Index within `registers' of the first byte of the space for register N. */
 
 
#undef  REGISTER_BYTE
#undef  REGISTER_BYTE
#define REGISTER_BYTE(N)                \
#define REGISTER_BYTE(N)                \
(((N) < ST0_REGNUM) ? ((N) * 4) : \
(((N) < ST0_REGNUM) ? ((N) * 4) : \
 ((N) < FP1_REGNUM) ? (40 + (((N) - ST0_REGNUM) * 10)) : \
 ((N) < FP1_REGNUM) ? (40 + (((N) - ST0_REGNUM) * 10)) : \
 (40 + 80 + (((N) - FP1_REGNUM) * 4)))
 (40 + 80 + (((N) - FP1_REGNUM) * 4)))
 
 
/* Number of bytes of storage in the actual machine representation for
/* Number of bytes of storage in the actual machine representation for
   register N.  All registers are 4 bytes, except 387 st(0) - st(7),
   register N.  All registers are 4 bytes, except 387 st(0) - st(7),
   which are 80 bits each. */
   which are 80 bits each. */
 
 
#undef  REGISTER_RAW_SIZE
#undef  REGISTER_RAW_SIZE
#define REGISTER_RAW_SIZE(N) \
#define REGISTER_RAW_SIZE(N) \
(((N) < ST0_REGNUM) ? 4 : \
(((N) < ST0_REGNUM) ? 4 : \
 ((N) < FP1_REGNUM) ? 10 : \
 ((N) < FP1_REGNUM) ? 10 : \
 4)
 4)
 
 
/* Largest value REGISTER_RAW_SIZE can have.  */
/* Largest value REGISTER_RAW_SIZE can have.  */
 
 
#undef  MAX_REGISTER_RAW_SIZE
#undef  MAX_REGISTER_RAW_SIZE
#define MAX_REGISTER_RAW_SIZE 10
#define MAX_REGISTER_RAW_SIZE 10
 
 
/* Nonzero if register N requires conversion
/* Nonzero if register N requires conversion
   from raw format to virtual format.  */
   from raw format to virtual format.  */
 
 
#undef REGISTER_CONVERTIBLE
#undef REGISTER_CONVERTIBLE
#define REGISTER_CONVERTIBLE(N) \
#define REGISTER_CONVERTIBLE(N) \
((N < ST0_REGNUM) ? 0 : \
((N < ST0_REGNUM) ? 0 : \
 (N < FP1_REGNUM) ? 1 : \
 (N < FP1_REGNUM) ? 1 : \
 0)
 0)
 
 
/* Convert data from raw format for register REGNUM
/* Convert data from raw format for register REGNUM
   to virtual format for register REGNUM.  */
   to virtual format for register REGNUM.  */
extern const struct floatformat floatformat_i387_ext;   /* from floatformat.h */
extern const struct floatformat floatformat_i387_ext;   /* from floatformat.h */
 
 
#undef REGISTER_CONVERT_TO_VIRTUAL
#undef REGISTER_CONVERT_TO_VIRTUAL
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO)        \
#define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO)        \
((REGNUM < ST0_REGNUM) ?  (void)memcpy ((TO), (FROM), 4) : \
((REGNUM < ST0_REGNUM) ?  (void)memcpy ((TO), (FROM), 4) : \
 (REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \
 (REGNUM < FP1_REGNUM) ? (void)floatformat_to_double(&floatformat_i387_ext, \
                                                       (FROM),(TO)) : \
                                                       (FROM),(TO)) : \
 (void)memcpy ((TO), (FROM), 4))
 (void)memcpy ((TO), (FROM), 4))
 
 
/* Convert data from virtual format for register REGNUM
/* Convert data from virtual format for register REGNUM
   to raw format for register REGNUM.  */
   to raw format for register REGNUM.  */
 
 
#undef REGISTER_CONVERT_TO_RAW
#undef REGISTER_CONVERT_TO_RAW
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)    \
#define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)    \
((REGNUM < ST0_REGNUM) ?  (void)memcpy ((TO), (FROM), 4) : \
((REGNUM < ST0_REGNUM) ?  (void)memcpy ((TO), (FROM), 4) : \
 (REGNUM < FP1_REGNUM) ? (void)floatformat_from_double(&floatformat_i387_ext, \
 (REGNUM < FP1_REGNUM) ? (void)floatformat_from_double(&floatformat_i387_ext, \
                                                       (FROM),(TO)) : \
                                                       (FROM),(TO)) : \
 (void)memcpy ((TO), (FROM), 4))
 (void)memcpy ((TO), (FROM), 4))
 
 
/* Return the GDB type object for the "standard" data type
/* Return the GDB type object for the "standard" data type
   of data in register N.  */
   of data in register N.  */
/*
/*
 * Note: the 1167 registers (the last line, builtin_type_float) are
 * Note: the 1167 registers (the last line, builtin_type_float) are
 * generally used in pairs, with each pair being treated as a double.
 * generally used in pairs, with each pair being treated as a double.
 * It it also possible to use them singly as floats.  I'm not sure how
 * It it also possible to use them singly as floats.  I'm not sure how
 * in gdb to treat the register pair pseudo-doubles. -fubar
 * in gdb to treat the register pair pseudo-doubles. -fubar
 */
 */
#undef REGISTER_VIRTUAL_TYPE
#undef REGISTER_VIRTUAL_TYPE
#define REGISTER_VIRTUAL_TYPE(N) \
#define REGISTER_VIRTUAL_TYPE(N) \
((N < ST0_REGNUM) ? builtin_type_int : \
((N < ST0_REGNUM) ? builtin_type_int : \
 (N < FP1_REGNUM) ? builtin_type_double : \
 (N < FP1_REGNUM) ? builtin_type_double : \
 builtin_type_float)
 builtin_type_float)
 
 
/* Extract from an array REGBUF containing the (raw) register state
/* Extract from an array REGBUF containing the (raw) register state
   a function return value of type TYPE, and copy that, in virtual format,
   a function return value of type TYPE, and copy that, in virtual format,
   into VALBUF.  */
   into VALBUF.  */
 
 
#undef  EXTRACT_RETURN_VALUE
#undef  EXTRACT_RETURN_VALUE
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
#define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
  symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
  symmetry_extract_return_value(TYPE, REGBUF, VALBUF)
 
 
/*
/*
   #undef  FRAME_FIND_SAVED_REGS
   #undef  FRAME_FIND_SAVED_REGS
   #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
   #define FRAME_FIND_SAVED_REGS(frame_info, frame_saved_regs) \
   { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
   { ptx_frame_find_saved_regs((frame_info), &(frame_saved_regs)); }
 */
 */
 
 
#endif /* ifndef TM_PTX_H */
#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.