diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-03 07:08:51 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:07 -0400 |
commit | 56697687da592d0429c0c3ab80ee7e9d20a3b6e5 (patch) | |
tree | daa15598d1e0d925e5867443817e7481afe8c89e /arch/x86/kvm/emulate.c | |
parent | 52fd8b445f5e8572526e3f84c753079470152414 (diff) |
KVM: x86 emulator: move desc_limit_scaled()
For reuse later.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 601a9bca4b72..793aff52a4b8 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -464,6 +464,13 @@ static inline void jmp_rel(struct decode_cache *c, int rel) | |||
464 | register_address_increment(c, &c->eip, rel); | 464 | register_address_increment(c, &c->eip, rel); |
465 | } | 465 | } |
466 | 466 | ||
467 | static u32 desc_limit_scaled(struct desc_struct *desc) | ||
468 | { | ||
469 | u32 limit = get_desc_limit(desc); | ||
470 | |||
471 | return desc->g ? (limit << 12) | 0xfff : limit; | ||
472 | } | ||
473 | |||
467 | static void set_seg_override(struct decode_cache *c, int seg) | 474 | static void set_seg_override(struct decode_cache *c, int seg) |
468 | { | 475 | { |
469 | c->has_seg_override = true; | 476 | c->has_seg_override = true; |
@@ -1040,13 +1047,6 @@ static int pio_in_emulated(struct x86_emulate_ctxt *ctxt, | |||
1040 | return 1; | 1047 | return 1; |
1041 | } | 1048 | } |
1042 | 1049 | ||
1043 | static u32 desc_limit_scaled(struct desc_struct *desc) | ||
1044 | { | ||
1045 | u32 limit = get_desc_limit(desc); | ||
1046 | |||
1047 | return desc->g ? (limit << 12) | 0xfff : limit; | ||
1048 | } | ||
1049 | |||
1050 | static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt, | 1050 | static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt, |
1051 | struct x86_emulate_ops *ops, | 1051 | struct x86_emulate_ops *ops, |
1052 | u16 selector, struct desc_ptr *dt) | 1052 | u16 selector, struct desc_ptr *dt) |