Previous 15994 Revisions Next

r11976 Friday 17th June, 2011 at 06:42:10 UTC by Barry Rodewald
i386: Added support for call gate parameters. (no whatsnew)
[src/emu/cpu/i386]i386.c

src/emu/cpu/i386/i386.c
r11975r11976
824824   }
825825
826826   cpustate->CPL = cpustate->sreg[CS].selector & 0x03;
827   printf("286 Task Switch from selector %04x to %04x",old_task,seg.selector);
827   printf("286 Task Switch from selector %04x to %04x\n",old_task,seg.selector);
828828}
829829
830830static void i386_task_switch(i386_state *cpustate, UINT16 selector, UINT8 nested)
r11975r11976
14131413            if(DPL < CPL && (desc.flags & 0x0004) == 0)
14141414            {
14151415               I386_SREG stack;
1416               I386_SREG temp;
14161417               UINT32 oldSS,oldESP;
14171418               /* more privilege */
14181419               /* Check new SS segment for privilege level from TSS */
r11975r11976
15231524                  PUSH16(cpustate,oldESP & 0xffff);
15241525               }
15251526
1526               for(x=0;x<(gate.dword_count & 0x1f);x++)
1527               memset(&temp, 0, sizeof(temp));
1528               temp.selector = oldSS;
1529               i386_load_protected_mode_segment(cpustate,&temp);
1530               /* copy parameters from old stack to new stack */
1531               for(x=(gate.dword_count & 0x1f)-1;x>=0;x--)
15271532               {
1528                  /* TODO: copy parameters from old stack to new stack */
1529                  PUSH16(cpustate,0x1234);
1533                  UINT32 addr = temp.base + oldESP + (x*2);
1534                  PUSH16(cpustate,READ16(cpustate,addr));
15301535               }
1531               logerror("Call gate parameters pushed = %i\n",gate.dword_count);
15321536               cpustate->CPL = (stack.flags >> 5) & 0x03;
15331537               SetRPL = 1;
15341538            }

Previous 15994 Revisions Next


© 1998-2018 The MESS Team