| 1 | /* Parameters for hosting on a Hewlett-Packard 9000/300, running bsd. |
| 2 | Copyright 1986, 1987, 1989, 1991, 1992, 1993, 2001 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., 59 Temple Place - Suite 330, |
| 19 | Boston, MA 02111-1307, USA. */ |
| 20 | |
| 21 | /* |
| 22 | * Configuration file for HP9000/300 series machine running |
| 23 | * University of Utah's 4.3bsd (or 4.4BSD) port. This is NOT for HP-UX. |
| 24 | * Problems to hpbsd-bugs@cs.utah.edu |
| 25 | */ |
| 26 | |
| 27 | #define HOST_BYTE_ORDER BIG_ENDIAN |
| 28 | |
| 29 | #include <sys/param.h> /* For INT_MIN */ |
| 30 | |
| 31 | /* Kernel is a bit tenacious about sharing text segments, disallowing bpts. */ |
| 32 | #define ONE_PROCESS_WRITETEXT |
| 33 | \f |
| 34 | /* Interface definitions for kernel debugger KDB. */ |
| 35 | |
| 36 | /* Map machine fault codes into signal numbers. |
| 37 | First subtract 0, divide by 4, then index in a table. |
| 38 | Faults for which the entry in this table is 0 |
| 39 | are not handled by KDB; the program's own trap handler |
| 40 | gets to handle then. */ |
| 41 | |
| 42 | #define FAULT_CODE_ORIGIN 0 |
| 43 | #define FAULT_CODE_UNITS 4 |
| 44 | #define FAULT_TABLE \ |
| 45 | { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \ |
| 46 | 0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \ |
| 47 | 0, 0, 0, 0, 0, 0, 0, 0, \ |
| 48 | SIGILL } |
| 49 | |
| 50 | /* Start running with a stack stretching from BEG to END. |
| 51 | BEG and END should be symbols meaningful to the assembler. |
| 52 | This is used only for kdb. */ |
| 53 | |
| 54 | #define INIT_STACK(beg, end) \ |
| 55 | { asm (".globl end"); \ |
| 56 | asm ("movel #end, sp"); \ |
| 57 | asm ("movel #0,a6"); } |
| 58 | |
| 59 | /* Push the frame pointer register on the stack. */ |
| 60 | #define PUSH_FRAME_PTR \ |
| 61 | asm ("movel a6,sp@-"); |
| 62 | |
| 63 | /* Copy the top-of-stack to the frame pointer register. */ |
| 64 | #define POP_FRAME_PTR \ |
| 65 | asm ("movl sp@,a6"); |
| 66 | |
| 67 | /* After KDB is entered by a fault, push all registers |
| 68 | that GDB thinks about (all NUM_REGS of them), |
| 69 | so that they appear in order of ascending GDB register number. |
| 70 | The fault code will be on the stack beyond the last register. */ |
| 71 | |
| 72 | #define PUSH_REGISTERS \ |
| 73 | { asm ("clrw -(sp)"); \ |
| 74 | asm ("pea sp@(10)"); \ |
| 75 | asm ("movem #0xfffe,sp@-"); } |
| 76 | |
| 77 | /* Assuming the registers (including processor status) have been |
| 78 | pushed on the stack in order of ascending GDB register number, |
| 79 | restore them and return to the address in the saved PC register. */ |
| 80 | |
| 81 | #define POP_REGISTERS \ |
| 82 | { asm ("subil #8,sp@(28)"); \ |
| 83 | asm ("movem sp@,#0xffff"); \ |
| 84 | asm ("rte"); } |