Changeset 4829 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Sep 15, 2007 9:55:14 PM (17 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r4547 r4829 65 65 endif 66 66 SUPR3_DEFS = IN_SUP_R3 IN_RT_R3 67 ifdef VBOX_WITH_IDT_PATCHING 68 SUPR3_DEFS += VBOX_WITH_IDT_PATCHING 69 endif 67 70 SUPR3_INCS := $(PATH_SUB_CURRENT) 68 71 SUPR3_INCS.l4 = $(L4_INCDIR) … … 95 98 endif 96 99 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE_FOR_MM 100 ifdef VBOX_WITH_IDT_PATCHING 101 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING 102 endif 97 103 VBoxDrv_SDKS = W2K3DDK WINPSDKINCS 98 104 VBoxDrv_INCS := $(PATH_SUB_CURRENT) … … 144 150 vboxdrv_TEMPLATE = VBOXR0DRV 145 151 vboxdrv_DEFS = KBUILD_MODNAME=KBUILD_STR\(vboxdrv\) KBUILD_BASENAME=KBUILD_STR\(vboxdrv\) MODULE IN_RT_R0 IN_SUP_R0 CONFIG_VBOXDRV_AS_MISC USE_NEW_OS_INTERFACE_FOR_MM 152 ifdef VBOX_WITH_IDT_PATCHING 153 vboxdrv_DEFS += VBOX_WITH_IDT_PATCHING 154 endif 146 155 vboxdrv_INCS := $(PATH_SUB_CURRENT) 147 156 vboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) … … 163 172 VBoxDrv_TEMPLATE = VBOXR0DRV 164 173 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE 174 ifdef VBOX_WITH_IDT_PATCHING 175 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING 176 endif 165 177 VBoxDrv_DEFS += DEBUG_DARWIN_GIP 166 178 VBoxDrv_INCS := $(PATH_SUB_CURRENT) … … 201 213 VBoxDrv_TEMPLATE = VBOXR0DRV 202 214 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE 215 ifdef VBOX_WITH_IDT_PATCHING 216 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING 217 endif 203 218 VBoxDrv_INCS := $(PATH_SUB_CURRENT) 204 219 #VBoxDrv_LDFLAGS = -s -t -v … … 217 232 VBoxDrvLib_NOINST = 1 218 233 VBoxDrvLib_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE 234 ifdef VBOX_WITH_IDT_PATCHING 235 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING 236 endif 219 237 VBoxDrvLib_INCS := \ 220 238 $(PATH_SUB_CURRENT) \ … … 233 251 vboxdrv_TEMPLATE = VBOXR0DRV 234 252 vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE 253 ifdef VBOX_WITH_IDT_PATCHING 254 vboxdrv_DEFS += VBOX_WITH_IDT_PATCHING 255 endif 235 256 vboxdrv_INCS := $(PATH_SUB_CURRENT) 236 257 vboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) … … 247 268 vboxdrv_TEMPLATE = VBOXR0DRV 248 269 vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 USE_NEW_OS_INTERFACE 270 ifdef VBOX_WITH_IDT_PATCHING 271 vboxdrv_DEFS += VBOX_WITH_IDT_PATCHING 272 endif 249 273 vboxdrv_INCS := $(PATH_SUB_CURRENT) 250 274 vboxdrv_LIBS = $(PATH_LIB)/RuntimeR0Drv$(VBOX_SUFF_LIB) -
trunk/src/VBox/HostDrivers/Support/SUPDRV.h
r4812 r4829 251 251 typedef struct SUPDRVDEVEXT *PSUPDRVDEVEXT; 252 252 253 #if ndef VBOX_WITHOUT_IDT_PATCHING253 #ifdef VBOX_WITH_IDT_PATCHING 254 254 255 255 /** … … 339 339 } SUPDRVPATCHUSAGE, *PSUPDRVPATCHUSAGE; 340 340 341 #endif /* !VBOX_WITHOUT_IDT_PATCHING */341 #endif /* VBOX_WITH_IDT_PATCHING */ 342 342 343 343 … … 562 562 /** Load usage records. (protected by SUPDRVDEVEXT::mtxLdr) */ 563 563 PSUPDRVLDRUSAGE volatile pLdrUsage; 564 #if ndef VBOX_WITHOUT_IDT_PATCHING564 #ifdef VBOX_WITH_IDT_PATCHING 565 565 /** Patch usage records. (protected by SUPDRVDEVEXT::SpinLock) */ 566 566 PSUPDRVPATCHUSAGE volatile pPatchUsage; … … 615 615 RTSPINLOCK Spinlock; 616 616 617 #if ndef VBOX_WITHOUT_IDT_PATCHING617 #ifdef VBOX_WITH_IDT_PATCHING 618 618 /** List of patches. */ 619 619 PSUPDRVPATCH volatile pIdtPatches; -
trunk/src/VBox/HostDrivers/Support/SUPDRVShared.c
r4821 r4829 154 154 static int supdrvMemAdd(PSUPDRVMEMREF pMem, PSUPDRVSESSION pSession); 155 155 static int supdrvMemRelease(PSUPDRVSESSION pSession, RTHCUINTPTR uPtr, SUPDRVMEMREFTYPE eType); 156 #if ndef VBOX_WITHOUT_IDT_PATCHING156 #ifdef VBOX_WITH_IDT_PATCHING 157 157 static int supdrvIOCtl_IdtInstall(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPIDTINSTALL pReq); 158 158 static PSUPDRVPATCH supdrvIdtPatchOne(PSUPDRVDEVEXT pDevExt, PSUPDRVPATCH pPatch); … … 160 160 static void supdrvIdtRemoveOne(PSUPDRVDEVEXT pDevExt, PSUPDRVPATCH pPatch); 161 161 static void supdrvIdtWrite(volatile void *pvIdtEntry, const SUPDRVIDTE *pNewIDTEntry); 162 #endif /* !VBOX_WITHOUT_IDT_PATCHING */162 #endif /* VBOX_WITH_IDT_PATCHING */ 163 163 static int supdrvIOCtl_LdrOpen(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDROPEN pReq); 164 164 static int supdrvIOCtl_LdrLoad(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession, PSUPLDRLOAD pReq); … … 233 233 void VBOXCALL supdrvDeleteDevExt(PSUPDRVDEVEXT pDevExt) 234 234 { 235 #if ndef VBOX_WITHOUT_IDT_PATCHING235 #ifdef VBOX_WITH_IDT_PATCHING 236 236 PSUPDRVPATCH pPatch; 237 237 #endif … … 252 252 * Free lists. 253 253 */ 254 #if ndef VBOX_WITHOUT_IDT_PATCHING254 #ifdef VBOX_WITH_IDT_PATCHING 255 255 /* patches */ 256 256 /** @todo make sure we don't uninstall patches which has been patched by someone else. */ … … 263 263 RTMemExecFree(pvFree); 264 264 } 265 #endif /* !VBOX_WITHOUT_IDT_PATCHING */265 #endif /* VBOX_WITH_IDT_PATCHING */ 266 266 267 267 /* objects. */ … … 384 384 RTLogSetDefaultInstanceThread(NULL, (uintptr_t)pSession); 385 385 386 #if ndef VBOX_WITHOUT_IDT_PATCHING386 #ifdef VBOX_WITH_IDT_PATCHING 387 387 /* 388 388 * Uninstall any IDT patches installed for this session. … … 796 796 797 797 /* execute */ 798 #if ndef VBOX_WITHOUT_IDT_PATCHING798 #ifdef VBOX_WITH_IDT_PATCHING 799 799 pReq->Hdr.rc = supdrvIOCtl_IdtInstall(pDevExt, pSession, pReq); 800 800 #else … … 812 812 813 813 /* execute */ 814 #if ndef VBOX_WITHOUT_IDT_PATCHING814 #ifdef VBOX_WITH_IDT_PATCHING 815 815 pReq->Hdr.rc = supdrvIOCtl_IdtRemoveAll(pDevExt, pSession); 816 816 #else … … 2425 2425 2426 2426 2427 #if ndef VBOX_WITHOUT_IDT_PATCHING2427 #ifdef VBOX_WITH_IDT_PATCHING 2428 2428 /** 2429 2429 * Install IDT for the current CPU. … … 3084 3084 ASMSetFlags(uFlags); 3085 3085 } 3086 #endif /* !VBOX_WITHOUT_IDT_PATCHING */3086 #endif /* VBOX_WITH_IDT_PATCHING */ 3087 3087 3088 3088 … … 3460 3460 if (!pDevExt->pvVMMR0) 3461 3461 { 3462 #if ndef VBOX_WITHOUT_IDT_PATCHING3462 #ifdef VBOX_WITH_IDT_PATCHING 3463 3463 PSUPDRVPATCH pPatch; 3464 3464 #endif … … 3471 3471 pDevExt->pfnVMMR0EntryFast = pvVMMR0EntryFast; 3472 3472 pDevExt->pfnVMMR0EntryEx = pvVMMR0EntryEx; 3473 #if ndef VBOX_WITHOUT_IDT_PATCHING3473 #ifdef VBOX_WITH_IDT_PATCHING 3474 3474 for (pPatch = pDevExt->pIdtPatches; pPatch; pPatch = pPatch->pNext) 3475 3475 { … … 3481 3481 # endif 3482 3482 } 3483 #endif /* !VBOX_WITHOUT_IDT_PATCHING */3483 #endif /* VBOX_WITH_IDT_PATCHING */ 3484 3484 } 3485 3485 else … … 3508 3508 static void supdrvLdrUnsetR0EP(PSUPDRVDEVEXT pDevExt) 3509 3509 { 3510 #if ndef VBOX_WITHOUT_IDT_PATCHING3510 #ifdef VBOX_WITH_IDT_PATCHING 3511 3511 PSUPDRVPATCH pPatch; 3512 3512 #endif … … 3517 3517 pDevExt->pfnVMMR0EntryEx = NULL; 3518 3518 3519 #if ndef VBOX_WITHOUT_IDT_PATCHING3519 #ifdef VBOX_WITH_IDT_PATCHING 3520 3520 for (pPatch = pDevExt->pIdtPatches; pPatch; pPatch = pPatch->pNext) 3521 3521 { … … 3528 3528 # endif 3529 3529 } 3530 #endif /* !VBOX_WITHOUT_IDT_PATCHING */3530 #endif /* VBOX_WITH_IDT_PATCHING */ 3531 3531 } 3532 3532 -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r4815 r4829 102 102 static PSUPQUERYFUNCS g_pFunctions; 103 103 104 #if ndef VBOX_WITHOUT_IDT_PATCHING104 #ifdef VBOX_WITH_IDT_PATCHING 105 105 /** The negotiated interrupt number. */ 106 106 static uint8_t g_u8Interrupt = 3; … … 123 123 static int supInitFake(PSUPDRVSESSION *ppSession); 124 124 static int supLoadModule(const char *pszFilename, const char *pszModule, void **ppvImageBase); 125 #if ndef VBOX_WITHOUT_IDT_PATCHING125 #ifdef VBOX_WITH_IDT_PATCHING 126 126 static int supInstallIDTE(void); 127 127 #endif … … 360 360 if (ppSession) 361 361 *ppSession = g_pSession; 362 #if ndef VBOX_WITHOUT_IDT_PATCHING362 #ifdef VBOX_WITH_IDT_PATCHING 363 363 Assert(g_u8Interrupt == 3); 364 364 #endif … … 412 412 g_u32Cookie = 0; 413 413 g_u32SessionCookie = 0; 414 #if ndef VBOX_WITHOUT_IDT_PATCHING414 #ifdef VBOX_WITH_IDT_PATCHING 415 415 g_u8Interrupt = 3; 416 416 #endif … … 552 552 SUPR3DECL(int) SUPCallVMMR0(PVMR0 pVMR0, unsigned uOperation, void *pvArg) 553 553 { 554 #if ndef VBOX_WITHOUT_IDT_PATCHING554 #if defined(VBOX_WITH_IDT_PATCHING) && !defined(RT_OS_OS2) 555 555 return g_pfnCallVMMR0(pVMR0, uOperation, pvArg); 556 556 … … 1065 1065 */ 1066 1066 int rc = supLoadModule(pszFilename, pszModule, ppvImageBase); 1067 #if ndef VBOX_WITHOUT_IDT_PATCHING1067 #ifdef VBOX_WITH_IDT_PATCHING 1068 1068 if ( RT_SUCCESS(rc) 1069 1069 && !strcmp(pszModule, "VMMR0.r0")) … … 1073 1073 SUPFreeModule(*ppvImageBase); 1074 1074 } 1075 #endif /* VBOX_WITH OUT_IDT_PATCHING */1075 #endif /* VBOX_WITH_IDT_PATCHING */ 1076 1076 1077 1077 return rc; … … 1079 1079 1080 1080 1081 #if ndef VBOX_WITHOUT_IDT_PATCHING1081 #ifdef VBOX_WITH_IDT_PATCHING 1082 1082 /** 1083 1083 * Generates the code for calling the interrupt gate. … … 1274 1274 return rc; 1275 1275 } 1276 #endif /* !VBOX_WITHOUT_IDT_PATCHING */1276 #endif /* VBOX_WITH_IDT_PATCHING */ 1277 1277 1278 1278 … … 1636 1636 if (RT_UNLIKELY(g_u32FakeMode)) 1637 1637 { 1638 #if ndef VBOX_WITHOUT_IDT_PATCHING1638 #ifdef VBOX_WITH_IDT_PATCHING 1639 1639 g_u8Interrupt = 3; 1640 1640 RTMemExecFree(*(void **)&g_pfnCallVMMR0); … … 1645 1645 } 1646 1646 1647 #if ndef VBOX_WITHOUT_IDT_PATCHING1647 #ifdef VBOX_WITH_IDT_PATCHING 1648 1648 /* 1649 1649 * There is one special module. When this is freed we'll … … 1671 1671 g_pfnCallVMMR0 = NULL; 1672 1672 } 1673 #endif /* VBOX_WITH OUT_IDT_PATCHING */1673 #endif /* VBOX_WITH_IDT_PATCHING */ 1674 1674 1675 1675 /* -
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r4174 r4829 117 117 export INCL 118 118 endif 119 KFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 119 KFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 -DIN_SUP_R0 -DVBOX_WITH_IDT_PATCHING 120 120 ifndef CONFIG_VBOXDRV_FIXEDMAJOR 121 121 KFLAGS += -DCONFIG_VBOXDRV_AS_MISC -
trunk/src/VBox/HostDrivers/Support/testcase/Makefile.kmk
r4071 r4829 6 6 # 7 7 # Copyright (C) 2006-2007 innotek GmbH 8 # 8 # 9 9 # This file is part of VirtualBox Open Source Edition (OSE), as 10 10 # available from http://www.virtualbox.org. This file is free software; … … 45 45 tstInt_SOURCES = tstInt.cpp 46 46 tstInt_LIBS = $(LIB_RUNTIME) 47 ifdef VBOX_WITH_IDT_PATCHING 48 tstInt_DEFS += VBOX_WITH_IDT_PATCHING 49 endif 47 50 48 51 tstContiguous_TEMPLATE= VBOXR3TSTEXE -
trunk/src/VBox/HostDrivers/Support/testcase/tstInt.cpp
r4811 r4829 148 148 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks); 149 149 150 #if ndef VBOX_WITHOUT_IDT_PATCHING150 #ifdef VBOX_WITH_IDT_PATCHING 151 151 /* 152 152 * The fast path. … … 176 176 RTPrintf("tstInt: SUPCallVMMR0Fast - %d iterations in %llu ns / %llu ticks. %llu ns / %#llu ticks per iteration. Min %llu ticks.\n", 177 177 i, NanoSecs, Ticks, NanoSecs / i, Ticks / i, MinTicks); 178 #endif /* !VBOX_WITHOUT_IDT_PATCHING */178 #endif /* VBOX_WITH_IDT_PATCHING */ 179 179 180 180 /*
Note:
See TracChangeset
for help on using the changeset viewer.