Changeset 8330 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Apr 23, 2008 2:21:31 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
r8327 r8330 312 312 /* Lock down kernel pages */ 313 313 int rc = as_pagelock(&kas, &ppl, virtAddr, cb, S_WRITE); 314 if (rc != 0) 315 { 316 cmn_err(CE_NOTE,"rtR0MemObjNativeLockKernel: as_pagelock failed rc=%d\n", rc); 317 return VERR_LOCK_FAILED; 318 } 319 320 if (!ppl) 321 { 314 if (!rc) 315 { 316 if (ppl) 317 { 318 pMemSolaris->Core.u.Lock.R0Process = NIL_RTR0PROCESS; /* means kernel, see rtR0MemObjNativeFree() */ 319 pMemSolaris->ppShadowPages = ppl; 320 *ppMem = &pMemSolaris->Core; 321 return VINF_SUCCESS; 322 } 323 322 324 as_pageunlock(&kas, ppl, virtAddr, cb, S_WRITE); 323 325 cmn_err(CE_NOTE, "rtR0MemObjNativeLockKernel: failed to get shadow pages\n"); 324 return VERR_LOCK_FAILED; 325 } 326 327 pMemSolaris->Core.u.Lock.R0Process = NIL_RTR0PROCESS; /* means kernel, see rtR0MemObjNativeFree() */ 328 pMemSolaris->ppShadowPages = ppl; 329 *ppMem = &pMemSolaris->Core; 330 return VINF_SUCCESS; 326 } 327 else 328 cmn_err(CE_NOTE,"rtR0MemObjNativeLockKernel: as_pagelock failed rc=%d\n", rc); 329 rtR0MemObjDelete(pMemSolaris); 330 return VERR_LOCK_FAILED; 331 331 } 332 332 … … 431 431 int rc; 432 432 433 /* Create the mapping object */434 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pv, size);435 if (!pMemSolaris)436 return VERR_NO_MEMORY;437 438 433 as_rangelock(useras); 439 434 if (R3PtrFixed != (RTR3PTR)-1) … … 486 481 } 487 482 488 #if 0 489 /* Lock down the pages and get the shadow page list 490 * In this case we must as_pageunlock if(ppShadowPages) exists while freeing CONT, PAGE 491 */ 492 rc = as_pagelock(&kas, &pMemToMapSolaris->ppShadowPages, pv, size, S_WRITE); 493 if (rc != 0 || pMemToMapSolaris->ppShadowPages == NULL) 494 { 495 cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: as_pagelock failed\n"); 483 /* Create the mapping object */ 484 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pv, size); 485 if (!pMemSolaris) 486 { 487 /* Undo mapping on failure. */ 496 488 as_unmap(useras, addr, size); 497 489 return VERR_NO_MEMORY; 498 490 } 499 491 500 /* Map each page into user space */501 rw_enter(&useras->a_lock, RW_READER);502 caddr_t pageAddr = addr;503 for (iPage = 0; iPage < cPages; iPage++)504 {505 hat_memload(useras->a_hat, pageAddr, pMemToMapSolaris->ppShadowPages[iPage], fProt | PROT_USER,506 HAT_LOAD_NOCONSIST | HAT_STRICTORDER | HAT_LOAD_LOCK);507 pageAddr += ptob(1);508 }509 rw_exit(&useras->a_lock, RW_READER);510 #else511 492 /* Map each page into user space */ 512 493 rw_enter(&useras->a_lock, RW_READER); … … 521 502 } 522 503 rw_exit(&useras->a_lock); 523 #endif524 504 525 505 pMemSolaris->Core.u.Mapping.R0Process = (RTR0PROCESS)userproc;
Note:
See TracChangeset
for help on using the changeset viewer.