Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
dda96d8f
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dda96d8f
编写于
11月 26, 2008
作者:
A
Avi Kivity
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
KVM: x86 emulator: reduce duplication in one operand emulation thunks
Signed-off-by:
N
Avi Kivity
<
avi@redhat.com
>
上级
ecc5589f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
43 deletion
+23
-43
arch/x86/kvm/x86_emulate.c
arch/x86/kvm/x86_emulate.c
+23
-43
未找到文件。
arch/x86/kvm/x86_emulate.c
浏览文件 @
dda96d8f
...
@@ -359,6 +359,12 @@ static u16 group2_table[] = {
...
@@ -359,6 +359,12 @@ static u16 group2_table[] = {
"andl %"_msk",%"_LO32 _tmp"; " \
"andl %"_msk",%"_LO32 _tmp"; " \
"orl %"_LO32 _tmp",%"_sav"; "
"orl %"_LO32 _tmp",%"_sav"; "
#ifdef CONFIG_X86_64
#define ON64(x) x
#else
#define ON64(x)
#endif
/* Raw emulation: instruction has two explicit operands. */
/* Raw emulation: instruction has two explicit operands. */
#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \
#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \
do { \
do { \
...
@@ -425,42 +431,27 @@ static u16 group2_table[] = {
...
@@ -425,42 +431,27 @@ static u16 group2_table[] = {
__emulate_2op_nobyte(_op, _src, _dst, _eflags, \
__emulate_2op_nobyte(_op, _src, _dst, _eflags, \
"w", "r", _LO32, "r", "", "r")
"w", "r", _LO32, "r", "", "r")
/* Instruction has only one explicit operand (no source operand). */
#define __emulate_1op(_op, _dst, _eflags, _suffix) \
#define emulate_1op(_op, _dst, _eflags) \
do { \
do { \
unsigned long _tmp; \
unsigned long _tmp; \
\
\
switch ((_dst).bytes) { \
case 1: \
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "3", "2") \
_op"b %1; " \
_POST_EFLAGS("0", "3", "2") \
: "=m" (_eflags), "=m" ((_dst).val), \
"=&r" (_tmp) \
: "i" (EFLAGS_MASK)); \
break; \
case 2: \
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "3", "2") \
_op"w %1; " \
_POST_EFLAGS("0", "3", "2") \
: "=m" (_eflags), "=m" ((_dst).val), \
"=&r" (_tmp) \
: "i" (EFLAGS_MASK)); \
break; \
case 4: \
__asm__ __volatile__ ( \
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "3", "2") \
_PRE_EFLAGS("0", "3", "2") \
_op"l
%1; " \
_op _suffix "
%1; " \
_POST_EFLAGS("0", "3", "2") \
_POST_EFLAGS("0", "3", "2") \
: "=m" (_eflags), "=m" ((_dst).val),
\
: "=m" (_eflags), "+m" ((_dst).val),
\
"=&r" (_tmp) \
"=&r" (_tmp) \
: "i" (EFLAGS_MASK)); \
: "i" (EFLAGS_MASK)); \
break; \
} while (0)
case 8: \
__emulate_1op_8byte(_op, _dst, _eflags); \
/* Instruction has only one explicit operand (no source operand). */
break; \
#define emulate_1op(_op, _dst, _eflags) \
do { \
switch ((_dst).bytes) { \
case 1: __emulate_1op(_op, _dst, _eflags, "b"); break; \
case 2: __emulate_1op(_op, _dst, _eflags, "w"); break; \
case 4: __emulate_1op(_op, _dst, _eflags, "l"); break; \
case 8: ON64(__emulate_1op(_op, _dst, _eflags, "q")); break; \
} \
} \
} while (0)
} while (0)
...
@@ -476,19 +467,8 @@ static u16 group2_table[] = {
...
@@ -476,19 +467,8 @@ static u16 group2_table[] = {
: _qy ((_src).val), "i" (EFLAGS_MASK)); \
: _qy ((_src).val), "i" (EFLAGS_MASK)); \
} while (0)
} while (0)
#define __emulate_1op_8byte(_op, _dst, _eflags) \
do { \
__asm__ __volatile__ ( \
_PRE_EFLAGS("0", "3", "2") \
_op"q %1; " \
_POST_EFLAGS("0", "3", "2") \
: "=m" (_eflags), "=m" ((_dst).val), "=&r" (_tmp) \
: "i" (EFLAGS_MASK)); \
} while (0)
#elif defined(__i386__)
#elif defined(__i386__)
#define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy)
#define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy)
#define __emulate_1op_8byte(_op, _dst, _eflags)
#endif
/* __i386__ */
#endif
/* __i386__ */
/* Fetch next part of the instruction being emulated. */
/* Fetch next part of the instruction being emulated. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录