xref: /original-bsd/sys/vax/include/pcb.h (revision 26e4b21d)
1 /*	pcb.h	4.5	81/05/14	*/
2 
3 /*
4  * VAX process control block
5  */
6 
7 struct pcb
8 {
9 	int	pcb_ksp; 	/* kernel stack pointer */
10 	int	pcb_esp; 	/* exec stack pointer */
11 	int	pcb_ssp; 	/* supervisor stack pointer */
12 	int	pcb_usp; 	/* user stack pointer */
13 	int	pcb_r0;
14 	int	pcb_r1;
15 	int	pcb_r2;
16 	int	pcb_r3;
17 	int	pcb_r4;
18 	int	pcb_r5;
19 	int	pcb_r6;
20 	int	pcb_r7;
21 	int	pcb_r8;
22 	int	pcb_r9;
23 	int	pcb_r10;
24 	int	pcb_r11;
25 	int	pcb_r12;
26 #define	pcb_ap pcb_r12
27 	int	pcb_r13;
28 #define	pcb_fp pcb_r13
29 	int	pcb_pc; 	/* program counter */
30 	int	pcb_psl; 	/* program status longword */
31 	struct  pte *pcb_p0br; 	/* seg 0 base register */
32 	int	pcb_p0lr; 	/* seg 0 length register and astlevel */
33 	struct  pte *pcb_p1br; 	/* seg 1 base register */
34 	int	pcb_p1lr; 	/* seg 1 length register and pme */
35 /*
36  * Software pcb (extension)
37  */
38 	int	pcb_szpt; 	/* number of pages of user page table */
39 	int	pcb_cmap2;
40 	int	*pcb_sswap;
41 	int	pcb_sigc[3];
42 };
43 
44 #define	AST_NONE	0x04000000	/* ast level */
45 #define	AST_USER	0x03000000	/* ast for user mode */
46 
47 #define	ASTLVL_NONE	4
48 #define	ASTLVL_USER	3
49 
50 #define	AST_CLR		0x07000000
51 
52 #define	aston() \
53 	{ \
54 		u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_USER; \
55 		mtpr(ASTLVL, ASTLVL_USER); \
56 	}
57 
58 #define	astoff() \
59 	{ \
60 		u.u_pcb.pcb_p0lr = (u.u_pcb.pcb_p0lr &~ AST_CLR) | AST_NONE; \
61 		mtpr(ASTLVL, ASTLVL_NONE); \
62 	}
63