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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [gdb/] [config/] [m68k/] [xm-hp300hpux.h] - Blame information for rev 1771

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

Line No. Rev Author Line
1 578 markom
/* Parameters for HP 9000 model 320 hosting, for GDB, the GNU debugger.
2
   Copyright 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996
3
   Free Software Foundation, Inc.
4
 
5
   This file is part of GDB.
6
 
7
   This program is free software; you can redistribute it and/or modify
8
   it under the terms of the GNU General Public License as published by
9
   the Free Software Foundation; either version 2 of the License, or
10
   (at your option) any later version.
11
 
12
   This program is distributed in the hope that it will be useful,
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
   GNU General Public License for more details.
16
 
17
   You should have received a copy of the GNU General Public License
18
   along with this program; if not, write to the Free Software
19
   Foundation, Inc., 59 Temple Place - Suite 330,
20
   Boston, MA 02111-1307, USA.  */
21
 
22
#define HOST_BYTE_ORDER BIG_ENDIAN
23
 
24
/* Define this to indicate problems with traps after continuing.  */
25
#define HP_OS_BUG
26
 
27
/* Set flag to indicate whether HP's assembler is in use. */
28
#ifdef __GNUC__
29
#ifdef __HPUX_ASM__
30
#define HPUX_ASM
31
#endif
32
#else /* not GNU C.  */
33
#define HPUX_ASM
34
#endif /* not GNU C.  */
35
 
36
/* Define this for versions of hp-ux older than 6.0 */
37
/* #define HPUX_VERSION_5 */
38
 
39
/* define USG if you are using sys5 /usr/include's */
40
#undef USG                      /* In case it was defined in the Makefile for cplus-dem.c */
41
#define USG
42
 
43
#define HAVE_TERMIOS
44
 
45
#define REGISTER_ADDR(u_ar0, regno)                                     \
46
  (unsigned int)                                                        \
47
  (((regno) < PS_REGNUM)                                                \
48
   ? (&((struct exception_stack *) (u_ar0))->e_regs[(regno + R0)])      \
49
   : (((regno) == PS_REGNUM)                                            \
50
      ? ((int *) (&((struct exception_stack *) (u_ar0))->e_PS))         \
51
      : (&((struct exception_stack *) (u_ar0))->e_PC)))
52
 
53
#define FP_REGISTER_ADDR(u, regno)                                      \
54
  (((char *)                                                            \
55
    (((regno) < FPC_REGNUM)                                             \
56
     ? (&u.u_pcb.pcb_mc68881[FMC68881_R0 + (((regno) - FP0_REGNUM) * 3)]) \
57
     : (&u.u_pcb.pcb_mc68881[FMC68881_C + ((regno) - FPC_REGNUM)])))    \
58
   - ((char *) (& u)))
59
 
60
/* Interface definitions for kernel debugger KDB.  */
61
 
62
/* Map machine fault codes into signal numbers.
63
   First subtract 0, divide by 4, then index in a table.
64
   Faults for which the entry in this table is 0
65
   are not handled by KDB; the program's own trap handler
66
   gets to handle then.  */
67
 
68
#define FAULT_CODE_ORIGIN 0
69
#define FAULT_CODE_UNITS 4
70
#define FAULT_TABLE    \
71
{ 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
72
  0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
73
  0, 0, 0, 0, 0, 0, 0, 0, \
74
  SIGILL }
75
 
76
#ifndef HPUX_ASM
77
 
78
/* Start running with a stack stretching from BEG to END.
79
   BEG and END should be symbols meaningful to the assembler.
80
   This is used only for kdb.  */
81
 
82
#define INIT_STACK(beg, end)  \
83
{ asm (".globl end");         \
84
  asm ("movel $ end, sp");      \
85
  asm ("clrl fp"); }
86
 
87
/* Push the frame pointer register on the stack.  */
88
#define PUSH_FRAME_PTR        \
89
  asm ("movel fp, -(sp)");
90
 
91
/* Copy the top-of-stack to the frame pointer register.  */
92
#define POP_FRAME_PTR  \
93
  asm ("movl (sp), fp");
94
 
95
/* After KDB is entered by a fault, push all registers
96
   that GDB thinks about (all NUM_REGS of them),
97
   so that they appear in order of ascending GDB register number.
98
   The fault code will be on the stack beyond the last register.  */
99
 
100
#define PUSH_REGISTERS        \
101
{ asm ("clrw -(sp)");         \
102
  asm ("pea 10(sp)");         \
103
  asm ("movem $ 0xfffe,-(sp)"); }
104
 
105
/* Assuming the registers (including processor status) have been
106
   pushed on the stack in order of ascending GDB register number,
107
   restore them and return to the address in the saved PC register.  */
108
 
109
#define POP_REGISTERS          \
110
{ asm ("subil $8,28(sp)");     \
111
  asm ("movem (sp),$ 0xffff"); \
112
  asm ("rte"); }
113
 
114
#else /* HPUX_ASM */
115
 
116
/* Start running with a stack stretching from BEG to END.
117
   BEG and END should be symbols meaningful to the assembler.
118
   This is used only for kdb.  */
119
 
120
#define INIT_STACK(beg, end)                                            \
121
{ asm ("global end");                                                   \
122
  asm ("mov.l &end,%sp");                                               \
123
  asm ("clr.l %a6"); }
124
 
125
/* Push the frame pointer register on the stack.  */
126
#define PUSH_FRAME_PTR                                                  \
127
  asm ("mov.l %fp,-(%sp)");
128
 
129
/* Copy the top-of-stack to the frame pointer register.  */
130
#define POP_FRAME_PTR                                                   \
131
  asm ("mov.l (%sp),%fp");
132
 
133
/* After KDB is entered by a fault, push all registers
134
   that GDB thinks about (all NUM_REGS of them),
135
   so that they appear in order of ascending GDB register number.
136
   The fault code will be on the stack beyond the last register.  */
137
 
138
#define PUSH_REGISTERS                                                  \
139
{ asm ("clr.w -(%sp)");                                                 \
140
  asm ("pea 10(%sp)");                                                  \
141
  asm ("movm.l &0xfffe,-(%sp)"); }
142
 
143
/* Assuming the registers (including processor status) have been
144
   pushed on the stack in order of ascending GDB register number,
145
   restore them and return to the address in the saved PC register.  */
146
 
147
#define POP_REGISTERS                                                   \
148
{ asm ("subi.l &8,28(%sp)");                                            \
149
  asm ("mov.m (%sp),&0xffff");                                          \
150
  asm ("rte"); }
151
 
152
#endif /* HPUX_ASM */

powered by: WebSVN 2.1.0

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