diff options
author | Avi Kivity <avi@redhat.com> | 2011-04-03 12:33:12 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:07 -0400 |
commit | 52fd8b445f5e8572526e3f84c753079470152414 (patch) | |
tree | 08d38c7913c1141b6897ebd2c8391af7e077ae5c /arch/x86/kvm/emulate.c | |
parent | 83b8795a29c53a5f9f202933818128aa54c3e8d2 (diff) | |
download | kernel_samsung_smdk4412-52fd8b445f5e8572526e3f84c753079470152414.zip kernel_samsung_smdk4412-52fd8b445f5e8572526e3f84c753079470152414.tar.gz kernel_samsung_smdk4412-52fd8b445f5e8572526e3f84c753079470152414.tar.bz2 |
KVM: x86 emulator: move linearize() downwards
So it can call emulate_gp() without forward declarations.
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r-- | arch/x86/kvm/emulate.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a2d343c..601a9bc 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -489,21 +489,6 @@ static unsigned seg_override(struct x86_emulate_ctxt *ctxt, return c->seg_override; } -static int linearize(struct x86_emulate_ctxt *ctxt, - struct segmented_address addr, - unsigned size, bool write, - ulong *linear) -{ - struct decode_cache *c = &ctxt->decode; - ulong la; - - la = seg_base(ctxt, ctxt->ops, addr.seg) + addr.ea; - if (c->ad_bytes != 8) - la &= (u32)-1; - *linear = la; - return X86EMUL_CONTINUE; -} - static int emulate_exception(struct x86_emulate_ctxt *ctxt, int vec, u32 error, bool valid) { @@ -543,6 +528,21 @@ static int emulate_nm(struct x86_emulate_ctxt *ctxt) return emulate_exception(ctxt, NM_VECTOR, 0, false); } +static int linearize(struct x86_emulate_ctxt *ctxt, + struct segmented_address addr, + unsigned size, bool write, + ulong *linear) +{ + struct decode_cache *c = &ctxt->decode; + ulong la; + + la = seg_base(ctxt, ctxt->ops, addr.seg) + addr.ea; + if (c->ad_bytes != 8) + la &= (u32)-1; + *linear = la; + return X86EMUL_CONTINUE; +} + static int segmented_read_std(struct x86_emulate_ctxt *ctxt, struct segmented_address addr, void *data, |