VirtualBox

Changeset 97466 in vbox for trunk/src/VBox/VMM/include


Ignore:
Timestamp:
Nov 8, 2022 10:32:34 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
154476
Message:

VMM/IEM: Wrap the the longjmp calls in a macro both to shorten the code and also make it possbile to replace it with a throw if we desire. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/include/IEMInternal.h

    r97464 r97466  
    6565#if defined(DOXYGEN_RUNNING) || defined(RT_OS_WINDOWS) || 1
    6666# define IEM_WITH_SETJMP
     67#endif
     68
     69/** @def IEM_DO_LONGJMP
     70 *
     71 * Wrapper around longjmp / throw.
     72 *
     73 * @param   a_pVCpu     The CPU handle.
     74 * @param   a_rc        The status code jump back with / throw.
     75 */
     76#if defined(IEM_WITH_SETJMP) || defined(DOXYGEN_RUNNING)
     77# define IEM_DO_LONGJMP(a_pVCpu, a_rc)  longjmp(*(a_pVCpu)->iem.s.CTX_SUFF(pJmpBuf), (a_rc))
    6778#endif
    6879
     
    866877        { \
    867878            int rcCtxImport = CPUMImportGuestStateOnDemand(a_pVCpu, a_fExtrnImport); \
    868             AssertRCStmt(rcCtxImport, longjmp(*pVCpu->iem.s.CTX_SUFF(pJmpBuf), rcCtxImport)); \
     879            AssertRCStmt(rcCtxImport, IEM_DO_LONGJMP(pVCpu, rcCtxImport)); \
    869880        } \
    870881    } while (0)
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