- Timestamp:
- Nov 4, 2016 7:08:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r63510 r64584 108 108 109 109 110 /** @name Macros for preserving EFLAGS.AC (despair / paranoid) 111 * @remarks We have to restore it unconditionally on darwin. 112 * @{ */ 113 #if defined(RT_OS_DARWIN) \ 114 || ( defined(RT_OS_LINUX) \ 115 && (defined(CONFIG_X86_SMAP) || defined(RT_STRICT) || defined(IPRT_WITH_EFLAGS_AC_PRESERVING) ) ) 116 # include <iprt/asm-amd64-x86.h> 117 # include <iprt/x86.h> 118 # define SUPDRV_SAVE_EFL_AC() RTCCUINTREG const fSavedEfl = ASMGetFlags(); 119 # define SUPDRV_RESTORE_EFL_AC() ASMSetFlags(fSavedEfl) 120 # define SUPDRV_RESTORE_EFL_ONLY_AC() ASMChangeFlags(~X86_EFL_AC, fSavedEfl & X86_EFL_AC) 121 #else 122 # define SUPDRV_SAVE_EFL_AC() do { } while (0) 123 # define SUPDRV_RESTORE_EFL_AC() do { } while (0) 124 # define SUPDRV_RESTORE_EFL_ONLY_AC() do { } while (0) 125 #endif 126 /** @} */ 127 128 110 129 /********************************************************************************************************************************* 111 130 * Structures and Typedefs * … … 773 792 AssertPtrReturnVoid(pVtgProbeLoc->pszFunction); 774 793 794 SUPDRV_SAVE_EFL_AC(); 775 795 VBDT_SETUP_STACK_DATA(kVBoxDtCaller_ProbeFireKernel); 776 796 … … 816 836 817 837 VBDT_CLEAR_STACK_DATA(); 838 SUPDRV_RESTORE_EFL_AC(); 818 839 LOG_DTRACE(("%s: returns\n", __FUNCTION__)); 819 840 } … … 831 852 AssertPtrReturnVoid(pVtgHdr); 832 853 854 SUPDRV_SAVE_EFL_AC(); 833 855 VBDT_SETUP_STACK_DATA(kVBoxDtCaller_ProbeFireUser); 834 856 … … 900 922 901 923 VBDT_CLEAR_STACK_DATA(); 924 SUPDRV_RESTORE_EFL_AC(); 902 925 LOG_DTRACE(("%s: returns\n", __FUNCTION__)); 903 926 } … … 958 981 have to point it to pCore->TracerData.DTrace.idProvider. */ 959 982 AssertCompile(sizeof(dtrace_provider_id_t) == sizeof(pCore->TracerData.DTrace.idProvider)); 983 SUPDRV_SAVE_EFL_AC(); 960 984 int rc = dtrace_register(pCore->pszName, 961 985 &DtAttrs, … … 965 989 pCore, 966 990 &pCore->TracerData.DTrace.idProvider); 991 SUPDRV_RESTORE_EFL_AC(); 967 992 if (!rc) 968 993 { … … 992 1017 AssertPtrReturn(idProvider, VERR_INTERNAL_ERROR_3); 993 1018 1019 SUPDRV_SAVE_EFL_AC(); 994 1020 dtrace_invalidate(idProvider); 995 1021 int rc = dtrace_unregister(idProvider); 1022 SUPDRV_RESTORE_EFL_AC(); 996 1023 if (!rc) 997 1024 { … … 1022 1049 Assert(pCore->TracerData.DTrace.fZombie); 1023 1050 1051 SUPDRV_SAVE_EFL_AC(); 1024 1052 int rc = dtrace_unregister(idProvider); 1053 SUPDRV_RESTORE_EFL_AC(); 1025 1054 if (!rc) 1026 1055 {
Note:
See TracChangeset
for help on using the changeset viewer.