1/*
2 * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de.
3 * Distributed under the terms of the MIT License.
4 *
5 * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
6 * Distributed under the terms of the NewOS License.
7 */
8#ifndef _KERNEL_ARCH_X86_32_IFRAME_H
9#define _KERNEL_ARCH_X86_32_IFRAME_H
10
11
12struct iframe {
13	uint32 type;	// iframe type
14	uint32 gs;
15	uint32 fs;
16	uint32 es;
17	uint32 ds;
18	uint32 di;
19	uint32 si;
20	uint32 bp;
21	uint32 sp;
22	uint32 bx;
23	uint32 dx;
24	uint32 cx;
25	uint32 ax;
26	uint32 orig_eax;
27	uint32 orig_edx;
28	uint32 vector;
29	uint32 error_code;
30	uint32 ip;
31	uint32 cs;
32	uint32 flags;
33
34	// user_sp and user_ss are only present when the iframe is a userland
35	// iframe (IFRAME_IS_USER()). A kernel iframe is shorter.
36	uint32 user_sp;
37	uint32 user_ss;
38};
39
40#define IFRAME_IS_USER(f)	((f)->cs == USER_CODE_SELECTOR \
41								|| ((f)->flags & 0x20000) != 0)
42
43
44#endif	/* _KERNEL_ARCH_X86_32_IFRAME_H */
45