Changeset 6280 in vbox
- Timestamp:
- Jan 8, 2008 2:19:00 PM (17 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp
r6246 r6280 269 269 * @returns IPRT status code 270 270 * 271 * @rema kes This currently does not accept more than 255 bytes of data at271 * @remarks This currently does not accept more than 255 bytes of data at 272 272 * one time. It should probably be rewritten to use pass a pointer 273 273 * in the IOCtl. … … 290 290 } 291 291 292 /** 293 * Change the IRQ filter mask. 294 * 295 * @returns IPRT status code 296 */ 297 VBGLR3DECL(int) VbglR3CtlFilterMask(uint32_t u32OrMask, uint32_t u32NotMask) 298 { 299 VBoxGuestFilterMaskInfo info; 300 301 info.u32OrMask = u32OrMask; 302 info.u32NotMask = u32NotMask; 303 return vbglR3DoIOCtl(VBOXGUEST_IOCTL_CTL_FILTER_MASK, &info, sizeof(info)); 304 } 305 -
trunk/src/VBox/Additions/linux/module/vboxmod.c
r6279 r6280 313 313 314 314 /** 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 */ 321 static 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 /** 315 349 * IOCTL handler 316 350 * … … 446 480 break; 447 481 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 } 448 494 default: 449 495 LogRelFunc(("unknown command: %x\n", cmd));
Note:
See TracChangeset
for help on using the changeset viewer.