new copyright; att/bsd/shared
[unix-history] / usr / src / usr.bin / pascal / pdx / process / process.rep
CommitLineData
505bf312
KB
1/*-
2 * Copyright (c) 1982 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * %sccs.include.redist.c%
023ccbaf 6 *
505bf312 7 * @(#)process.rep 5.5 (Berkeley) %G%
50ad1403 8 */
ca0bf12f 9
7a1812dd
ML
10/*
11 * This file defines the representation of a process.
12 * It is MACHINE DEPENDENT.
13 */
14
15#define STOPPED 0177
16#define FINISHED 0
17
ca0bf12f 18#ifdef vax
7a1812dd 19#define NREG 12 /* maximum number of saved registers */
82d3cd01
KM
20#endif
21#ifdef tahoe
22#define NREG 13
23#endif
24#ifdef mc68000
ca0bf12f
ML
25#define NREG 14 /* maximum number of saved registers */
26#endif
7a1812dd
ML
27#define CSIZE 101 /* size of instruction cache */
28
29/*
30 * Cache-ing of instruction segment is done to reduce the number
31 * of calls to ptrace.
32 */
33
34typedef struct {
35 WORD addr;
36 WORD val;
37} CACHEWORD;
38
39/*
40 * This structure holds the information we need from the user structure.
41 */
42
43struct process {
44 int pid; /* process being traced */
45 WORD reg[NREG]; /* process's registers */
82d3cd01
KM
46#ifdef tahoe
47 WORD fp, sp, pc; /* special registers */
48#else
7a1812dd 49 WORD ap, fp, sp, pc; /* special registers */
82d3cd01 50#endif
7a1812dd
ML
51 WORD oreg[NREG]; /* registers when process last stopped */
52 WORD oap, ofp, osp, opc;/* special registers when process stopped */
53 int status; /* either STOPPED or FINISHED */
54 int signo; /* signal that stopped process */
55 int exitval; /* return value from exit() */
56 long sigset; /* bit array of traced signals */
57 CACHEWORD word[CSIZE]; /* text segment cache */
58};
59
60/*
61 * Process manipulation routines local to this module.
62 */
63
7d4de299
KB
64int pstart(); /* start up a process */
65int pcont(); /* continue execution */
66int pstep(); /* single step */
67int pio(); /* process memory move */
68int psigtrace(); /* catch/don't catch a signal */
69int unsetsigtraces(); /* don't catch any signals */
7a1812dd
ML
70
71/*
72 * These definitions are for the arguments to "pio".
73 */
74
75typedef enum { PREAD, PWRITE } PIO_OP;
76typedef enum { TEXTSEG, DATASEG } PIO_SEG;
82d3cd01
KM
77
78/* macros for things that used to be functions */
79
80#define iread(buf, addr, nbytes) dread(buf, addr+ENDOFF, nbytes)
81#define iwrite(buf, addr, nbytes) dwrite(buf, addr+ENDOFF, nbytes)
7d4de299
KB
82#define dread(buf, addr, nbytes) drdwr(PREAD, buf, addr, nbytes)
83#define dwrite(buf, addr, nbytes) drdwr(PWRITE, buf, addr, nbytes)