regop.isa (5855:d4e54239ed37) regop.isa (5857:8cd8e1393990)
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 1055 unchanged lines hidden (view full) ---

1064 break;
1065 case SegCallGateCheck:
1066 panic("CS checks for far calls/jumps through call gates"
1067 "not implemented.\\n");
1068 break;
1069 case SegSoftIntGateCheck:
1070 // Check permissions.
1071 if (desc.dpl < m5reg.cpl) {
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

--- 1055 unchanged lines hidden (view full) ---

1064 break;
1065 case SegCallGateCheck:
1066 panic("CS checks for far calls/jumps through call gates"
1067 "not implemented.\\n");
1068 break;
1069 case SegSoftIntGateCheck:
1070 // Check permissions.
1071 if (desc.dpl < m5reg.cpl) {
1072 fault = new GeneralProtection((uint16_t)selector);
1072 fault = new GeneralProtection(selector);
1073 }
1074 // Fall through on purpose
1075 case SegIntGateCheck:
1076 // Make sure the gate's the right type.
1077 if (m5reg.mode == LongMode && ((desc.type & 0xe) != 0xe) ||
1078 ((desc.type & 0x6) != 0x6)) {
1079 fault = new GeneralProtection(0);
1080 }
1081 break;
1082 case SegSSCheck:
1083 if (selector.si || selector.ti) {
1084 if (!desc.p) {
1073 }
1074 // Fall through on purpose
1075 case SegIntGateCheck:
1076 // Make sure the gate's the right type.
1077 if (m5reg.mode == LongMode && ((desc.type & 0xe) != 0xe) ||
1078 ((desc.type & 0x6) != 0x6)) {
1079 fault = new GeneralProtection(0);
1080 }
1081 break;
1082 case SegSSCheck:
1083 if (selector.si || selector.ti) {
1084 if (!desc.p) {
1085 //FIXME This needs to also push the selector.
1086 fault = new StackFault;
1085 fault = new StackFault(selector);
1087 }
1088 } else {
1089 if ((m5reg.submode != SixtyFourBitMode ||
1090 m5reg.cpl == 3) ||
1091 !(desc.s == 1 &&
1092 desc.type.codeOrData == 0 && desc.type.w) ||
1093 (desc.dpl != m5reg.cpl) ||
1094 (selector.rpl != m5reg.cpl)) {
1086 }
1087 } else {
1088 if ((m5reg.submode != SixtyFourBitMode ||
1089 m5reg.cpl == 3) ||
1090 !(desc.s == 1 &&
1091 desc.type.codeOrData == 0 && desc.type.w) ||
1092 (desc.dpl != m5reg.cpl) ||
1093 (selector.rpl != m5reg.cpl)) {
1095 fault = new GeneralProtection(psrc1 & 0xFFFF);
1094 fault = new GeneralProtection(selector);
1096 }
1097 }
1098 break;
1099 case SegIretCheck:
1100 {
1101 if ((!selector.si && !selector.ti) ||
1102 (selector.rpl < m5reg.cpl) ||
1103 !(desc.s == 1 && desc.type.codeOrData == 1) ||
1104 (!desc.type.c && desc.dpl != selector.rpl) ||
1105 (desc.type.c && desc.dpl > selector.rpl)) {
1095 }
1096 }
1097 break;
1098 case SegIretCheck:
1099 {
1100 if ((!selector.si && !selector.ti) ||
1101 (selector.rpl < m5reg.cpl) ||
1102 !(desc.s == 1 && desc.type.codeOrData == 1) ||
1103 (!desc.type.c && desc.dpl != selector.rpl) ||
1104 (desc.type.c && desc.dpl > selector.rpl)) {
1106 fault = new GeneralProtection(psrc1 & 0xFFFF);
1105 fault = new GeneralProtection(selector);
1107 } else if (!desc.p) {
1106 } else if (!desc.p) {
1108 fault = new SegmentNotPresent;
1107 fault = new SegmentNotPresent(selector);
1109 }
1110 break;
1111 }
1112 case SegIntCSCheck:
1113 if (m5reg.mode == LongMode) {
1114 if (desc.l != 1 || desc.d != 0) {
1115 fault = new GeneralProtection(selector);
1116 }

--- 94 unchanged lines hidden ---
1108 }
1109 break;
1110 }
1111 case SegIntCSCheck:
1112 if (m5reg.mode == LongMode) {
1113 if (desc.l != 1 || desc.d != 0) {
1114 fault = new GeneralProtection(selector);
1115 }

--- 94 unchanged lines hidden ---