]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86: Fix emulation of DIV instruction. Never actually used currently,
authorKeir Fraser <keir@xensource.com>
Thu, 11 Oct 2007 18:18:12 +0000 (19:18 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 11 Oct 2007 18:18:12 +0000 (19:18 +0100)
but this will avoid a #DE in Xen.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen-unstable changeset:   16097:d5531095d06b5e4513e891b89fd3085311490304
xen-unstable date:        Thu Oct 11 19:18:12 2007 +0100

xen/arch/x86/x86_emulate.c

index 213da19f5d06a3fb843297d462c3a6e895634aaf..d6f1dbf8ae880647fd15f6b44a6e75622bf12b8f 100644 (file)
@@ -586,7 +586,7 @@ static int imul_dbl(unsigned long m[2])
  */
 static int div_dbl(unsigned long u[2], unsigned long v)
 {
-    if ( (v == 0) || (u[1] > v) || ((u[1] == v) && (u[0] != 0)) )
+    if ( (v == 0) || (u[1] >= v) )
         return 1;
     asm ( "div %4"
           : "=a" (u[0]), "=d" (u[1])