Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
631271d7
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
631271d7
编写于
5月 10, 2003
作者:
B
bellard
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added vm86.c
git-svn-id:
svn://svn.savannah.nongnu.org/qemu/trunk@143
c046a42c-6fe2-441c-8c8c-71466251a162
上级
9d27abd9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
11 addition
and
73 deletion
+11
-73
linux-user/qemu.h
linux-user/qemu.h
+11
-1
linux-user/syscall.c
linux-user/syscall.c
+0
-72
未找到文件。
linux-user/qemu.h
浏览文件 @
631271d7
...
...
@@ -54,6 +54,8 @@ typedef struct TaskState {
struct
TaskState
*
next
;
struct
target_vm86plus_struct
*
target_v86
;
struct
vm86_saved_state
vm86_saved_regs
;
uint32_t
v86flags
;
uint32_t
v86mask
;
int
used
;
/* non zero if used */
uint8_t
stack
[
0
];
}
__attribute__
((
aligned
(
16
)))
TaskState
;
...
...
@@ -73,9 +75,17 @@ void cpu_loop(CPUX86State *env);
void
process_pending_signals
(
void
*
cpu_env
);
void
signal_init
(
void
);
int
queue_signal
(
int
sig
,
target_siginfo_t
*
info
);
void
save_v86_state
(
CPUX86State
*
env
);
void
init_paths
(
const
char
*
prefix
);
const
char
*
path
(
const
char
*
pathname
);
extern
int
loglevel
;
extern
FILE
*
logfile
;
/* vm86.c */
void
save_v86_state
(
CPUX86State
*
env
);
void
do_int
(
CPUX86State
*
env
,
int
intno
);
void
handle_vm86_fault
(
CPUX86State
*
env
);
int
do_vm86
(
CPUX86State
*
env
,
long
subfunction
,
struct
target_vm86plus_struct
*
target_v86
);
#endif
linux-user/syscall.c
浏览文件 @
631271d7
...
...
@@ -1058,78 +1058,6 @@ int do_modify_ldt(CPUX86State *env, int func, void *ptr, unsigned long bytecount
return
ret
;
}
/* vm86 emulation */
#define SAFE_MASK (0xDD5)
int
do_vm86
(
CPUX86State
*
env
,
long
subfunction
,
struct
target_vm86plus_struct
*
target_v86
)
{
TaskState
*
ts
=
env
->
opaque
;
int
ret
;
switch
(
subfunction
)
{
case
TARGET_VM86_REQUEST_IRQ
:
case
TARGET_VM86_FREE_IRQ
:
case
TARGET_VM86_GET_IRQ_BITS
:
case
TARGET_VM86_GET_AND_RESET_IRQ
:
gemu_log
(
"qemu: unsupported vm86 subfunction (%ld)
\n
"
,
subfunction
);
ret
=
-
EINVAL
;
goto
out
;
case
TARGET_VM86_PLUS_INSTALL_CHECK
:
/* NOTE: on old vm86 stuff this will return the error
from verify_area(), because the subfunction is
interpreted as (invalid) address to vm86_struct.
So the installation check works.
*/
ret
=
0
;
goto
out
;
}
ts
->
target_v86
=
target_v86
;
/* save current CPU regs */
ts
->
vm86_saved_regs
.
eax
=
0
;
/* default vm86 syscall return code */
ts
->
vm86_saved_regs
.
ebx
=
env
->
regs
[
R_EBX
];
ts
->
vm86_saved_regs
.
ecx
=
env
->
regs
[
R_ECX
];
ts
->
vm86_saved_regs
.
edx
=
env
->
regs
[
R_EDX
];
ts
->
vm86_saved_regs
.
esi
=
env
->
regs
[
R_ESI
];
ts
->
vm86_saved_regs
.
edi
=
env
->
regs
[
R_EDI
];
ts
->
vm86_saved_regs
.
ebp
=
env
->
regs
[
R_EBP
];
ts
->
vm86_saved_regs
.
esp
=
env
->
regs
[
R_ESP
];
ts
->
vm86_saved_regs
.
eflags
=
env
->
eflags
;
ts
->
vm86_saved_regs
.
eip
=
env
->
eip
;
ts
->
vm86_saved_regs
.
cs
=
env
->
segs
[
R_CS
];
ts
->
vm86_saved_regs
.
ss
=
env
->
segs
[
R_SS
];
ts
->
vm86_saved_regs
.
ds
=
env
->
segs
[
R_DS
];
ts
->
vm86_saved_regs
.
es
=
env
->
segs
[
R_ES
];
ts
->
vm86_saved_regs
.
fs
=
env
->
segs
[
R_FS
];
ts
->
vm86_saved_regs
.
gs
=
env
->
segs
[
R_GS
];
/* build vm86 CPU state */
env
->
eflags
=
(
env
->
eflags
&
~
SAFE_MASK
)
|
(
tswap32
(
target_v86
->
regs
.
eflags
)
&
SAFE_MASK
)
|
VM_MASK
;
env
->
regs
[
R_EBX
]
=
tswap32
(
target_v86
->
regs
.
ebx
);
env
->
regs
[
R_ECX
]
=
tswap32
(
target_v86
->
regs
.
ecx
);
env
->
regs
[
R_EDX
]
=
tswap32
(
target_v86
->
regs
.
edx
);
env
->
regs
[
R_ESI
]
=
tswap32
(
target_v86
->
regs
.
esi
);
env
->
regs
[
R_EDI
]
=
tswap32
(
target_v86
->
regs
.
edi
);
env
->
regs
[
R_EBP
]
=
tswap32
(
target_v86
->
regs
.
ebp
);
env
->
regs
[
R_ESP
]
=
tswap32
(
target_v86
->
regs
.
esp
);
env
->
eip
=
tswap32
(
target_v86
->
regs
.
eip
);
cpu_x86_load_seg
(
env
,
R_CS
,
tswap16
(
target_v86
->
regs
.
cs
));
cpu_x86_load_seg
(
env
,
R_SS
,
tswap16
(
target_v86
->
regs
.
ss
));
cpu_x86_load_seg
(
env
,
R_DS
,
tswap16
(
target_v86
->
regs
.
ds
));
cpu_x86_load_seg
(
env
,
R_ES
,
tswap16
(
target_v86
->
regs
.
es
));
cpu_x86_load_seg
(
env
,
R_FS
,
tswap16
(
target_v86
->
regs
.
fs
));
cpu_x86_load_seg
(
env
,
R_GS
,
tswap16
(
target_v86
->
regs
.
gs
));
ret
=
tswap32
(
target_v86
->
regs
.
eax
);
/* eax will be restored at
the end of the syscall */
/* now the virtual CPU is ready for vm86 execution ! */
out:
return
ret
;
}
/* this stack is the equivalent of the kernel stack associated with a
thread/process */
#define NEW_STACK_SIZE 8192
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录