Changeset 10662 in vbox
- Timestamp:
- Jul 15, 2008 2:36:00 PM (16 years ago)
- Location:
- trunk/src/VBox/HostDrivers/Support
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/Makefile.kmk
r10377 r10662 150 150 VBoxDrv_NOINST = true 151 151 endif 152 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 152 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER 153 153 ifdef VBOX_WITH_IDT_PATCHING 154 154 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING … … 229 229 ifeq ($(KBUILD_TARGET),darwin) 230 230 VBoxDrv_TEMPLATE = VBOXR0DRV 231 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 231 VBoxDrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV) 232 232 ifdef VBOX_WITH_IDT_PATCHING 233 233 VBoxDrv_DEFS += VBOX_WITH_IDT_PATCHING … … 304 304 ifeq ($(KBUILD_TARGET),freebsd) 305 305 vboxdrv_TEMPLATE = VBOXR0DRV 306 vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 306 vboxdrv_DEFS = IN_RT_R0 IN_SUP_R0 SUPDRV_WITH_RELEASE_LOGGER VBOX_SVN_REV=$(VBOX_SVN_REV) 307 307 ifdef VBOX_WITH_IDT_PATCHING 308 308 vboxdrv_DEFS += VBOX_WITH_IDT_PATCHING -
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r10556 r10662 1 1 /* $Revision$ */ 2 2 /** @file 3 * V irtualBox Support Driver - Sharedcode.3 * VBoxDrv - The VirtualBox Support Driver - Common code. 4 4 */ 5 5 … … 29 29 */ 30 30 31 32 31 /******************************************************************************* 33 32 * Header Files * 34 33 *******************************************************************************/ 34 #define LOG_GROUP LOG_GROUP_SUP_DRV 35 35 #include "SUPDrvInternal.h" 36 36 #ifndef PAGE_SHIFT … … 44 44 #include <iprt/mp.h> 45 45 #include <iprt/cpuset.h> 46 #include <iprt/log.h>47 46 #include <iprt/uuid.h> 47 #include <VBox/log.h> 48 48 #include <VBox/err.h> 49 49 /* VBox/x86.h not compatible with the Linux kernel sources */ … … 125 125 { 126 126 /* name function */ 127 { "SUPR0ComponentRegisterFactory", (void *)SUPR0ComponentRegisterFactory }, 128 { "SUPR0ComponentDeregisterFactory", (void *)SUPR0ComponentDeregisterFactory }, 129 { "SUPR0ComponentQueryFactory", (void *)SUPR0ComponentQueryFactory }, 127 130 { "SUPR0ObjRegister", (void *)SUPR0ObjRegister }, 128 131 { "SUPR0ObjAddRef", (void *)SUPR0ObjAddRef }, … … 274 277 int VBOXCALL supdrvInitDevExt(PSUPDRVDEVEXT pDevExt) 275 278 { 279 int rc; 280 281 #ifdef SUPDRV_WITH_RELEASE_LOGGER 282 /* 283 * Create the release log. 284 */ 285 static const char * const s_apszGroups[] = VBOX_LOGGROUP_NAMES; 286 PRTLOGGER pRelLogger; 287 rc = RTLogCreate(&pRelLogger, 0 /* fFlags */, "all", 288 "VBOX_RELEASE_LOG", RT_ELEMENTS(s_apszGroups), s_apszGroups, 289 RTLOGDEST_STDOUT | RTLOGDEST_DEBUGGER, NULL); 290 if (RT_SUCCESS(rc)) 291 RTLogRelSetDefaultInstance(pRelLogger); 292 #endif 293 276 294 /* 277 295 * Initialize it. 278 296 */ 279 int rc;280 297 memset(pDevExt, 0, sizeof(*pDevExt)); 281 298 rc = RTSpinlockCreate(&pDevExt->Spinlock); … … 310 327 pDevExt->Spinlock = NIL_RTSPINLOCK; 311 328 } 329 #ifdef SUPDRV_WITH_RELEASE_LOGGER 330 RTLogDestroy(RTLogRelSetDefaultInstance(NULL)); 331 RTLogDestroy(RTLogSetDefaultInstance(NULL)); 332 #endif 333 312 334 return rc; 313 335 } … … 376 398 } 377 399 378 /* kill the GIP */400 /* kill the GIP. */ 379 401 supdrvGipDestroy(pDevExt); 402 403 #ifdef SUPDRV_WITH_RELEASE_LOGGER 404 /* destroy the loggers. */ 405 RTLogDestroy(RTLogRelSetDefaultInstance(NULL)); 406 RTLogDestroy(RTLogSetDefaultInstance(NULL)); 407 #endif 380 408 } 381 409 … … 4881 4909 4882 4910 4883 #ifndef DEBUG /** @todo change #ifndef DEBUG -> #ifdef LOG_ENABLED */ 4911 #ifndef SUPDRV_WITH_RELEASE_LOGGER 4912 # ifndef DEBUG /** @todo change #ifndef DEBUG -> #ifdef LOG_ENABLED */ 4884 4913 /** 4885 4914 * Stub function for non-debug builds. … … 4937 4966 { 4938 4967 } 4939 # endif /* !DEBUG */4940 4968 # endif /* !DEBUG */ 4969 #endif /* !SUPDRV_WITH_RELEASE_LOGGER */ -
trunk/src/VBox/HostDrivers/Support/SUPDrvIOC.h
r10377 r10662 182 182 * The upper 16-bit is the major version, the the lower the minor version. 183 183 * When incompatible changes are made, the upper major number has to be changed. */ 184 #define SUPDRVIOC_VERSION 0x0007000 3184 #define SUPDRVIOC_VERSION 0x00070004 185 185 186 186 /** SUP_IOCTL_COOKIE. */ -
trunk/src/VBox/HostDrivers/Support/SUPLib.cpp
r10257 r10662 213 213 CookieReq.u.In.u32ReqVersion = SUPDRVIOC_VERSION; 214 214 const uint32_t MinVersion = (SUPDRVIOC_VERSION & 0xffff0000) == 0x00070000 215 ? 0x0007000 2/* need new exports */215 ? 0x00070004 /* need new exports */ 216 216 : SUPDRVIOC_VERSION & 0xffff0000; 217 217 CookieReq.u.In.u32MinVersion = MinVersion; … … 326 326 { 327 327 /* name function */ 328 { "SUPR0ComponentRegisterFactory", 0xefeefffd }, 329 { "SUPR0ComponentDeregisterFactory", 0xefeefffe }, 330 { "SUPR0ComponentQueryFactory", 0xefeeffff }, 328 331 { "SUPR0ObjRegister", 0xefef0000 }, 329 332 { "SUPR0ObjAddRef", 0xefef0001 }, -
trunk/src/VBox/HostDrivers/Support/darwin/SUPDrv-darwin.cpp
r10603 r10662 1 /* $Id: $ */ 1 2 /** @file 3 * 2 4 * VBox host drivers - Ring-0 support drivers - Darwin host: 3 5 * Darwin driver C code … … 29 31 */ 30 32 31 32 33 /******************************************************************************* 33 34 * Header Files * 34 35 *******************************************************************************/ 36 #define LOG_GROUP LOG_GROUP_SUP_DRV 35 37 /* 36 38 * Deal with conflicts first. … … 54 56 #include <iprt/uuid.h> 55 57 #include <iprt/err.h> 58 #include <VBox/log.h> 56 59 57 60 #include <mach/kmod.h> … … 219 222 { 220 223 int rc; 221 dprintf(("VBoxDrvDarwinStart\n")); 224 #ifdef DEBUG 225 printf("VBoxDrvDarwinStart\n"); 226 #endif 222 227 223 228 /* … … 251 256 if (g_hDevFsDevice) 252 257 { 253 OSDBGPRINT(("VBoxDrv: Successfully started. (major=%d)\n", g_iMajorDeviceNo)); 258 LogRel(("VBoxDrv: version " VBOX_VERSION_STRING " r%d; IOCtl version %#x; IDC version %#x; dev major=%d\n", 259 VBOX_SVN_REV, SUPDRVIOC_VERSION, SUPDRV_IDC_VERSION, g_iMajorDeviceNo)); 254 260 return KMOD_RETURN_SUCCESS; 255 261 } 256 262 257 OSDBGPRINT(("VBoxDrv: devfs_make_node(makedev(%d,0),,,,%s) failed\n", 258 g_iMajorDeviceNo, DEVICE_NAME)); 263 LogRel(("VBoxDrv: devfs_make_node(makedev(%d,0),,,,%s) failed\n", g_iMajorDeviceNo, DEVICE_NAME)); 259 264 cdevsw_remove(g_iMajorDeviceNo, &g_DevCW); 260 265 g_iMajorDeviceNo = -1; 261 266 } 262 267 else 263 OSDBGPRINT(("VBoxDrv: cdevsw_add failed (%d)\n", g_iMajorDeviceNo));268 LogRel(("VBoxDrv: cdevsw_add failed (%d)\n", g_iMajorDeviceNo)); 264 269 RTSpinlockDestroy(g_Spinlock); 265 270 g_Spinlock = NIL_RTSPINLOCK; 266 271 } 267 272 else 268 OSDBGPRINT(("VBoxDrv: RTSpinlockCreate failed (rc=%d)\n", rc));273 LogRel(("VBoxDrv: RTSpinlockCreate failed (rc=%d)\n", rc)); 269 274 supdrvDeleteDevExt(&g_DevExt); 270 275 } 271 276 else 272 OSDBGPRINT(("VBoxDrv: failed to initialize device extension (rc=%d)\n", rc));277 printf("VBoxDrv: failed to initialize device extension (rc=%d)\n", rc); 273 278 RTR0Term(); 274 279 } 275 280 else 276 OSDBGPRINT(("VBoxDrv: failed to initialize IPRT (rc=%d)\n", rc));281 printf("VBoxDrv: failed to initialize IPRT (rc=%d)\n", rc); 277 282 278 283 memset(&g_DevExt, 0, sizeof(g_DevExt)); … … 287 292 { 288 293 int rc; 289 dprintf(("VBoxDrvDarwinStop\n"));294 LogFlow(("VBoxDrvDarwinStop\n")); 290 295 291 296 /** @todo I've got a nagging feeling that we'll have to keep track of users and refuse … … 311 316 312 317 memset(&g_DevExt, 0, sizeof(g_DevExt)); 313 dprintf(("VBoxDrvDarwinStop - done\n")); 318 #ifdef DEBUG 319 printf("VBoxDrvDarwinStop - done\n"); 320 #endif 314 321 return KMOD_RETURN_SUCCESS; 315 322 } … … 330 337 szName[0] = '\0'; 331 338 proc_name(proc_pid(pProcess), szName, sizeof(szName)); 332 dprintf(("VBoxDrvDarwinOpen: pid=%d '%s'\n", proc_pid(pProcess), szName));339 Log(("VBoxDrvDarwinOpen: pid=%d '%s'\n", proc_pid(pProcess), szName)); 333 340 #endif 334 341 … … 362 369 OSDBGPRINT(("VBoxDrvDarwinOpen: pid=%d '%s' pSession=%p rc=%d\n", proc_pid(pProcess), szName, pSession, rc)); 363 370 #else 364 dprintf(("VBoxDrvDarwinOpen: g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, proc_pid(pProcess)));371 Log(("VBoxDrvDarwinOpen: g_DevExt=%p pSession=%p rc=%d pid=%d\n", &g_DevExt, pSession, rc, proc_pid(pProcess))); 365 372 #endif 366 373 return VBoxDrvDarwinErr2DarwinErr(rc); … … 378 385 PSUPDRVSESSION pSession; 379 386 380 dprintf(("VBoxDrvDarwinClose: pid=%d\n", (int)Process));387 Log(("VBoxDrvDarwinClose: pid=%d\n", (int)Process)); 381 388 382 389 /* … … 488 495 static int VBoxDrvDarwinIOCtlSlow(PSUPDRVSESSION pSession, u_long iCmd, caddr_t pData, struct proc *pProcess) 489 496 { 490 dprintf(("VBoxDrvDarwinIOCtlSlow: pSession=%p iCmd=%p pData=%p pProcess=%p\n", pSession, iCmd, pData, pProcess));497 LogFlow(("VBoxDrvDarwinIOCtlSlow: pSession=%p iCmd=%p pData=%p pProcess=%p\n", pSession, iCmd, pData, pProcess)); 491 498 492 499 … … 571 578 else 572 579 { 573 dprintf(("VBoxDrvDarwinIOCtlSlow: huh? cbReq=%#x iCmd=%#lx\n", cbReq, iCmd));580 Log(("VBoxDrvDarwinIOCtlSlow: huh? cbReq=%#x iCmd=%#lx\n", cbReq, iCmd)); 574 581 return EINVAL; 575 582 } … … 617 624 } 618 625 619 dprintf(("VBoxDrvDarwinIOCtlSlow: pid=%d iCmd=%lx pData=%p failed, rc=%d\n", proc_pid(pProcess), iCmd, (void *)pData, rc));626 Log(("VBoxDrvDarwinIOCtlSlow: pid=%d iCmd=%lx pData=%p failed, rc=%d\n", proc_pid(pProcess), iCmd, (void *)pData, rc)); 620 627 rc = EINVAL; 621 628 } 622 629 623 dprintf2(("VBoxDrvDarwinIOCtlSlow: returns %d\n", rc));630 Log2(("VBoxDrvDarwinIOCtlSlow: returns %d\n", rc)); 624 631 return rc; 625 632 } … … 778 785 bool org_virtualbox_SupDrv::init(OSDictionary *pDictionary) 779 786 { 780 dprintf(("org_virtualbox_SupDrv::init([%p], %p)\n", this, pDictionary));787 LogFlow(("org_virtualbox_SupDrv::init([%p], %p)\n", this, pDictionary)); 781 788 if (IOService::init(pDictionary)) 782 789 { … … 793 800 void org_virtualbox_SupDrv::free(void) 794 801 { 795 dprintf(("IOService::free([%p])\n", this));802 LogFlow(("IOService::free([%p])\n", this)); 796 803 IOService::free(); 797 804 } … … 804 811 IOService *org_virtualbox_SupDrv::probe(IOService *pProvider, SInt32 *pi32Score) 805 812 { 806 dprintf(("org_virtualbox_SupDrv::probe([%p])\n", this));813 LogFlow(("org_virtualbox_SupDrv::probe([%p])\n", this)); 807 814 return IOService::probe(pProvider, pi32Score); 808 815 } … … 814 821 bool org_virtualbox_SupDrv::start(IOService *pProvider) 815 822 { 816 dprintf(("org_virtualbox_SupDrv::start([%p])\n", this));823 LogFlow(("org_virtualbox_SupDrv::start([%p])\n", this)); 817 824 818 825 if (IOService::start(pProvider)) … … 831 838 void org_virtualbox_SupDrv::stop(IOService *pProvider) 832 839 { 833 dprintf(("org_virtualbox_SupDrv::stop([%p], %p)\n", this, pProvider));840 LogFlow(("org_virtualbox_SupDrv::stop([%p], %p)\n", this, pProvider)); 834 841 IOService::stop(pProvider); 835 842 } … … 845 852 { 846 853 bool fRc; 847 dprintf(("org_virtualbox_SupDrv::terminate: reference_count=%d g_cSessions=%d (fOptions=%#x)\n",854 LogFlow(("org_virtualbox_SupDrv::terminate: reference_count=%d g_cSessions=%d (fOptions=%#x)\n", 848 855 KMOD_INFO_NAME.reference_count, ASMAtomicUoReadS32(&g_cSessions), fOptions)); 849 856 if ( KMOD_INFO_NAME.reference_count != 0 … … 852 859 else 853 860 fRc = IOService::terminate(fOptions); 854 dprintf(("org_virtualbox_SupDrv::terminate: returns %d\n", fRc));861 LogFlow(("org_virtualbox_SupDrv::terminate: returns %d\n", fRc)); 855 862 return fRc; 856 863 } … … 869 876 bool org_virtualbox_SupDrvClient::initWithTask(task_t OwningTask, void *pvSecurityId, UInt32 u32Type) 870 877 { 871 dprintf(("org_virtualbox_SupDrvClient::initWithTask([%p], %#x, %p, %#x)\n", this, OwningTask, pvSecurityId, u32Type));878 LogFlow(("org_virtualbox_SupDrvClient::initWithTask([%p], %#x, %p, %#x)\n", this, OwningTask, pvSecurityId, u32Type)); 872 879 873 880 if (!OwningTask) … … 889 896 bool org_virtualbox_SupDrvClient::start(IOService *pProvider) 890 897 { 891 dprintf(("org_virtualbox_SupDrvClient::start([%p], %p)\n", this, pProvider));898 LogFlow(("org_virtualbox_SupDrvClient::start([%p], %p)\n", this, pProvider)); 892 899 if (IOUserClient::start(pProvider)) 893 900 { … … 898 905 return true; 899 906 } 900 dprintf(("org_virtualbox_SupDrvClient::start: %p isn't org_virtualbox_SupDrv\n", pProvider));907 LogFlow(("org_virtualbox_SupDrvClient::start: %p isn't org_virtualbox_SupDrv\n", pProvider)); 901 908 } 902 909 return false; … … 909 916 IOReturn org_virtualbox_SupDrvClient::clientClose(void) 910 917 { 911 dprintf(("org_virtualbox_SupDrvClient::clientClose([%p])\n", this));918 LogFlow(("org_virtualbox_SupDrvClient::clientClose([%p])\n", this)); 912 919 913 920 m_pProvider = NULL; … … 923 930 IOReturn org_virtualbox_SupDrvClient::clientDied(void) 924 931 { 925 dprintf(("org_virtualbox_SupDrvClient::clientDied([%p]) m_Task=%p R0Process=%p Process=%d\n",932 LogFlow(("org_virtualbox_SupDrvClient::clientDied([%p]) m_Task=%p R0Process=%p Process=%d\n", 926 933 this, m_Task, RTR0ProcHandleSelf(), RTProcSelf())); 927 934 … … 937 944 for (PSUPDRVSESSION pSession = g_apSessionHashTab[i]; pSession; pSession = pSession->pNextHash) 938 945 { 939 dprintf2(("pSession=%p R0Process=%p (=? %p)\n", pSession, pSession->R0Process, R0Process));946 Log2(("pSession=%p R0Process=%p (=? %p)\n", pSession, pSession->R0Process, R0Process)); 940 947 if (pSession->R0Process == R0Process) 941 948 { … … 963 970 bool org_virtualbox_SupDrvClient::terminate(IOOptionBits fOptions) 964 971 { 965 dprintf(("org_virtualbox_SupDrvClient::terminate([%p], %#x)\n", this, fOptions));972 LogFlow(("org_virtualbox_SupDrvClient::terminate([%p], %#x)\n", this, fOptions)); 966 973 return IOUserClient::terminate(fOptions); 967 974 } … … 973 980 bool org_virtualbox_SupDrvClient::finalize(IOOptionBits fOptions) 974 981 { 975 dprintf(("org_virtualbox_SupDrvClient::finalize([%p], %#x)\n", this, fOptions));982 LogFlow(("org_virtualbox_SupDrvClient::finalize([%p], %#x)\n", this, fOptions)); 976 983 return IOUserClient::finalize(fOptions); 977 984 } … … 983 990 void org_virtualbox_SupDrvClient::stop(IOService *pProvider) 984 991 { 985 dprintf(("org_virtualbox_SupDrvClient::stop([%p])\n", this));992 LogFlow(("org_virtualbox_SupDrvClient::stop([%p])\n", this)); 986 993 IOUserClient::stop(pProvider); 987 994 } -
trunk/src/VBox/HostDrivers/Support/freebsd/SUPDrv-freebsd.c
r10377 r10662 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxDrv - FreeBSD specifics.3 * VBoxDrv - The VirtualBox Support Driver - FreeBSD specifics. 4 4 */ 5 5 … … 29 29 */ 30 30 31 32 31 /******************************************************************************* 33 32 * Header Files * 34 33 *******************************************************************************/ 34 #define LOG_GROUP LOG_GROUP_SUP_DRV 35 35 /* Deal with conflicts first. */ 36 36 #include <sys/param.h> … … 52 52 #include <iprt/process.h> 53 53 #include <iprt/assert.h> 54 #include < iprt/log.h>54 #include <VBox/log.h> 55 55 #include <iprt/alloc.h> 56 56 #include <iprt/err.h> -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r10377 r10662 1 1 /* $Rev$ */ 2 2 /** @file 3 * The VirtualBox Support Driver - Linux hosts.3 * VBoxDrv - The VirtualBox Support Driver - Linux specifics. 4 4 */ 5 5 … … 34 34 * Header Files * 35 35 *******************************************************************************/ 36 #define LOG_GROUP LOG_GROUP_SUP_DRV 36 37 #include "../SUPDrvInternal.h" 37 38 #include "the-linux-kernel.h" … … 45 46 #include <iprt/err.h> 46 47 #include <iprt/mem.h> 47 #include < iprt/log.h>48 #include <VBox/log.h> 48 49 #include <iprt/mp.h> 49 50 -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.mod.c
r10254 r10662 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VBox host drivers - Ring-0 support drivers - Linux host: 4 * Linux host kernel module interfaces 3 * VBoxDrv - The VirtualBox Support Driver - Autogenerated Linux code. 4 * This is checked in to assist syntax checking the module. 5 5 */ 6 6 -
trunk/src/VBox/HostDrivers/Support/os2/SUPDrv-os2.cpp
r10377 r10662 1 1 /* $Id$ */ 2 2 /** @file 3 * VBoxDrv - OS/2 specifics.3 * VBoxDrv - The VirtualBox Support Driver - OS/2 specifics. 4 4 */ 5 5 … … 29 29 */ 30 30 31 32 31 /******************************************************************************* 33 32 * Header Files * 34 33 *******************************************************************************/ 34 #define LOG_GROUP LOG_GROUP_SUP_DRV 35 35 #define __STDC_CONSTANT_MACROS 36 36 #define __STDC_LIMIT_MACROS … … 46 46 #include <iprt/process.h> 47 47 #include <iprt/assert.h> 48 #include < iprt/log.h>48 #include <VBox/log.h> 49 49 #include <iprt/param.h> 50 50 -
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r10455 r10662 1 1 /* $Id$ */ 2 2 /** @file 3 * V irtualBox Support Driver - Solaris Driver Code.3 * VBoxDrv - The VirtualBox Support Driver - Solaris specifics. 4 4 */ 5 5 … … 29 29 */ 30 30 31 32 31 /******************************************************************************* 33 32 * Header Files * 34 33 *******************************************************************************/ 34 #define LOG_GROUP LOG_GROUP_SUP_DRV 35 35 #include <sys/types.h> 36 36 #include <sys/param.h> -
trunk/src/VBox/HostDrivers/Support/win/SUPDrv-win.cpp
r10377 r10662 1 1 /* $Id$ */ 2 2 /** @file 3 * V irtualBox Support Driver - Windows NT specific parts.3 * VBoxDrv - The VirtualBox Support Driver - Windows NT specifics. 4 4 */ 5 5 … … 29 29 */ 30 30 31 32 33 31 /******************************************************************************* 34 32 * Header Files * 35 33 *******************************************************************************/ 34 #define LOG_GROUP LOG_GROUP_SUP_DRV 36 35 #include "../SUPDrvInternal.h" 37 36 #include <excpt.h> … … 39 38 #include <iprt/process.h> 40 39 #include <iprt/initterm.h> 40 #include <VBox/log.h> 41 41 42 42
Note:
See TracChangeset
for help on using the changeset viewer.