|
|
| version 1.21, 2008/03/22 04:03:07 | version 1.25, 2012/01/08 18:33:58 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ */ | |
| /* | /* |
| * Copyright (c) 2002-2003 NONAKA Kimihiro | * Copyright (c) 2002-2003 NONAKA Kimihiro |
| * All rights reserved. | * All rights reserved. |
| Line 132 ia32_setemm(UINT frame, UINT32 addr) { | Line 130 ia32_setemm(UINT frame, UINT32 addr) { |
| /* | /* |
| * ¡¦ä£¥·¡¦¥Î¥Á¥©¡¼¥ï | * åã¡Öå㥷åã²ë¢¹î©¥µ |
| */ | */ |
| void FASTCALL | void CPUCALL |
| change_pm(BOOL onoff) | change_pm(BOOL onoff) |
| { | { |
| #if 0 | #if 0 |
| Line 148 change_pm(BOOL onoff) | Line 146 change_pm(BOOL onoff) |
| CPU_STAT_SREG(i).dpl = 0; | CPU_STAT_SREG(i).dpl = 0; |
| } | } |
| #endif | #endif |
| VERBOSE(("Entering to Protected-Mode...")); | VERBOSE(("change_pm: Entering to Protected-Mode...")); |
| } else { | } else { |
| VERBOSE(("Leaveing from Protected-Mode...")); | VERBOSE(("change_pm: Leaveing from Protected-Mode...")); |
| } | } |
| CPU_INST_OP32 = CPU_INST_AS32 = | CPU_INST_OP32 = CPU_INST_AS32 = |
| Line 161 change_pm(BOOL onoff) | Line 159 change_pm(BOOL onoff) |
| CPU_STAT_PM = onoff; | CPU_STAT_PM = onoff; |
| } | } |
| void FASTCALL | void CPUCALL |
| change_pg(BOOL onoff) | change_pg(BOOL onoff) |
| { | { |
| if (onoff) { | if (onoff) { |
| VERBOSE(("Entering to Paging-Mode...")); | VERBOSE(("change_pg: Entering to Paging-Mode...")); |
| } else { | } else { |
| VERBOSE(("Leaveing from Paging-Mode...")); | VERBOSE(("change_pg: Leaveing from Paging-Mode...")); |
| } | } |
| CPU_STAT_PAGING = onoff; | CPU_STAT_PAGING = onoff; |
| } | } |
| void FASTCALL | void CPUCALL |
| change_vm(BOOL onoff) | change_vm(BOOL onoff) |
| { | { |
| int i; | int i; |
| CPU_STAT_VM86 = onoff; | CPU_STAT_VM86 = onoff; |
| if (onoff) { | if (onoff) { |
| VERBOSE(("Entering to Virtual-8086-Mode...")); | VERBOSE(("change_vm: Entering to Virtual-8086-Mode...")); |
| for (i = 0; i < CPU_SEGREG_NUM; i++) { | for (i = 0; i < CPU_SEGREG_NUM; i++) { |
| CPU_STAT_SREGLIMIT(i) = 0xffff; | CPU_STAT_SREGLIMIT(i) = 0xffff; |
| LOAD_SEGREG(i, CPU_REGS_SREG(i)); | LOAD_SEGREG(i, CPU_REGS_SREG(i)); |
| Line 192 change_vm(BOOL onoff) | Line 190 change_vm(BOOL onoff) |
| CPU_STAT_SS32 = 0; | CPU_STAT_SS32 = 0; |
| set_cpl(3); | set_cpl(3); |
| } else { | } else { |
| VERBOSE(("Leaveing from Virtual-8086-Mode...")); | VERBOSE(("change_vm: Leaveing from Virtual-8086-Mode...")); |
| } | } |
| } | } |
| /* | /* |
| * flags | * flags |
| */ | */ |
| static void FASTCALL | static void CPUCALL |
| modify_eflags(UINT32 new_flags, UINT32 mask) | modify_eflags(UINT32 new_flags, UINT32 mask) |
| { | { |
| UINT32 orig = CPU_EFLAG; | UINT32 orig = CPU_EFLAG; |
| Line 221 modify_eflags(UINT32 new_flags, UINT32 m | Line 219 modify_eflags(UINT32 new_flags, UINT32 m |
| } | } |
| } | } |
| void FASTCALL | void CPUCALL |
| set_flags(UINT16 new_flags, UINT16 mask) | set_flags(UINT16 new_flags, UINT16 mask) |
| { | { |
| Line 230 set_flags(UINT16 new_flags, UINT16 mask) | Line 228 set_flags(UINT16 new_flags, UINT16 mask) |
| modify_eflags(new_flags, mask); | modify_eflags(new_flags, mask); |
| } | } |
| void FASTCALL | void CPUCALL |
| set_eflags(UINT32 new_flags, UINT32 mask) | set_eflags(UINT32 new_flags, UINT32 mask) |
| { | { |
| Line 243 set_eflags(UINT32 new_flags, UINT32 mask | Line 241 set_eflags(UINT32 new_flags, UINT32 mask |
| /* | /* |
| * CR3 (Page Directory Entry base physical address) | * CR3 (Page Directory Entry base physical address) |
| */ | */ |
| void FASTCALL | void CPUCALL |
| set_cr3(UINT32 new_cr3) | set_cr3(UINT32 new_cr3) |
| { | { |
| Line 257 set_cr3(UINT32 new_cr3) | Line 255 set_cr3(UINT32 new_cr3) |
| /* | /* |
| * CPL (Current Privilege Level) | * CPL (Current Privilege Level) |
| */ | */ |
| void FASTCALL | void CPUCALL |
| set_cpl(int new_cpl) | set_cpl(int new_cpl) |
| { | { |
| int cpl = new_cpl & 3; | int cpl = new_cpl & 3; |