|
|
| version 1.19, 2004/03/24 14:34:23 | version 1.22, 2008/01/25 18:12:13 |
|---|---|
| Line 12 | Line 12 |
| * 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright |
| * notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the |
| * documentation and/or other materials provided with the distribution. | * documentation and/or other materials provided with the distribution. |
| * 3. The name of the author may not be used to endorse or promote products | |
| * derived from this software without specific prior written permission. | |
| * | * |
| * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| Line 416 task_switch(selector_t *task_sel, task_s | Line 414 task_switch(selector_t *task_sel, task_s |
| /* set new EIP, GPR */ | /* set new EIP, GPR */ |
| CPU_PREV_EIP = CPU_EIP = eip; | CPU_PREV_EIP = CPU_EIP = eip; |
| CPU_PREFETCH_CLEAR(); | |
| for (i = 0; i < CPU_REG_NUM; i++) { | for (i = 0; i < CPU_REG_NUM; i++) { |
| CPU_REGS_DWORD(i) = regs[i]; | CPU_REGS_DWORD(i) = regs[i]; |
| } | } |
| Line 426 task_switch(selector_t *task_sel, task_s | Line 423 task_switch(selector_t *task_sel, task_s |
| } | } |
| /* set new EFLAGS */ | /* set new EFLAGS */ |
| #if defined(IA32_DONT_USE_SET_EFLAGS_FUNCTION) | |
| CPU_EFLAG = new_flags; | |
| CPU_OV = CPU_FLAG & O_FLAG; | |
| CPU_TRAP = (CPU_FLAG & (I_FLAG|T_FLAG)) == (I_FLAG|T_FLAG); | |
| if ((old_flags ^ CPU_EFLAG) & VM_FLAG) { | |
| if (CPU_EFLAG & VM_FLAG) { | |
| change_vm(1); | |
| } else { | |
| change_vm(0); | |
| } | |
| } | |
| #else | |
| set_eflags(new_flags, I_FLAG|IOPL_FLAG|RF_FLAG|VM_FLAG|VIF_FLAG|VIP_FLAG); | set_eflags(new_flags, I_FLAG|IOPL_FLAG|RF_FLAG|VM_FLAG|VIF_FLAG|VIP_FLAG); |
| #endif | |
| /* I/O deny bitmap */ | /* I/O deny bitmap */ |
| if (!task16) { | if (!task16) { |