X86: Add a check to chks to verify a task state segment descriptor.

This commit is contained in:
Gabe Black 2009-02-25 10:17:02 -08:00
parent 7b1cb74ac3
commit 2f31643db5
2 changed files with 11 additions and 2 deletions

View file

@ -87,7 +87,7 @@ let {{
# Add in symbols for the various checks of segment selectors. # Add in symbols for the various checks of segment selectors.
for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck", for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck",
"SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck", "SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck",
"TRCheck"): "TRCheck", "TSSCheck"):
assembler.symbols[check] = "Seg%s" % check assembler.symbols[check] = "Seg%s" % check
for reg in ("TR", "IDTR"): for reg in ("TR", "IDTR"):

View file

@ -235,7 +235,7 @@ output header {{
enum SegmentSelectorCheck { enum SegmentSelectorCheck {
SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck, SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck, SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck,
SegTRCheck SegTRCheck, SegTSSCheck
}; };
enum LongModeDescriptorType { enum LongModeDescriptorType {
@ -1124,6 +1124,15 @@ let {{
fault = new GeneralProtection(selector); fault = new GeneralProtection(selector);
} }
break; break;
case SegTSSCheck:
if (!desc.p) {
fault = new SegmentNotPresent(selector);
} else if (!(desc.type == 0x9 ||
(desc.type == 1 &&
m5reg.mode != LongMode))) {
}
break;
default: default:
panic("Undefined segment check type.\\n"); panic("Undefined segment check type.\\n");
} }