VirtualBox

Ignore:
Timestamp:
Sep 12, 2007 6:44:18 AM (17 years ago)
Author:
vboxsync
Message:

Solaris changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/solaris/SUPDrv-solaris.c

    r4550 r4717  
    4747/** The module name. */
    4848#define DEVICE_NAME              "vboxdrv"
     49/** The module description as seen in 'modinfo'. */
    4950#define DEVICE_DESC              "VirtualBox Driver"
     51/** Maximum number of driver instances. */
    5052#define DEVICE_MAXINSTANCES      16
    5153
     
    5456*   Internal Functions                                                         *
    5557*******************************************************************************/
    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);
     58static int VBoxDrvSolarisOpen(dev_t *pDev, int fFlag, int fType, cred_t *pCred);
     59static int VBoxDrvSolarisClose(dev_t Dev, int fFlag, int fType, cred_t *pCred);
     60static int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred);
     61static int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred);
     62static int VBoxDrvSolarisIOCtl (dev_t Dev, int Cmd, intptr_t pArgs, int mode, cred_t *pCred, int *pVal);
     63
     64static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t Cmd);
     65static int VBoxDrvSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t Cmd);
    6466
    6567static int VBoxSupDrvErr2SolarisErr(int rc);
     
    131133};
    132134
    133 /** State info. each our kernel module instances */
     135/** State info. for each driver instance. */
    134136typedef struct
    135137{
    136     dev_info_t*     pDip;   /* Device handle */
     138    dev_info_t     *pDip;   /* Device handle */
    137139} vbox_devstate_t;
    138140
    139141/** Opaque pointer to state */
    140 static void* g_pVBoxDrvSolarisState;
     142static void *g_pVBoxDrvSolarisState;
    141143
    142144/** Device extention & session data association structure */
     
    207209    if (RT_SUCCESS(rc))
    208210    {
    209         cmn_err(CE_NOTE,"supdrvCreateSession success");
    210211        RTSPINLOCKTMP   Tmp = RTSPINLOCKTMP_INITIALIZER;
    211212        unsigned        iHash;
     
    237238    if (instance >= DEVICE_MAXINSTANCES)
    238239    {
    239         cmn_err(CE_NOTE, "All instances exhausted\n");
     240        cmn_err(CE_NOTE, "VBoxDrvSolarisOpen: All instances exhausted\n");
    240241        return ENXIO;
    241242    }
     
    301302}
    302303
    303 static int VBoxDrvSolarisRead(dev_t dev, struct uio* pUio, cred_t* credp)
     304static int VBoxDrvSolarisRead(dev_t Dev, struct uio *pUio, cred_t *pCred)
    304305{
    305306    cmn_err(CE_CONT, "VBoxDrvSolarisRead");
     
    307308}
    308309
    309 static int VBoxDrvSolarisWrite(dev_t dev, struct uio* pUio, cred_t* credp)
     310static int VBoxDrvSolarisWrite(dev_t Dev, struct uio *pUio, cred_t *pCred)
    310311{
    311312    cmn_err(CE_CONT, "VBoxDrvSolarisWrite");
     
    321322 * @return  corresponding solaris error code.
    322323 */
    323 static int VBoxDrvSolarisAttach(dev_info_t* pDip, ddi_attach_cmd_t enmCmd)
     324static int VBoxDrvSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd)
    324325{
    325326    cmn_err(CE_CONT, "VBoxDrvSolarisAttach");
    326327    int rc = VINF_SUCCESS;
    327328    int instance = 0;
    328     vbox_devstate_t* pState;
     329    vbox_devstate_t *pState;
    329330   
    330331    switch (enmCmd)
     
    412413    int rc = VINF_SUCCESS;
    413414    int instance;
    414     register vbox_devstate_t* pState;
     415    register vbox_devstate_t *pState;
    415416
    416417    cmn_err(CE_CONT, "VBoxDrvSolarisDetach");
     
    557558            {
    558559                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;
    563561            }
    564562        }
     
    573571        RTMemTmpFree(pvBuf);
    574572   
    575     OSDBGPRINT(("VBoxDrvSolarisIOCtlSlow: returns %d cbOut=%d\n", rc, cbOut));
    576573    return rc;
    577574}
     
    633630}
    634631
     632
    635633RTDECL(int) SUPR0Printf(const char *pszFormat, ...)
    636634{
     
    643641
    644642    szMsg[sizeof(szMsg) - 1] = '\0';
    645     printf("%s", szMsg);
     643    uprintf("%s", szMsg);
    646644    return 0;
    647645}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette