Update/correct copyright notices.
[external/binutils.git] / gdb / config / rs6000 / xm-rs6000.h
1 /* Parameters for hosting on an RS6000, for GDB, the GNU debugger.
2    Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
3    2000, 2001 Free Software Foundation, Inc.
4    Contributed by IBM Corporation.
5
6    This file is part of GDB.
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place - Suite 330,
21    Boston, MA 02111-1307, USA.  */
22
23 /* The following text is taken from config/rs6000.mh:
24  * # The IBM version of /usr/include/rpc/rpc.h has a bug -- it says
25  * # `extern fd_set svc_fdset;' without ever defining the type fd_set.
26  * # Unfortunately this occurs in the vx-share code, which is not configured
27  * # like the rest of GDB (e.g. it doesn't include "defs.h").
28  * # We circumvent this bug by #define-ing fd_set here, but undefining it in
29  * # the xm-rs6000.h file before ordinary modules try to use it.  FIXME, IBM!
30  * MH_CFLAGS='-Dfd_set=int'
31  * So, here we do the undefine...which has to occur before we include
32  * <sys/select.h> below.
33  */
34 #undef fd_set
35
36 #include <sys/select.h>
37
38 /* Big end is at the low address */
39
40 #define HOST_BYTE_ORDER BIG_ENDIAN
41
42 /* At least as of AIX 3.2, we have termios.  */
43 #define HAVE_TERMIOS 1
44 /* #define HAVE_TERMIO 1 */
45
46 #define USG 1
47 #define HAVE_SIGSETMASK 1
48
49 #define FIVE_ARG_PTRACE
50
51 /* This system requires that we open a terminal with O_NOCTTY for it to
52    not become our controlling terminal.  */
53
54 #define USE_O_NOCTTY
55
56 /* Brain death inherited from PC's pervades.  */
57 #undef NULL
58 #define NULL 0
59
60 /* The IBM compiler requires this in order to properly compile alloca().  */
61 #pragma alloca
62
63 /* There is no vfork.  */
64
65 #define vfork   fork
66
67 /* Setpgrp() takes arguments, unlike ordinary Sys V's.  */
68
69 #define SETPGRP_ARGS 1
70
71 /* Signal handler for SIGWINCH `window size changed'. */
72
73 #define SIGWINCH_HANDLER  aix_resizewindow
74 extern void aix_resizewindow (int);
75
76 /* This doesn't seem to be declared in any header file I can find.  */
77 char *termdef (int, int);
78
79 /* `lines_per_page' and `chars_per_line' are local to utils.c. Rectify this. */
80
81 #define SIGWINCH_HANDLER_BODY   \
82                                                                         \
83 /* Respond to SIGWINCH `window size changed' signal, and reset GDB's    \
84    window settings appropriately. */                                    \
85                                                                         \
86 void                                            \
87 aix_resizewindow (signo)                        \
88      int signo;                                 \
89 {                                               \
90   int fd = fileno (stdout);                     \
91   if (isatty (fd)) {                            \
92     int val;                                    \
93                                                 \
94     val = atoi (termdef (fd, 'l'));             \
95     if (val > 0)                                \
96       lines_per_page = val;                     \
97     val = atoi (termdef (fd, 'c'));             \
98     if (val > 0)                                \
99       chars_per_line = val;                     \
100   }                                             \
101 }
102
103 /* setpgrp() messes up controling terminal. The other version of it
104    requires libbsd.a. */
105 #define setpgrp(XX,YY)          setpgid (XX, YY)