diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-04-16 16:10:41 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-04-16 16:10:41 +0100 |
commit | a6836b4fdd40e84ef453a23fc298486049d26ef7 (patch) | |
tree | 7dc43533c1fffaefc55e4de38e3c3264d0f02037 /xen/arch/x86/hvm/emulate.c | |
parent | 8415719513ba048939d0ded7565cd9cba7c306c4 (diff) | |
download | xen-a6836b4fdd40e84ef453a23fc298486049d26ef7.tar.gz xen-a6836b4fdd40e84ef453a23fc298486049d26ef7.tar.bz2 xen-a6836b4fdd40e84ef453a23fc298486049d26ef7.zip |
x86_emulate: Implement a more dynamic interface for handling FPU
exceptions, which will allow emulation stubs to be built dynamically
in a future patch.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/emulate.c')
-rw-r--r-- | xen/arch/x86/hvm/emulate.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c index b1d4bb8034..5e50fc6f61 100644 --- a/xen/arch/x86/hvm/emulate.c +++ b/xen/arch/x86/hvm/emulate.c @@ -674,11 +674,23 @@ static int hvmemul_inject_sw_interrupt( return X86EMUL_OKAY; } -static void hvmemul_load_fpu_ctxt( +static void hvmemul_get_fpu( + void (*exception_callback)(void *, struct cpu_user_regs *), + void *exception_callback_arg, struct x86_emulate_ctxt *ctxt) { - if ( !current->fpu_dirtied ) + struct vcpu *curr = current; + if ( !curr->fpu_dirtied ) hvm_funcs.fpu_dirty_intercept(); + curr->arch.hvm_vcpu.fpu_exception_callback = exception_callback; + curr->arch.hvm_vcpu.fpu_exception_callback_arg = exception_callback_arg; +} + +static void hvmemul_put_fpu( + struct x86_emulate_ctxt *ctxt) +{ + struct vcpu *curr = current; + curr->arch.hvm_vcpu.fpu_exception_callback = NULL; } static int hvmemul_invlpg( @@ -720,7 +732,8 @@ static struct x86_emulate_ops hvm_emulate_ops = { .cpuid = hvmemul_cpuid, .inject_hw_exception = hvmemul_inject_hw_exception, .inject_sw_interrupt = hvmemul_inject_sw_interrupt, - .load_fpu_ctxt = hvmemul_load_fpu_ctxt, + .get_fpu = hvmemul_get_fpu, + .put_fpu = hvmemul_put_fpu, .invlpg = hvmemul_invlpg }; |