1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 #ifndef _UAPI_ASM_X86_VM86_H
3 #define _UAPI_ASM_X86_VM86_H
6 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
7 * the Pentium uses them. Linux will return from vm86 mode when both
10 * On a Pentium, we could probably optimize the virtual flags directly
11 * in the eflags register instead of doing it "by hand" in vflags...
16 #include <asm/processor-flags.h>
18 #define BIOSSEG 0x0f000
28 * Return values for the 'vm86()' system call
30 #define VM86_TYPE(retval) ((retval) & 0xff)
31 #define VM86_ARG(retval) ((retval) >> 8)
33 #define VM86_SIGNAL 0 /* return due to signal */
34 #define VM86_UNKNOWN 1 /* unhandled GP fault
35 - IO-instruction or similar */
36 #define VM86_INTx 2 /* int3/int x instruction (ARG = x) */
37 #define VM86_STI 3 /* sti/popf/iret instruction enabled
41 * Additional return values when invoking new vm86()
43 #define VM86_PICRETURN 4 /* return due to pending PIC request */
44 #define VM86_TRAP 6 /* return due to DOS-debugger request */
47 * function codes when invoking new vm86()
49 #define VM86_PLUS_INSTALL_CHECK 0
51 #define VM86_ENTER_NO_BYPASS 2
52 #define VM86_REQUEST_IRQ 3
53 #define VM86_FREE_IRQ 4
54 #define VM86_GET_IRQ_BITS 5
55 #define VM86_GET_AND_RESET_IRQ 6
58 * This is the stack-layout seen by the user space program when we have
59 * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
60 * is 'kernel_vm86_regs' (see below).
65 * normal regs, with special meaning for the segment descriptors..
80 unsigned short cs
, __csh
;
83 unsigned short ss
, __ssh
;
85 * these are specific to v86 mode:
87 unsigned short es
, __esh
;
88 unsigned short ds
, __dsh
;
89 unsigned short fs
, __fsh
;
90 unsigned short gs
, __gsh
;
93 struct revectored_struct
{
94 unsigned long __map
[8]; /* 256 bits */
98 struct vm86_regs regs
;
100 unsigned long screen_bitmap
; /* unused, preserved by vm86() */
101 unsigned long cpu_type
;
102 struct revectored_struct int_revectored
;
103 struct revectored_struct int21_revectored
;
109 #define VM86_SCREEN_BITMAP 0x0001 /* no longer supported */
111 struct vm86plus_info_struct
{
112 unsigned long force_return_for_pic
:1;
113 unsigned long vm86dbg_active
:1; /* for debugger */
114 unsigned long vm86dbg_TFpendig
:1; /* for debugger */
115 unsigned long unused
:28;
116 unsigned long is_vm86pus
:1; /* for vm86 internal use */
117 unsigned char vm86dbg_intxxtab
[32]; /* for debugger */
119 struct vm86plus_struct
{
120 struct vm86_regs regs
;
122 unsigned long screen_bitmap
;
123 unsigned long cpu_type
;
124 struct revectored_struct int_revectored
;
125 struct revectored_struct int21_revectored
;
126 struct vm86plus_info_struct vm86plus
;
130 #endif /* _UAPI_ASM_X86_VM86_H */