TSS error code push fix (malc)
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 21 Aug 2005 17:30:26 +0000 (17:30 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 21 Aug 2005 17:30:26 +0000 (17:30 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1558 c046a42c-6fe2-441c-8c8c-71466251a162

target-i386/helper.c

index 424dc52..c7fea95 100644 (file)
@@ -622,9 +622,10 @@ static void do_interrupt_protected(int intno, int is_int, int error_code,
             raise_exception_err(EXCP0B_NOSEG, intno * 8 + 2);
         switch_tss(intno * 8, e1, e2, SWITCH_TSS_CALL, old_eip);
         if (has_error_code) {
-            int mask;
+            int mask, type;
             /* push the error code */
-            shift = (env->segs[R_CS].flags >> DESC_B_SHIFT) & 1;
+            type = (env->tr.flags >> DESC_TYPE_SHIFT) & 0xf;
+            shift = type >> 3;
             if (env->segs[R_SS].flags & DESC_B_MASK)
                 mask = 0xffffffff;
             else