VirtualBox

Ignore:
Timestamp:
Jan 8, 2008 2:19:00 PM (17 years ago)
Author:
vboxsync
Message:

Guest Additions: added a ring 3 library function to set the interrupt filter and the corresponding Linux kernel code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/linux/module/vboxmod.c

    r6279 r6280  
    313313
    314314/**
     315 * IOCtl handler.  Control the interrupt filter mask to specify which VMMDev interrupts
     316 * we know how to handle.
     317 *
     318 * @returns iprt status code
     319 * @param pInfo kernel space pointer to the filter mask change info
     320 */
     321static int vboxadd_control_filter_mask(VBoxGuestFilterMaskInfo *pInfo)
     322{
     323    VMMDevCtlGuestFilterMask *pReq;
     324    int rc = VbglGRAlloc((VMMDevRequestHeader **)&pReq, sizeof(*pReq), VMMDevReq_CtlGuestFilterMask);
     325    if (RT_FAILURE(rc))
     326    {
     327        Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: failed to allocate %u (%#x) bytes to cache the request. rc=%d!!\n",
     328             sizeof(*pReq), sizeof(*pReq), rc));
     329        return rc;
     330    }
     331
     332    pReq->u32OrMask = pInfo->u32OrMask;
     333    pReq->u32NotMask = pInfo->u32NotMask;
     334
     335    rc = VbglGRPerform(&pReq->header);
     336    if (RT_FAILURE(rc))
     337        Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: VbglGRPerform failed, rc=%Rrc!\n", rc));
     338    else if (RT_FAILURE(pReq->header.rc))
     339    {
     340        Log(("VBoxGuestCommonIOCtl: CTL_FILTER_MASK: The request failed; VMMDev rc=%Rrc!\n", pReq->header.rc));
     341        rc = pReq->header.rc;
     342    }
     343
     344    VbglGRFree(&pReq->header);
     345    return rc;
     346}
     347
     348/**
    315349 * IOCTL handler
    316350 *
     
    446480                break;
    447481
     482        case VBOXGUEST_IOCTL_CTL_FILTER_MASK:
     483        {
     484                VBoxGuestFilterMaskInfo info;
     485                if (copy_to_user((void*)arg, (void*)&info, sizeof(info)))
     486                {
     487                    LogRelFunc(("VBOXGUEST_IOCTL_CTL_FILTER_MASK: error getting parameters from user space!\n"));
     488                    rc = -EFAULT;
     489                    break;
     490                }
     491                rc = -RTErrConvertToErrno(vboxadd_control_filter_mask(&info));
     492                break;
     493        }
    448494        default:
    449495                LogRelFunc(("unknown command: %x\n", cmd));
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