Previous 15994 Revisions Next

r11979 Saturday 18th June, 2011 at 02:59:48 UTC by Barry Rodewald
i386: Fix resetting the task busy bit when leaving a task. (no whatsnew)
[src/emu/cpu/i386]i386.c

src/emu/cpu/i386/i386.c
r11978r11979
734734   /* For tasks that aren't nested, clear the busy bit in the task's descriptor */
735735   if(nested == 0)
736736   {
737      if(cpustate->sreg[CS].selector & 0x0004)
737      if(cpustate->task.segment & 0x0004)
738738      {
739         ar_byte = READ8(cpustate,cpustate->ldtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5);
740         WRITE8(cpustate,cpustate->ldtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5,ar_byte & ~0x02);
739         ar_byte = READ8(cpustate,cpustate->ldtr.base + (cpustate->task.segment & ~0x0007) + 5);
740         WRITE8(cpustate,cpustate->ldtr.base + (cpustate->task.segment & ~0x0007) + 5,ar_byte & ~0x02);
741741      }
742742      else
743743      {
744         ar_byte = READ8(cpustate,cpustate->gdtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5);
745         WRITE8(cpustate,cpustate->gdtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5,ar_byte & ~0x02);
744         ar_byte = READ8(cpustate,cpustate->gdtr.base + (cpustate->task.segment & ~0x0007) + 5);
745         WRITE8(cpustate,cpustate->gdtr.base + (cpustate->task.segment & ~0x0007) + 5,ar_byte & ~0x02);
746746      }
747747   }
748748
r11978r11979
841841   /* For tasks that aren't nested, clear the busy bit in the task's descriptor */
842842   if(nested == 0)
843843   {
844      if(cpustate->sreg[CS].selector & 0x0004)
844      if(cpustate->task.segment & 0x0004)
845845      {
846         ar_byte = READ8(cpustate,cpustate->ldtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5);
847         WRITE8(cpustate,cpustate->ldtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5,ar_byte & ~0x02);
846         ar_byte = READ8(cpustate,cpustate->ldtr.base + (cpustate->task.segment & ~0x0007) + 5);
847         WRITE8(cpustate,cpustate->ldtr.base + (cpustate->task.segment & ~0x0007) + 5,ar_byte & ~0x02);
848848      }
849849      else
850850      {
851         ar_byte = READ8(cpustate,cpustate->gdtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5);
852         WRITE8(cpustate,cpustate->gdtr.base + (cpustate->sreg[CS].selector & ~0x0007) + 5,ar_byte & ~0x02);
851         ar_byte = READ8(cpustate,cpustate->gdtr.base + (cpustate->task.segment & ~0x0007) + 5);
852         WRITE8(cpustate,cpustate->gdtr.base + (cpustate->task.segment & ~0x0007) + 5,ar_byte & ~0x02);
853853      }
854854   }
855855
r11978r11979
12111211            return;
12121212            break;
12131213         default:  // invalid segment type
1214            logerror("JMP: Invalid segment type (%i) to jump to.",desc.flags & 0x000f);
1214            logerror("JMP: Invalid segment type (%i) to jump to.\n",desc.flags & 0x000f);
12151215            FAULT(FAULT_GP,segment & 0xfffc)
12161216         }
12171217      }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team