Statistics
| Branch: | Revision:

root / linux-user / i386 / syscall.h @ 93148aa5

History | View | Annotate | Download (3.5 kB)

1 2c0262af bellard
/* default linux values for the selectors */
2 2c0262af bellard
#define __USER_CS        (0x23)
3 2c0262af bellard
#define __USER_DS        (0x2B)
4 2c0262af bellard
5 2c0262af bellard
struct target_pt_regs {
6 2c0262af bellard
        long ebx;
7 2c0262af bellard
        long ecx;
8 2c0262af bellard
        long edx;
9 2c0262af bellard
        long esi;
10 2c0262af bellard
        long edi;
11 2c0262af bellard
        long ebp;
12 2c0262af bellard
        long eax;
13 2c0262af bellard
        int  xds;
14 2c0262af bellard
        int  xes;
15 2c0262af bellard
        long orig_eax;
16 2c0262af bellard
        long eip;
17 2c0262af bellard
        int  xcs;
18 2c0262af bellard
        long eflags;
19 2c0262af bellard
        long esp;
20 2c0262af bellard
        int  xss;
21 2c0262af bellard
};
22 2c0262af bellard
23 2c0262af bellard
/* ioctls */
24 2c0262af bellard
25 2c0262af bellard
#define TARGET_LDT_ENTRIES      8192
26 2c0262af bellard
#define TARGET_LDT_ENTRY_SIZE        8
27 2c0262af bellard
28 8d18e893 bellard
#define TARGET_GDT_ENTRIES             9
29 2c0262af bellard
#define TARGET_GDT_ENTRY_TLS_ENTRIES   3
30 2c0262af bellard
#define TARGET_GDT_ENTRY_TLS_MIN       6
31 2c0262af bellard
#define TARGET_GDT_ENTRY_TLS_MAX       (TARGET_GDT_ENTRY_TLS_MIN + TARGET_GDT_ENTRY_TLS_ENTRIES - 1)
32 2c0262af bellard
33 2c0262af bellard
struct target_modify_ldt_ldt_s {
34 2c0262af bellard
    unsigned int  entry_number;
35 992f48a0 blueswir1
    abi_ulong base_addr;
36 2c0262af bellard
    unsigned int limit;
37 2c0262af bellard
    unsigned int flags;
38 2c0262af bellard
};
39 2c0262af bellard
40 2c0262af bellard
/* vm86 defines */
41 2c0262af bellard
42 2c0262af bellard
#define TARGET_BIOSSEG                0x0f000
43 2c0262af bellard
44 2c0262af bellard
#define TARGET_CPU_086                0
45 2c0262af bellard
#define TARGET_CPU_186                1
46 2c0262af bellard
#define TARGET_CPU_286                2
47 2c0262af bellard
#define TARGET_CPU_386                3
48 2c0262af bellard
#define TARGET_CPU_486                4
49 2c0262af bellard
#define TARGET_CPU_586                5
50 2c0262af bellard
51 2c0262af bellard
#define TARGET_VM86_SIGNAL        0        /* return due to signal */
52 2c0262af bellard
#define TARGET_VM86_UNKNOWN        1        /* unhandled GP fault - IO-instruction or similar */
53 2c0262af bellard
#define TARGET_VM86_INTx        2        /* int3/int x instruction (ARG = x) */
54 2c0262af bellard
#define TARGET_VM86_STI        3        /* sti/popf/iret instruction enabled virtual interrupts */
55 2c0262af bellard
56 2c0262af bellard
/*
57 2c0262af bellard
 * Additional return values when invoking new vm86()
58 2c0262af bellard
 */
59 2c0262af bellard
#define TARGET_VM86_PICRETURN        4        /* return due to pending PIC request */
60 2c0262af bellard
#define TARGET_VM86_TRAP        6        /* return due to DOS-debugger request */
61 2c0262af bellard
62 2c0262af bellard
/*
63 2c0262af bellard
 * function codes when invoking new vm86()
64 2c0262af bellard
 */
65 2c0262af bellard
#define TARGET_VM86_PLUS_INSTALL_CHECK        0
66 2c0262af bellard
#define TARGET_VM86_ENTER                1
67 2c0262af bellard
#define TARGET_VM86_ENTER_NO_BYPASS        2
68 2c0262af bellard
#define        TARGET_VM86_REQUEST_IRQ        3
69 2c0262af bellard
#define TARGET_VM86_FREE_IRQ                4
70 2c0262af bellard
#define TARGET_VM86_GET_IRQ_BITS        5
71 2c0262af bellard
#define TARGET_VM86_GET_AND_RESET_IRQ        6
72 2c0262af bellard
73 2c0262af bellard
/*
74 2c0262af bellard
 * This is the stack-layout seen by the user space program when we have
75 2c0262af bellard
 * done a translation of "SAVE_ALL" from vm86 mode. The real kernel layout
76 2c0262af bellard
 * is 'kernel_vm86_regs' (see below).
77 2c0262af bellard
 */
78 2c0262af bellard
79 2c0262af bellard
struct target_vm86_regs {
80 2c0262af bellard
/*
81 2c0262af bellard
 * normal regs, with special meaning for the segment descriptors..
82 2c0262af bellard
 */
83 992f48a0 blueswir1
        abi_long ebx;
84 992f48a0 blueswir1
        abi_long ecx;
85 992f48a0 blueswir1
        abi_long edx;
86 992f48a0 blueswir1
        abi_long esi;
87 992f48a0 blueswir1
        abi_long edi;
88 992f48a0 blueswir1
        abi_long ebp;
89 992f48a0 blueswir1
        abi_long eax;
90 992f48a0 blueswir1
        abi_long __null_ds;
91 992f48a0 blueswir1
        abi_long __null_es;
92 992f48a0 blueswir1
        abi_long __null_fs;
93 992f48a0 blueswir1
        abi_long __null_gs;
94 992f48a0 blueswir1
        abi_long orig_eax;
95 992f48a0 blueswir1
        abi_long eip;
96 2c0262af bellard
        unsigned short cs, __csh;
97 992f48a0 blueswir1
        abi_long eflags;
98 992f48a0 blueswir1
        abi_long esp;
99 2c0262af bellard
        unsigned short ss, __ssh;
100 2c0262af bellard
/*
101 2c0262af bellard
 * these are specific to v86 mode:
102 2c0262af bellard
 */
103 2c0262af bellard
        unsigned short es, __esh;
104 2c0262af bellard
        unsigned short ds, __dsh;
105 2c0262af bellard
        unsigned short fs, __fsh;
106 2c0262af bellard
        unsigned short gs, __gsh;
107 2c0262af bellard
};
108 2c0262af bellard
109 2c0262af bellard
struct target_revectored_struct {
110 992f48a0 blueswir1
        abi_ulong __map[8];                        /* 256 bits */
111 2c0262af bellard
};
112 2c0262af bellard
113 2c0262af bellard
struct target_vm86_struct {
114 2c0262af bellard
        struct target_vm86_regs regs;
115 992f48a0 blueswir1
        abi_ulong flags;
116 992f48a0 blueswir1
        abi_ulong screen_bitmap;
117 992f48a0 blueswir1
        abi_ulong cpu_type;
118 2c0262af bellard
        struct target_revectored_struct int_revectored;
119 2c0262af bellard
        struct target_revectored_struct int21_revectored;
120 2c0262af bellard
};
121 2c0262af bellard
122 2c0262af bellard
/*
123 2c0262af bellard
 * flags masks
124 2c0262af bellard
 */
125 2c0262af bellard
#define TARGET_VM86_SCREEN_BITMAP        0x0001
126 2c0262af bellard
127 2c0262af bellard
struct target_vm86plus_info_struct {
128 992f48a0 blueswir1
        abi_ulong flags;
129 2c0262af bellard
#define TARGET_force_return_for_pic (1 << 0)
130 2c0262af bellard
#define TARGET_vm86dbg_active       (1 << 1)  /* for debugger */
131 2c0262af bellard
#define TARGET_vm86dbg_TFpendig     (1 << 2)  /* for debugger */
132 2c0262af bellard
#define TARGET_is_vm86pus           (1 << 31) /* for vm86 internal use */
133 2c0262af bellard
        unsigned char vm86dbg_intxxtab[32];   /* for debugger */
134 2c0262af bellard
};
135 2c0262af bellard
136 2c0262af bellard
struct target_vm86plus_struct {
137 2c0262af bellard
        struct target_vm86_regs regs;
138 992f48a0 blueswir1
        abi_ulong flags;
139 992f48a0 blueswir1
        abi_ulong screen_bitmap;
140 992f48a0 blueswir1
        abi_ulong cpu_type;
141 2c0262af bellard
        struct target_revectored_struct int_revectored;
142 2c0262af bellard
        struct target_revectored_struct int21_revectored;
143 2c0262af bellard
        struct target_vm86plus_info_struct vm86plus;
144 2c0262af bellard
};
145 2c0262af bellard
146 cf720db3 bellard
#define UNAME_MACHINE "i686"