OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [uclinux/] [uC-libc/] [include/] [sys/] [vm86.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
#if !__AS386_16__
2
 
3
#ifndef _SYS_VM86_H
4
#define _SYS_VM86_H
5
 
6
#include <features.h>
7
#ifndef _LINUX_VM86_H
8
#define _LINUX_VM86_H
9
 
10
/*
11
 * I'm guessing at the VIF/VIP flag usage, but hope that this is how
12
 * the Pentium uses them. Linux will return from vm86 mode when both
13
 * VIF and VIP is set.
14
 *
15
 * On a Pentium, we could probably optimize the virtual flags directly
16
 * in the eflags register instead of doing it "by hand" in vflags...
17
 *
18
 * Linus
19
 */
20
 
21
#define TF_MASK         0x00000100
22
#define IF_MASK         0x00000200
23
#define IOPL_MASK       0x00003000
24
#define NT_MASK         0x00004000
25
#define VM_MASK         0x00020000
26
#define AC_MASK         0x00040000
27
#define VIF_MASK        0x00080000      /* virtual interrupt flag */
28
#define VIP_MASK        0x00100000      /* virtual interrupt pending */
29
#define ID_MASK         0x00200000
30
 
31
#define BIOSSEG         0x0f000
32
 
33
#define CPU_086         0
34
#define CPU_186         1
35
#define CPU_286         2
36
#define CPU_386         3
37
#define CPU_486         4
38
#define CPU_586         5
39
 
40
/*
41
 * Return values for the 'vm86()' system call
42
 */
43
#define VM86_TYPE(retval)       ((retval) & 0xff)
44
#define VM86_ARG(retval)        ((retval) >> 8)
45
 
46
#define VM86_SIGNAL     0        /* return due to signal */
47
#define VM86_UNKNOWN    1       /* unhandled GP fault - IO-instruction or similar */
48
#define VM86_INTx       2       /* int3/int x instruction (ARG = x) */
49
#define VM86_STI        3       /* sti/popf/iret instruction enabled virtual interrupts */
50
 
51
/*
52
 * This is the stack-layout when we have done a "SAVE_ALL" from vm86
53
 * mode - the main change is that the old segment descriptors aren't
54
 * useful any more and are forced to be zero by the kernel (and the
55
 * hardware when a trap occurs), and the real segment descriptors are
56
 * at the end of the structure. Look at ptrace.h to see the "normal"
57
 * setup.
58
 */
59
 
60
struct vm86_regs {
61
/*
62
 * normal regs, with special meaning for the segment descriptors..
63
 */
64
        long ebx;
65
        long ecx;
66
        long edx;
67
        long esi;
68
        long edi;
69
        long ebp;
70
        long eax;
71
        long __null_ds;
72
        long __null_es;
73
        long __null_fs;
74
        long __null_gs;
75
        long orig_eax;
76
        long eip;
77
        unsigned short cs, __csh;
78
        long eflags;
79
        long esp;
80
        unsigned short ss, __ssh;
81
/*
82
 * these are specific to v86 mode:
83
 */
84
        unsigned short es, __esh;
85
        unsigned short ds, __dsh;
86
        unsigned short fs, __fsh;
87
        unsigned short gs, __gsh;
88
};
89
 
90
struct revectored_struct {
91
        unsigned long __map[8];                 /* 256 bits */
92
};
93
 
94
struct vm86_struct {
95
        struct vm86_regs regs;
96
        unsigned long flags;
97
        unsigned long screen_bitmap;
98
        unsigned long cpu_type;
99
        struct revectored_struct int_revectored;
100
        struct revectored_struct int21_revectored;
101
};
102
 
103
/*
104
 * flags masks
105
 */
106
#define VM86_SCREEN_BITMAP      0x0001
107
 
108
#ifdef __KERNEL__
109
 
110
void handle_vm86_fault(struct vm86_regs *, long);
111
void handle_vm86_debug(struct vm86_regs *, long);
112
 
113
#endif
114
 
115
#endif
116
 
117
__BEGIN_DECLS
118
 
119
extern vm86(struct vm86_struct * __info);
120
 
121
__END_DECLS
122
 
123
#endif /*_SYS_VM86_H */
124
 
125
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.