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