mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
SYSENTER: Correct CS SS segment values
This commit is contained in:
@@ -4153,7 +4153,7 @@ bool CPU_SYSENTER() {
|
||||
cpu.code.big = true;
|
||||
cpu.cpl = 0;
|
||||
|
||||
Segs.val[ss] = (cpu_sep_cs & 0xFFFC) + 8; /* Yes, really. Look it up in Intel's documentation */
|
||||
Segs.val[ss] = (cpu_sep_cs & 0xFFFC) + 0x8; /* Yes, really. Look it up in Intel's documentation */
|
||||
Segs.phys[ss] = 0;
|
||||
Segs.limit[ss] = 0xFFFFFFFF;
|
||||
Segs.expanddown[ss] = false;
|
||||
@@ -4181,14 +4181,14 @@ bool CPU_SYSEXIT() {
|
||||
/* NTS: Do NOT use SetSegGeneral, SYSENTER is documented to set CS and SS based on what was given to the MSR,
|
||||
* but with fixed and very specific descriptor cache values that represent 32-bit flat segments with
|
||||
* base == 0 and limit == 4GB. */
|
||||
Segs.val[cs] = (cpu_sep_cs | 3);
|
||||
Segs.val[cs] = (cpu_sep_cs | 3) + 0x10; /* Yes, really. Look it up in Intel's documentation */
|
||||
Segs.phys[cs] = 0;
|
||||
Segs.limit[cs] = 0xFFFFFFFF;
|
||||
Segs.expanddown[cs] = false;
|
||||
cpu.code.big = true;
|
||||
cpu.cpl = 3;
|
||||
|
||||
Segs.val[ss] = (cpu_sep_cs | 3) + 8; /* Yes, really. Look it up in Intel's documentation */
|
||||
Segs.val[ss] = (cpu_sep_cs | 3) + 0x8; /* Yes, really. Look it up in Intel's documentation */
|
||||
Segs.phys[ss] = 0;
|
||||
Segs.limit[ss] = 0xFFFFFFFF;
|
||||
Segs.expanddown[ss] = false;
|
||||
|
Reference in New Issue
Block a user