xref: /original-bsd/sys/i386/include/reg.h (revision bacd16ee)
1 /*-
2  * Copyright (c) 1990, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * William Jolitz.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)reg.h	8.1 (Berkeley) 06/11/93
11  */
12 
13 /*
14  * Location of the users' stored
15  * registers within appropriate frame of 'trap' and 'syscall', relative to
16  * base of stack frame.
17  * Normal usage is u.u_ar0[XX] in kernel.
18  */
19 
20 /* When referenced during a trap/exception, registers are at these offsets */
21 
22 #define	tES	(0)
23 #define	tDS	(1)
24 #define	tEDI	(2)
25 #define	tESI	(3)
26 #define	tEBP	(4)
27 
28 #define	tEBX	(6)
29 #define	tEDX	(7)
30 #define	tECX	(8)
31 #define	tEAX	(9)
32 
33 #define	tEIP	(12)
34 #define	tCS	(13)
35 #define	tEFLAGS	(14)
36 #define	tESP	(15)
37 #define	tSS	(16)
38 
39 /* During a system call, registers are at these offsets instead of above. */
40 
41 #define	sEDI	(0)
42 #define	sESI	(1)
43 #define	sEBP	(2)
44 
45 #define	sEBX	(4)
46 #define	sEDX	(5)
47 #define	sECX	(6)
48 #define	sEAX	(7)
49 #define	sEFLAGS	(8)
50 #define	sEIP	(9)
51 #define	sCS	(10)
52 #define	sESP	(11)
53 #define	sSS	(12)
54 
55 #define	PC	sEIP
56 #define	SP	sESP
57 #define	PS	sEFLAGS
58 #define	R0	sEDX
59 #define	R1	sECX
60 /*
61  * Registers accessible to ptrace(2) syscall for debugger
62  */
63 #ifdef IPCREG
64 #define	NIPCREG 14
65 int ipcreg[NIPCREG] =
66   { tES,tDS,tEDI,tESI,tEBP,tEBX,tEDX,tECX,tEAX,tEIP,tCS,tEFLAGS,tESP,tSS };
67 #endif
68