Changeset 4717 in vbox for trunk/src/VBox/HostDrivers/Support/solaris
- Timestamp:
- Sep 12, 2007 6:44:18 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c
r4550 r4717 47 47 /** The module name. */ 48 48 #define DEVICE_NAME "vboxdrv" 49 /** The module description as seen in 'modinfo'. */ 49 50 #define DEVICE_DESC "VirtualBox Driver" 51 /** Maximum number of driver instances. */ 50 52 #define DEVICE_MAXINSTANCES 16 51 53 … … 54 56 * Internal Functions * 55 57 *******************************************************************************/ 56 static int VBoxDrvSolarisOpen(dev_t * pDev, int fFlag, int fType, cred_t*pCred);57 static int VBoxDrvSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);58 static int VBoxDrvSolarisRead(dev_t Dev, struct uio * pUio, cred_t*pCred);59 static int VBoxDrvSolarisWrite(dev_t Dev, struct uio * pUio, cred_t*pCred);60 static int VBoxDrvSolarisIOCtl (dev_t Dev, int Cmd, intptr_t pArgs, int mode, cred_t * pCred, int*pVal);61 62 static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t Cmd);63 static int VBoxDrvSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t Cmd);58 static int VBoxDrvSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred); 59 static int VBoxDrvSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred); 60 static int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred); 61 static int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred); 62 static int VBoxDrvSolarisIOCtl (dev_t Dev, int Cmd, intptr_t pArgs, int mode, cred_t *pCred, int *pVal); 63 64 static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t Cmd); 65 static int VBoxDrvSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t Cmd); 64 66 65 67 static int VBoxSupDrvErr2SolarisErr(int rc); … … 131 133 }; 132 134 133 /** State info. each our kernel module instances*/135 /** State info. for each driver instance. */ 134 136 typedef struct 135 137 { 136 dev_info_t *pDip; /* Device handle */138 dev_info_t *pDip; /* Device handle */ 137 139 } vbox_devstate_t; 138 140 139 141 /** Opaque pointer to state */ 140 static void *g_pVBoxDrvSolarisState;142 static void *g_pVBoxDrvSolarisState; 141 143 142 144 /** Device extention & session data association structure */ … … 207 209 if (RT_SUCCESS(rc)) 208 210 { 209 cmn_err(CE_NOTE,"supdrvCreateSession success");210 211 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 211 212 unsigned iHash; … … 237 238 if (instance >= DEVICE_MAXINSTANCES) 238 239 { 239 cmn_err(CE_NOTE, " All instances exhausted\n");240 cmn_err(CE_NOTE, "VBoxDrvSolarisOpen: All instances exhausted\n"); 240 241 return ENXIO; 241 242 } … … 301 302 } 302 303 303 static int VBoxDrvSolarisRead(dev_t dev, struct uio* pUio, cred_t* credp)304 static int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred) 304 305 { 305 306 cmn_err(CE_CONT, "VBoxDrvSolarisRead"); … … 307 308 } 308 309 309 static int VBoxDrvSolarisWrite(dev_t dev, struct uio* pUio, cred_t* credp)310 static int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred) 310 311 { 311 312 cmn_err(CE_CONT, "VBoxDrvSolarisWrite"); … … 321 322 * @return corresponding solaris error code. 322 323 */ 323 static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd)324 static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd) 324 325 { 325 326 cmn_err(CE_CONT, "VBoxDrvSolarisAttach"); 326 327 int rc = VINF_SUCCESS; 327 328 int instance = 0; 328 vbox_devstate_t *pState;329 vbox_devstate_t *pState; 329 330 330 331 switch (enmCmd) … … 412 413 int rc = VINF_SUCCESS; 413 414 int instance; 414 register vbox_devstate_t *pState;415 register vbox_devstate_t *pState; 415 416 416 417 cmn_err(CE_CONT, "VBoxDrvSolarisDetach"); … … 557 558 { 558 559 OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: ddi_copyout(,%p,%d) failed.\n", pArgData->pvOut, cbBuf)); 559 560 /** @todo r=bird: why this extra return? setting rc = EFAULT; should do the trick, shouldn't it? */ 561 RTMemTmpFree(pvBuf); 562 return EFAULT; 560 rc = EFAULT; 563 561 } 564 562 } … … 573 571 RTMemTmpFree(pvBuf); 574 572 575 OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: returns %d cbOut=%d\n", rc, cbOut));576 573 return rc; 577 574 } … … 633 630 } 634 631 632 635 633 RTDECL(int) SUPR0Printf(const char *pszFormat, ...) 636 634 { … … 643 641 644 642 szMsg[sizeof(szMsg) - 1] = '\0'; 645 printf("%s", szMsg);643 uprintf("%s", szMsg); 646 644 return 0; 647 645 }
Note:
See TracChangeset
for help on using the changeset viewer.