X86: Distinguish between hardware and software interrupts/exceptions
authorGabe Black <gblack@eecs.umich.edu>
Mon, 2 Feb 2009 01:07:18 +0000 (17:07 -0800)
committerGabe Black <gblack@eecs.umich.edu>
Mon, 2 Feb 2009 01:07:18 +0000 (17:07 -0800)
src/arch/x86/isa/microasm.isa
src/arch/x86/isa/microops/regop.isa

index bc49d336258e2efedcd00b868f3955debe7bbe90..778754e0c565ffb097b51941c6e5dd0c506ea7b8 100644 (file)
@@ -86,7 +86,7 @@ let {{
 
     # Add in symbols for the various checks of segment selectors.
     for check in ("NoCheck", "CSCheck", "CallGateCheck", "IntGateCheck",
-                  "SSCheck", "IretCheck", "IntCSCheck"):
+                  "SoftIntGateCheck", "SSCheck", "IretCheck", "IntCSCheck"):
         assembler.symbols[check] = "Seg%s" % check
 
     for reg in ("TR", "IDTR"):
index 200024690347d8bcee9c3e39ec584070c16efeb3..2e6160ec69911aecc89e227f665dc55cb96c761f 100644 (file)
@@ -234,7 +234,7 @@ output header {{
 
     enum SegmentSelectorCheck {
       SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
-      SegSSCheck, SegIretCheck, SegIntCSCheck
+      SegSoftIntGateCheck, SegSSCheck, SegIretCheck, SegIntCSCheck
     };
 
     enum LongModeDescriptorType {
@@ -1066,11 +1066,13 @@ let {{
                 panic("CS checks for far calls/jumps through call gates"
                         "not implemented.\\n");
                 break;
-              case SegIntGateCheck:
+              case SegSoftIntGateCheck:
                 // Check permissions.
                 if (desc.dpl < m5reg.cpl) {
                     fault = new GeneralProtection((uint16_t)selector);
                 }
+                // Fall through on purpose
+              case SegIntGateCheck:
                 // Make sure the gate's the right type.
                 if (m5reg.mode == LongMode && ((desc.type & 0xe) != 0xe) ||
                         ((desc.type & 0x6) != 0x6)) {