xref: /haiku/headers/private/kernel/arch/x86/64/iframe.h (revision cc30eec43d7b2a525040edc8d3879f21bb1c0c2d)
10897e314SAlex Smith /*
20897e314SAlex Smith  * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
30897e314SAlex Smith  * Distributed under the terms of the MIT License.
40897e314SAlex Smith  */
50897e314SAlex Smith #ifndef _KERNEL_ARCH_X86_64_IFRAME_H
60897e314SAlex Smith #define _KERNEL_ARCH_X86_64_IFRAME_H
70897e314SAlex Smith 
80897e314SAlex Smith 
90897e314SAlex Smith struct iframe {
100897e314SAlex Smith 	uint64 type;
110897e314SAlex Smith 	uint64 r15;
120897e314SAlex Smith 	uint64 r14;
130897e314SAlex Smith 	uint64 r13;
140897e314SAlex Smith 	uint64 r12;
150897e314SAlex Smith 	uint64 r11;
160897e314SAlex Smith 	uint64 r10;
170897e314SAlex Smith 	uint64 r9;
180897e314SAlex Smith 	uint64 r8;
19b5c9d24aSAlex Smith 	uint64 bp;
20b5c9d24aSAlex Smith 	uint64 si;
21b5c9d24aSAlex Smith 	uint64 di;
22b5c9d24aSAlex Smith 	uint64 dx;
23b5c9d24aSAlex Smith 	uint64 cx;
24b5c9d24aSAlex Smith 	uint64 bx;
25b5c9d24aSAlex Smith 	uint64 ax;
26*cc30eec4SAlex Smith 	uint64 orig_rax;
270897e314SAlex Smith 	uint64 vector;
280897e314SAlex Smith 	uint64 error_code;
29b5c9d24aSAlex Smith 	uint64 ip;
300897e314SAlex Smith 	uint64 cs;
310897e314SAlex Smith 	uint64 flags;
320897e314SAlex Smith 
33bcb07a31SAlex Smith 	// SP and SS are unconditionally present on x86_64, make both names
34bcb07a31SAlex Smith 	// available.
35bcb07a31SAlex Smith 	union {
36bcb07a31SAlex Smith 		uint64 sp;
37b5c9d24aSAlex Smith 		uint64 user_sp;
38bcb07a31SAlex Smith 	};
39bcb07a31SAlex Smith 	union {
40bcb07a31SAlex Smith 		uint64 ss;
410897e314SAlex Smith 		uint64 user_ss;
42bcb07a31SAlex Smith 	};
430897e314SAlex Smith } _PACKED;
440897e314SAlex Smith 
450897e314SAlex Smith #define IFRAME_IS_USER(f)	(((f)->cs & DPL_USER) == DPL_USER)
460897e314SAlex Smith 
470897e314SAlex Smith 
480897e314SAlex Smith #endif	/* _KERNEL_ARCH_X86_64_IFRAME_H */
49