X86: Add segmentation checks for ldt related descriptors and selectors.
This commit is contained in:
parent
e08d60389d
commit
bda7077c64
2 changed files with 14 additions and 2 deletions
|
@ -87,7 +87,7 @@ let {{
|
|||
# Add in symbols for the various checks of segment selectors.
|
||||
for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck",
|
||||
"SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck",
|
||||
"TRCheck", "TSSCheck"):
|
||||
"TRCheck", "TSSCheck", "InGDTCheck", "LDTCheck"):
|
||||
assembler.symbols[check] = "Seg%s" % check
|
||||
|
||||
for reg in ("TR", "IDTR"):
|
||||
|
|
|
@ -235,7 +235,7 @@ output header {{
|
|||
enum SegmentSelectorCheck {
|
||||
SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
|
||||
SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck,
|
||||
SegTRCheck, SegTSSCheck
|
||||
SegTRCheck, SegTSSCheck, SegInGDTCheck, SegLDTCheck
|
||||
};
|
||||
|
||||
enum LongModeDescriptorType {
|
||||
|
@ -1174,6 +1174,18 @@ let {{
|
|||
fault = new GeneralProtection(selector);
|
||||
}
|
||||
break;
|
||||
case SegInGDTCheck:
|
||||
if (selector.ti) {
|
||||
fault = new GeneralProtection(selector);
|
||||
}
|
||||
break;
|
||||
case SegLDTCheck:
|
||||
if (!desc.p) {
|
||||
fault = new SegmentNotPresent(selector);
|
||||
} else if (desc.type != 0x2) {
|
||||
fault = new GeneralProtection(selector);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
panic("Undefined segment check type.\\n");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue