* [patch] (big) real mode emulation - aas
@ 2007-10-31 0:38 Nitin A Kamble
[not found] ` <1193791138.9258.11.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Nitin A Kamble @ 2007-10-31 0:38 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 309 bytes --]
Hi Avi,
Attached is the patch to implement emulation of instruction aas
please apply.
--
Thanks & Regards,
Nitin
Open Source Technology Center, Intel Corporation
-----------------------------------------------------------------
The mind is like a parachute; it works much better when it's open
[-- Attachment #1.1.2: 0002-Implement-emulation-of-instruction-aas.patch --]
[-- Type: application/mbox, Size: 1785 bytes --]
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 314 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
[-- Attachment #3: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] (big) real mode emulation - aas
[not found] ` <1193791138.9258.11.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
@ 2007-10-31 1:12 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2007-10-31 1:12 UTC (permalink / raw)
To: nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w; +Cc: kvm-devel
Nitin A Kamble wrote:
> Hi Avi,
> Attached is the patch to implement emulation of instruction aas
>
> + case 0x3f: /* aas */ {
> + u8 al, ah, af, cf;
> + al = c->regs[VCPU_REGS_RAX] & 0xff;
> + ah = (c->regs[VCPU_REGS_RAX] >> 8) & 0xff;
> + af = (ctxt->eflags & EFLG_AF);
> + cf = (ctxt->eflags & EFLG_CF);
> + if (((al & 0x0f) > 9) || af) {
> + al = al - 6;
> + ah = ah - 1;
> + af = cf = 1;
> + } else {
> + cf = af = 0;
> + }
> + al = al & 0x0f;
> + if (af)
> + ctxt->eflags |= EFLG_AF;
> + else
> + ctxt->eflags &= ~EFLG_AF;
> + if (cf)
> + ctxt->eflags |= EFLG_CF;
> + else
> + ctxt->eflags &= ~EFLG_CF;
> + *(u16 *) &c->regs[VCPU_REGS_RAX] = (ah << 8) & al;
> + }
> + break;
Please move the whole thing to a static function in order to reduce clutter.
Also, a helper
static void set_flag_value(struct emulate_context *ctxt, u32 mask,
int value) {... }
can simplify some of the code.
--
Any sufficiently difficult bug is indistinguishable from a feature.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-10-31 1:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-31 0:38 [patch] (big) real mode emulation - aas Nitin A Kamble
[not found] ` <1193791138.9258.11.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-10-31 1:12 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox