1 |
578 |
markom |
/* OBSOLETE /* Host-dependent code for GDB, for NYU Ultra3 running Sym1 OS. */
|
2 |
|
|
/* OBSOLETE Copyright 1988, 1989, 1991, 1992, 1993, 1995, 2000 */
|
3 |
|
|
/* OBSOLETE Free Software Foundation, Inc. */
|
4 |
|
|
/* OBSOLETE Contributed by David Wood (wood@nyu.edu) at New York University. */
|
5 |
|
|
/* OBSOLETE */
|
6 |
|
|
/* OBSOLETE This file is part of GDB. */
|
7 |
|
|
/* OBSOLETE */
|
8 |
|
|
/* OBSOLETE This program is free software; you can redistribute it and/or modify */
|
9 |
|
|
/* OBSOLETE it under the terms of the GNU General Public License as published by */
|
10 |
|
|
/* OBSOLETE the Free Software Foundation; either version 2 of the License, or */
|
11 |
|
|
/* OBSOLETE (at your option) any later version. */
|
12 |
|
|
/* OBSOLETE */
|
13 |
|
|
/* OBSOLETE This program is distributed in the hope that it will be useful, */
|
14 |
|
|
/* OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of */
|
15 |
|
|
/* OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
|
16 |
|
|
/* OBSOLETE GNU General Public License for more details. */
|
17 |
|
|
/* OBSOLETE */
|
18 |
|
|
/* OBSOLETE You should have received a copy of the GNU General Public License */
|
19 |
|
|
/* OBSOLETE along with this program; if not, write to the Free Software */
|
20 |
|
|
/* OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330, */
|
21 |
|
|
/* OBSOLETE Boston, MA 02111-1307, USA. */ */
|
22 |
|
|
/* OBSOLETE */
|
23 |
|
|
/* OBSOLETE #define DEBUG */
|
24 |
|
|
/* OBSOLETE #include "defs.h" */
|
25 |
|
|
/* OBSOLETE #include "frame.h" */
|
26 |
|
|
/* OBSOLETE #include "inferior.h" */
|
27 |
|
|
/* OBSOLETE #include "symtab.h" */
|
28 |
|
|
/* OBSOLETE #include "value.h" */
|
29 |
|
|
/* OBSOLETE */
|
30 |
|
|
/* OBSOLETE #include <sys/types.h> */
|
31 |
|
|
/* OBSOLETE #include <sys/param.h> */
|
32 |
|
|
/* OBSOLETE #include <signal.h> */
|
33 |
|
|
/* OBSOLETE #include <sys/ioctl.h> */
|
34 |
|
|
/* OBSOLETE #include <fcntl.h> */
|
35 |
|
|
/* OBSOLETE */
|
36 |
|
|
/* OBSOLETE #include "gdbcore.h" */
|
37 |
|
|
/* OBSOLETE */
|
38 |
|
|
/* OBSOLETE #include <sys/file.h> */
|
39 |
|
|
/* OBSOLETE #include "gdb_stat.h" */
|
40 |
|
|
/* OBSOLETE */
|
41 |
|
|
/* OBSOLETE /* Assorted operating system circumventions */ */
|
42 |
|
|
/* OBSOLETE */
|
43 |
|
|
/* OBSOLETE #ifdef SYM1 */
|
44 |
|
|
/* OBSOLETE */
|
45 |
|
|
/* OBSOLETE /* FIXME: Kludge this for now. It really should be system call. */ */
|
46 |
|
|
/* OBSOLETE int */
|
47 |
|
|
/* OBSOLETE getpagesize (void) */
|
48 |
|
|
/* OBSOLETE { */
|
49 |
|
|
/* OBSOLETE return (8192); */
|
50 |
|
|
/* OBSOLETE } */
|
51 |
|
|
/* OBSOLETE */
|
52 |
|
|
/* OBSOLETE /* FIXME: Fake out the fcntl() call, which we don't have. */ */
|
53 |
|
|
/* OBSOLETE fcntl (int fd, int cmd, int arg) */
|
54 |
|
|
/* OBSOLETE { */
|
55 |
|
|
/* OBSOLETE */
|
56 |
|
|
/* OBSOLETE switch (cmd) */
|
57 |
|
|
/* OBSOLETE { */
|
58 |
|
|
/* OBSOLETE case F_GETFL: */
|
59 |
|
|
/* OBSOLETE return (O_RDONLY); */
|
60 |
|
|
/* OBSOLETE break; */
|
61 |
|
|
/* OBSOLETE default: */
|
62 |
|
|
/* OBSOLETE printf_unfiltered ("Ultra3's fcntl() failing, cmd = %d.\n", cmd); */
|
63 |
|
|
/* OBSOLETE return (-1); */
|
64 |
|
|
/* OBSOLETE } */
|
65 |
|
|
/* OBSOLETE } */
|
66 |
|
|
/* OBSOLETE */
|
67 |
|
|
/* OBSOLETE */
|
68 |
|
|
/* OBSOLETE /* */
|
69 |
|
|
/* OBSOLETE * 4.2 Signal support, requires linking with libjobs. */
|
70 |
|
|
/* OBSOLETE */ */
|
71 |
|
|
/* OBSOLETE static int _SigMask; */
|
72 |
|
|
/* OBSOLETE #define sigbit(s) (1L << ((s)-1)) */
|
73 |
|
|
/* OBSOLETE */
|
74 |
|
|
/* OBSOLETE init_SigMask (void) */
|
75 |
|
|
/* OBSOLETE { */
|
76 |
|
|
/* OBSOLETE /* Taken from the sym1 kernel in machdep.c:startup() */ */
|
77 |
|
|
/* OBSOLETE _SigMask = sigbit (SIGTSTP) | sigbit (SIGTTOU) | sigbit (SIGTTIN) | */
|
78 |
|
|
/* OBSOLETE sigbit (SIGCHLD) | sigbit (SIGTINT); */
|
79 |
|
|
/* OBSOLETE } */
|
80 |
|
|
/* OBSOLETE */
|
81 |
|
|
/* OBSOLETE sigmask (int signo) */
|
82 |
|
|
/* OBSOLETE { */
|
83 |
|
|
/* OBSOLETE return (1 << (signo - 1)); */
|
84 |
|
|
/* OBSOLETE } */
|
85 |
|
|
/* OBSOLETE */
|
86 |
|
|
/* OBSOLETE sigsetmask (unsigned int sigmask) */
|
87 |
|
|
/* OBSOLETE { */
|
88 |
|
|
/* OBSOLETE int i, mask = 1; */
|
89 |
|
|
/* OBSOLETE int lastmask = _SigMask; */
|
90 |
|
|
/* OBSOLETE */
|
91 |
|
|
/* OBSOLETE for (i = 0; i < NSIG; i++) */
|
92 |
|
|
/* OBSOLETE { */
|
93 |
|
|
/* OBSOLETE if (sigmask & mask) */
|
94 |
|
|
/* OBSOLETE { */
|
95 |
|
|
/* OBSOLETE if (!(_SigMask & mask)) */
|
96 |
|
|
/* OBSOLETE { */
|
97 |
|
|
/* OBSOLETE sighold (i + 1); */
|
98 |
|
|
/* OBSOLETE _SigMask |= mask; */
|
99 |
|
|
/* OBSOLETE } */
|
100 |
|
|
/* OBSOLETE } */
|
101 |
|
|
/* OBSOLETE else if (_SigMask & mask) */
|
102 |
|
|
/* OBSOLETE { */
|
103 |
|
|
/* OBSOLETE sigrelse (i + 1); */
|
104 |
|
|
/* OBSOLETE _SigMask &= ~mask; */
|
105 |
|
|
/* OBSOLETE } */
|
106 |
|
|
/* OBSOLETE mask <<= 1; */
|
107 |
|
|
/* OBSOLETE } */
|
108 |
|
|
/* OBSOLETE return (lastmask); */
|
109 |
|
|
/* OBSOLETE } */
|
110 |
|
|
/* OBSOLETE */
|
111 |
|
|
/* OBSOLETE sigblock (unsigned int sigmask) */
|
112 |
|
|
/* OBSOLETE { */
|
113 |
|
|
/* OBSOLETE int i, mask = 1; */
|
114 |
|
|
/* OBSOLETE int lastmask = _SigMask; */
|
115 |
|
|
/* OBSOLETE */
|
116 |
|
|
/* OBSOLETE for (i = 0; i < NSIG; i++) */
|
117 |
|
|
/* OBSOLETE { */
|
118 |
|
|
/* OBSOLETE if ((sigmask & mask) && !(_SigMask & mask)) */
|
119 |
|
|
/* OBSOLETE { */
|
120 |
|
|
/* OBSOLETE sighold (i + 1); */
|
121 |
|
|
/* OBSOLETE _SigMask |= mask; */
|
122 |
|
|
/* OBSOLETE } */
|
123 |
|
|
/* OBSOLETE mask <<= 1; */
|
124 |
|
|
/* OBSOLETE } */
|
125 |
|
|
/* OBSOLETE return (lastmask); */
|
126 |
|
|
/* OBSOLETE } */
|
127 |
|
|
/* OBSOLETE #endif /* SYM1 */ */
|
128 |
|
|
/* OBSOLETE */
|
129 |
|
|
/* OBSOLETE */
|
130 |
|
|
/* OBSOLETE /* Initialization code for this module. */ */
|
131 |
|
|
/* OBSOLETE */
|
132 |
|
|
/* OBSOLETE void */
|
133 |
|
|
/* OBSOLETE _initialize_ultra3 (void) */
|
134 |
|
|
/* OBSOLETE { */
|
135 |
|
|
/* OBSOLETE #ifdef SYM1 */
|
136 |
|
|
/* OBSOLETE init_SigMask (); */
|
137 |
|
|
/* OBSOLETE #endif */
|
138 |
|
|
/* OBSOLETE } */
|