- Timestamp:
- Mar 24, 2012 10:07:33 PM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv-dtrace.cpp
r40607 r40611 567 567 * @param pDevExt The device extension structure. 568 568 */ 569 int supdrvDTraceInit(PSUPDRVDEVEXT pDevExt)569 int VBOXCALL supdrvDTraceInit(PSUPDRVDEVEXT pDevExt) 570 570 { 571 571 /* … … 592 592 * @param pDevExt The device extension structure. 593 593 */ 594 int supdrvDTraceTerm(PSUPDRVDEVEXT pDevExt)594 int VBOXCALL supdrvDTraceTerm(PSUPDRVDEVEXT pDevExt) 595 595 { 596 596 PSUPDRVDTPROVIDER pProv, pProvNext; -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r40607 r40611 464 464 if (RT_SUCCESS(rc)) 465 465 { 466 pDevExt->u32Cookie = BIRD; /** @todo make this random? */ 467 pDevExt->cbSession = (uint32_t)cbSession; 468 469 /* 470 * Fixup the absolute symbols. 471 * 472 * Because of the table indexing assumptions we'll have a little #ifdef orgy 473 * here rather than distributing this to OS specific files. At least for now. 474 */ 466 #ifdef VBOX_WITH_DTRACE_R0DRV 467 rc = supdrvDTraceInit(pDevExt); 468 if (RT_SUCCESS(rc)) 469 #endif 470 { 471 472 pDevExt->u32Cookie = BIRD; /** @todo make this random? */ 473 pDevExt->cbSession = (uint32_t)cbSession; 474 475 /* 476 * Fixup the absolute symbols. 477 * 478 * Because of the table indexing assumptions we'll have a little #ifdef orgy 479 * here rather than distributing this to OS specific files. At least for now. 480 */ 475 481 #ifdef RT_OS_DARWIN 476 482 # if ARCH_BITS == 32 477 if (SUPR0GetPagingMode() >= SUPPAGINGMODE_AMD64)478 {479 g_aFunctions[0].pfn = (void *)1; /* SUPR0AbsIs64bit */480 g_aFunctions[1].pfn = (void *)0x80; /* SUPR0Abs64bitKernelCS - KERNEL64_CS, seg.h */481 g_aFunctions[2].pfn = (void *)0x88; /* SUPR0Abs64bitKernelSS - KERNEL64_SS, seg.h */482 g_aFunctions[3].pfn = (void *)0x88; /* SUPR0Abs64bitKernelDS - KERNEL64_SS, seg.h */483 }484 else485 g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[4].pfn = (void *)0;486 g_aFunctions[4].pfn = (void *)0x08; /* SUPR0AbsKernelCS - KERNEL_CS, seg.h */487 g_aFunctions[5].pfn = (void *)0x10; /* SUPR0AbsKernelSS - KERNEL_DS, seg.h */488 g_aFunctions[6].pfn = (void *)0x10; /* SUPR0AbsKernelDS - KERNEL_DS, seg.h */489 g_aFunctions[7].pfn = (void *)0x10; /* SUPR0AbsKernelES - KERNEL_DS, seg.h */490 g_aFunctions[8].pfn = (void *)0x10; /* SUPR0AbsKernelFS - KERNEL_DS, seg.h */491 g_aFunctions[9].pfn = (void *)0x48; /* SUPR0AbsKernelGS - CPU_DATA_GS, seg.h */483 if (SUPR0GetPagingMode() >= SUPPAGINGMODE_AMD64) 484 { 485 g_aFunctions[0].pfn = (void *)1; /* SUPR0AbsIs64bit */ 486 g_aFunctions[1].pfn = (void *)0x80; /* SUPR0Abs64bitKernelCS - KERNEL64_CS, seg.h */ 487 g_aFunctions[2].pfn = (void *)0x88; /* SUPR0Abs64bitKernelSS - KERNEL64_SS, seg.h */ 488 g_aFunctions[3].pfn = (void *)0x88; /* SUPR0Abs64bitKernelDS - KERNEL64_SS, seg.h */ 489 } 490 else 491 g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[4].pfn = (void *)0; 492 g_aFunctions[4].pfn = (void *)0x08; /* SUPR0AbsKernelCS - KERNEL_CS, seg.h */ 493 g_aFunctions[5].pfn = (void *)0x10; /* SUPR0AbsKernelSS - KERNEL_DS, seg.h */ 494 g_aFunctions[6].pfn = (void *)0x10; /* SUPR0AbsKernelDS - KERNEL_DS, seg.h */ 495 g_aFunctions[7].pfn = (void *)0x10; /* SUPR0AbsKernelES - KERNEL_DS, seg.h */ 496 g_aFunctions[8].pfn = (void *)0x10; /* SUPR0AbsKernelFS - KERNEL_DS, seg.h */ 497 g_aFunctions[9].pfn = (void *)0x48; /* SUPR0AbsKernelGS - CPU_DATA_GS, seg.h */ 492 498 # else /* 64-bit darwin: */ 493 g_aFunctions[0].pfn = (void *)1; /* SUPR0AbsIs64bit */494 g_aFunctions[1].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0Abs64bitKernelCS */495 g_aFunctions[2].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0Abs64bitKernelSS */496 g_aFunctions[3].pfn = (void *)0; /* SUPR0Abs64bitKernelDS */497 g_aFunctions[4].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0AbsKernelCS */498 g_aFunctions[5].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0AbsKernelSS */499 g_aFunctions[6].pfn = (void *)0; /* SUPR0AbsKernelDS */500 g_aFunctions[7].pfn = (void *)0; /* SUPR0AbsKernelES */501 g_aFunctions[8].pfn = (void *)0; /* SUPR0AbsKernelFS */502 g_aFunctions[9].pfn = (void *)0; /* SUPR0AbsKernelGS */499 g_aFunctions[0].pfn = (void *)1; /* SUPR0AbsIs64bit */ 500 g_aFunctions[1].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0Abs64bitKernelCS */ 501 g_aFunctions[2].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0Abs64bitKernelSS */ 502 g_aFunctions[3].pfn = (void *)0; /* SUPR0Abs64bitKernelDS */ 503 g_aFunctions[4].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0AbsKernelCS */ 504 g_aFunctions[5].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0AbsKernelSS */ 505 g_aFunctions[6].pfn = (void *)0; /* SUPR0AbsKernelDS */ 506 g_aFunctions[7].pfn = (void *)0; /* SUPR0AbsKernelES */ 507 g_aFunctions[8].pfn = (void *)0; /* SUPR0AbsKernelFS */ 508 g_aFunctions[9].pfn = (void *)0; /* SUPR0AbsKernelGS */ 503 509 504 510 # endif 505 511 #else /* !RT_OS_DARWIN */ 506 512 # if ARCH_BITS == 64 507 g_aFunctions[0].pfn = (void *)1; /* SUPR0AbsIs64bit */508 g_aFunctions[1].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0Abs64bitKernelCS */509 g_aFunctions[2].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0Abs64bitKernelSS */510 g_aFunctions[3].pfn = (void *)(uintptr_t)ASMGetDS(); /* SUPR0Abs64bitKernelDS */513 g_aFunctions[0].pfn = (void *)1; /* SUPR0AbsIs64bit */ 514 g_aFunctions[1].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0Abs64bitKernelCS */ 515 g_aFunctions[2].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0Abs64bitKernelSS */ 516 g_aFunctions[3].pfn = (void *)(uintptr_t)ASMGetDS(); /* SUPR0Abs64bitKernelDS */ 511 517 # else 512 g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[4].pfn = (void *)0;518 g_aFunctions[0].pfn = g_aFunctions[1].pfn = g_aFunctions[2].pfn = g_aFunctions[4].pfn = (void *)0; 513 519 # endif 514 g_aFunctions[4].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0AbsKernelCS */515 g_aFunctions[5].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0AbsKernelSS */516 g_aFunctions[6].pfn = (void *)(uintptr_t)ASMGetDS(); /* SUPR0AbsKernelDS */517 g_aFunctions[7].pfn = (void *)(uintptr_t)ASMGetES(); /* SUPR0AbsKernelES */518 g_aFunctions[8].pfn = (void *)(uintptr_t)ASMGetFS(); /* SUPR0AbsKernelFS */519 g_aFunctions[9].pfn = (void *)(uintptr_t)ASMGetGS(); /* SUPR0AbsKernelGS */520 g_aFunctions[4].pfn = (void *)(uintptr_t)ASMGetCS(); /* SUPR0AbsKernelCS */ 521 g_aFunctions[5].pfn = (void *)(uintptr_t)ASMGetSS(); /* SUPR0AbsKernelSS */ 522 g_aFunctions[6].pfn = (void *)(uintptr_t)ASMGetDS(); /* SUPR0AbsKernelDS */ 523 g_aFunctions[7].pfn = (void *)(uintptr_t)ASMGetES(); /* SUPR0AbsKernelES */ 524 g_aFunctions[8].pfn = (void *)(uintptr_t)ASMGetFS(); /* SUPR0AbsKernelFS */ 525 g_aFunctions[9].pfn = (void *)(uintptr_t)ASMGetGS(); /* SUPR0AbsKernelGS */ 520 526 #endif /* !RT_OS_DARWIN */ 521 return VINF_SUCCESS; 527 return VINF_SUCCESS; 528 } 529 530 #ifdef VBOX_WITH_DTRACE_R0DRV 531 supdrvGipDestroy(pDevExt); 532 #endif 522 533 } 523 534 … … 611 622 /* kill the GIP. */ 612 623 supdrvGipDestroy(pDevExt); 624 625 #ifdef VBOX_WITH_DTRACE_R0DRV 626 supdrvDTraceTerm(pDevExt); 627 #endif 613 628 614 629 #ifdef SUPDRV_WITH_RELEASE_LOGGER -
trunk/src/VBox/HostDrivers/Support/SUPDrvInternal.h
r40602 r40611 620 620 void VBOXCALL supdrvCleanupSession(PSUPDRVDEVEXT pDevExt, PSUPDRVSESSION pSession); 621 621 622 #ifdef VBOX_WITH_DTRACE_R0DRV 623 int VBOXCALL supdrvDTraceTerm(PSUPDRVDEVEXT pDevExt); 624 int VBOXCALL supdrvDTraceInit(PSUPDRVDEVEXT pDevExt); 625 #endif 626 627 628 622 629 RT_C_DECLS_END 623 630
Note:
See TracChangeset
for help on using the changeset viewer.