VirtualBox

Ignore:
Timestamp:
May 4, 2009 4:03:57 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
46812
Message:

DBGF,SELM,DBGC,++: Refactored the selector info querying and usage, mainly for fixing VM_ASSERT_EMT issues cropping up after from #3170, but also for moving the external interface to DBGF.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/SELMAll.cpp

    r18992 r19334  
    10781078
    10791079
    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 == 1
    1098             &&  (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.u2Dpl
    1106                 :   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 
    11161080#ifndef IN_RING0
    11171081
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette