1/* Copyright (c) 1982 Regents of the University of California */
2
3/* static char sccsid[] = "@(#)process.rep 1.2 01/18/82"; */
4
5/*
6 * This file defines the representation of a process.
7 * It is MACHINE DEPENDENT.
8 */
9
10#define STOPPED 0177
11#define FINISHED 0
12
13#define NREG 12			/* maximum number of saved registers */
14#define CSIZE 101		/* size of instruction cache */
15
16/*
17 * Cache-ing of instruction segment is done to reduce the number
18 * of calls to ptrace.
19 */
20
21typedef struct {
22	WORD addr;
23	WORD val;
24} CACHEWORD;
25
26/*
27 * This structure holds the information we need from the user structure.
28 */
29
30struct process {
31	int pid;		/* process being traced */
32	WORD reg[NREG];		/* process's registers */
33	WORD ap, fp, sp, pc;	/* special registers */
34	WORD oreg[NREG];	/* registers when process last stopped */
35	WORD oap, ofp, osp, opc;/* special registers when process stopped */
36	int status;		/* either STOPPED or FINISHED */
37	int signo;		/* signal that stopped process */
38	int exitval;		/* return value from exit() */
39	long sigset;		/* bit array of traced signals */
40	CACHEWORD word[CSIZE];	/* text segment cache */
41};
42
43/*
44 * Process manipulation routines local to this module.
45 */
46
47pstart();			/* start up a process */
48pcont();			/* continue execution */
49pstep();			/* single step */
50pio();				/* process memory move */
51psigtrace();			/* catch/don't catch a signal */
52unsetsigtraces();		/* don't catch any signals */
53
54/*
55 * These definitions are for the arguments to "pio".
56 */
57
58typedef enum { PREAD, PWRITE } PIO_OP;
59typedef enum { TEXTSEG, DATASEG } PIO_SEG;
60