xref: /haiku/headers/private/kernel/arch/x86/64/iframe.h (revision 820dca4df6c7bf955c46e8f6521b9408f50b2900)
1 /*
2  * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _KERNEL_ARCH_X86_64_IFRAME_H
6 #define _KERNEL_ARCH_X86_64_IFRAME_H
7 
8 
9 struct iframe {
10 	uint64 type;
11 	uint64 r15;
12 	uint64 r14;
13 	uint64 r13;
14 	uint64 r12;
15 	uint64 r11;
16 	uint64 r10;
17 	uint64 r9;
18 	uint64 r8;
19 	uint64 bp;
20 	uint64 si;
21 	uint64 di;
22 	uint64 dx;
23 	uint64 cx;
24 	uint64 bx;
25 	uint64 ax;
26 	uint64 orig_rax;
27 	uint64 vector;
28 	uint64 error_code;
29 	uint64 ip;
30 	uint64 cs;
31 	uint64 flags;
32 
33 	// SP and SS are unconditionally present on x86_64, make both names
34 	// available.
35 	union {
36 		uint64 sp;
37 		uint64 user_sp;
38 	};
39 	union {
40 		uint64 ss;
41 		uint64 user_ss;
42 	};
43 } _PACKED;
44 
45 #define IFRAME_IS_USER(f)	(((f)->cs & DPL_USER) == DPL_USER)
46 
47 
48 #endif	/* _KERNEL_ARCH_X86_64_IFRAME_H */
49