Changeset 19334 in vbox for trunk/src/VBox/VMM/VMMAll/SELMAll.cpp
- Timestamp:
- May 4, 2009 4:03:57 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 46812
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/SELMAll.cpp
r18992 r19334 1078 1078 1079 1079 1080 /**1081 * Validates a CS selector.1082 *1083 * @returns VBox status code.1084 * @param pSelInfo Pointer to the selector information for the CS selector.1085 * @param SelCPL The selector defining the CPL (SS).1086 */1087 VMMDECL(int) SELMSelInfoValidateCS(PCSELMSELINFO pSelInfo, RTSEL SelCPL)1088 {1089 /*1090 * Check if present.1091 */1092 if (pSelInfo->Raw.Gen.u1Present)1093 {1094 /*1095 * Type check.1096 */1097 if ( pSelInfo->Raw.Gen.u1DescType == 11098 && (pSelInfo->Raw.Gen.u4Type & X86_SEL_TYPE_CODE))1099 {1100 /*1101 * Check level.1102 */1103 unsigned uLevel = RT_MAX(SelCPL & X86_SEL_RPL, pSelInfo->Sel & X86_SEL_RPL);1104 if ( !(pSelInfo->Raw.Gen.u4Type & X86_SEL_TYPE_CONF)1105 ? uLevel <= pSelInfo->Raw.Gen.u2Dpl1106 : uLevel >= pSelInfo->Raw.Gen.u2Dpl /* hope I got this right now... */1107 )1108 return VINF_SUCCESS;1109 return VERR_INVALID_RPL;1110 }1111 return VERR_NOT_CODE_SELECTOR;1112 }1113 return VERR_SELECTOR_NOT_PRESENT;1114 }1115 1116 1080 #ifndef IN_RING0 1117 1081
Note:
See TracChangeset
for help on using the changeset viewer.