From: Avi Kivity Date: Sun, 3 Apr 2011 11:08:51 +0000 (+0300) Subject: KVM: x86 emulator: move desc_limit_scaled() X-Git-Tag: v3.0~722^2~75 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56697687da592d0429c0c3ab80ee7e9d20a3b6e5;p=platform%2Fkernel%2Flinux-amlogic.git KVM: x86 emulator: move desc_limit_scaled() For reuse later. Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 601a9bc..793aff5 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) register_address_increment(c, &c->eip, rel); } +static u32 desc_limit_scaled(struct desc_struct *desc) +{ + u32 limit = get_desc_limit(desc); + + return desc->g ? (limit << 12) | 0xfff : limit; +} + static void set_seg_override(struct decode_cache *c, int seg) { c->has_seg_override = true; @@ -1040,13 +1047,6 @@ static int pio_in_emulated(struct x86_emulate_ctxt *ctxt, return 1; } -static u32 desc_limit_scaled(struct desc_struct *desc) -{ - u32 limit = get_desc_limit(desc); - - return desc->g ? (limit << 12) | 0xfff : limit; -} - static void get_descriptor_table_ptr(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops, u16 selector, struct desc_ptr *dt)