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 --- 1038 unchanged lines hidden (view full) --- 1047 panic("CS checks for far calls/jumps not implemented.\\n"); 1048 break; 1049 case SegCallGateCheck: 1050 panic("CS checks for far calls/jumps through call gates" 1051 "not implemented.\\n"); 1052 break; 1053 case SegIntGateCheck: 1054 if (desc.dpl < m5reg.cpl) { |
1055 fault = new GeneralProtection((uint16_t)selector); |
1056 } 1057 break; 1058 case SegSSCheck: 1059 if (selector.si || selector.ti) { 1060 if (!desc.p) { 1061 //FIXME This needs to also push the selector. |
1062 fault = new StackFault; |
1063 } 1064 } else { 1065 if ((m5reg.submode != SixtyFourBitMode || 1066 m5reg.cpl == 3) || 1067 !(desc.s == 1 && 1068 desc.type.codeOrData == 0 && desc.type.w) || 1069 (desc.dpl != m5reg.cpl) || 1070 (selector.rpl != m5reg.cpl)) { |
1071 fault = new GeneralProtection(psrc1 & 0xFFFF); |
1072 } 1073 } 1074 break; 1075 case SegIretCheck: 1076 { 1077 if ((!selector.si && !selector.ti) || 1078 (selector.rpl < m5reg.cpl) || 1079 !(desc.s == 1 && desc.type.codeOrData == 1) || 1080 (!desc.type.c && desc.dpl != selector.rpl) || |
1081 (desc.type.c && desc.dpl > selector.rpl)) { 1082 fault = new GeneralProtection(psrc1 & 0xFFFF); 1083 } else if (!desc.p) { 1084 fault = new SegmentNotPresent; 1085 } |
1086 break; 1087 } 1088 case SegIntCSCheck: 1089 if (m5reg.mode == LongMode) { 1090 if (desc.l != 1 || desc.d != 0) { |
1091 fault = new GeneralProtection(selector); |
1092 } 1093 } else { 1094 panic("Interrupt CS checks not implemented " 1095 "in legacy mode.\\n"); 1096 } 1097 break; 1098 default: 1099 panic("Undefined segment check type.\\n"); --- 87 unchanged lines hidden --- |