Changeset 24425 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Nov 6, 2009 7:36:50 AM (15 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/solaris/vbi
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/i86pc/os/vbi.c
r24386 r24425 667 667 668 668 int 669 vbi_lock_va(void *addr, size_t len, void **handle)669 vbi_lock_va(void *addr, size_t len, int access, void **handle) 670 670 { 671 671 faultcode_t err; … … 677 677 if (!IS_KERNEL(addr)) { 678 678 err = as_fault(VBIPROC()->p_as->a_hat, VBIPROC()->p_as, 679 (caddr_t)addr, len, F_SOFTLOCK, S_WRITE);679 (caddr_t)addr, len, F_SOFTLOCK, access); 680 680 if (err != 0) { 681 681 VBI_VERBOSE("vbi_lock_va() failed to lock"); … … 688 688 /*ARGSUSED*/ 689 689 void 690 vbi_unlock_va(void *addr, size_t len, void *handle)690 vbi_unlock_va(void *addr, size_t len, int access, void *handle) 691 691 { 692 692 if (!IS_KERNEL(addr)) 693 693 as_fault(VBIPROC()->p_as->a_hat, VBIPROC()->p_as, 694 (caddr_t)addr, len, F_SOFTUNLOCK, S_WRITE);694 (caddr_t)addr, len, F_SOFTUNLOCK, access); 695 695 } 696 696 -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/i86pc/sys/vbi.h
r21452 r24425 210 210 * returns 0 for success, non-zero errno on failure 211 211 */ 212 extern int vbi_lock_va(void *addr, size_t len, void **handle);213 extern void vbi_unlock_va(void *addr, size_t len, void *handle);212 extern int vbi_lock_va(void *addr, size_t len, int access, void **handle); 213 extern void vbi_unlock_va(void *addr, size_t len, int access, void *handle); 214 214 215 215 /* -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/memobj-r0drv-solaris.c
r24386 r24425 59 59 ddi_umem_cookie_t Cookie; 60 60 /** Shadow locked pages. */ 61 void *handle; 61 void *pvHandle; 62 /** Access during locking. */ 63 int fAccess; 62 64 } RTR0MEMOBJSOLARIS, *PRTR0MEMOBJSOLARIS; 63 65 … … 83 85 84 86 case RTR0MEMOBJTYPE_LOCK: 85 vbi_unlock_va(pMemSolaris->Core.pv, pMemSolaris->Core.cb, pMemSolaris-> handle);87 vbi_unlock_va(pMemSolaris->Core.pv, pMemSolaris->Core.cb, pMemSolaris->fAccess, pMemSolaris->pvHandle); 86 88 break; 87 89 … … 125 127 126 128 pMemSolaris->Core.pv = virtAddr; 127 pMemSolaris-> handle = NULL;129 pMemSolaris->pvHandle = NULL; 128 130 *ppMem = &pMemSolaris->Core; 129 131 return VINF_SUCCESS; … … 150 152 } 151 153 pMemSolaris->Core.pv = virtAddr; 152 pMemSolaris-> handle = NULL;154 pMemSolaris->pvHandle = NULL; 153 155 *ppMem = &pMemSolaris->Core; 154 156 return VINF_SUCCESS; … … 177 179 pMemSolaris->Core.pv = virtAddr; 178 180 pMemSolaris->Core.u.Cont.Phys = phys; 179 pMemSolaris-> handle = NULL;181 pMemSolaris->pvHandle = NULL; 180 182 *ppMem = &pMemSolaris->Core; 181 183 return VINF_SUCCESS; … … 223 225 return VERR_NO_MEMORY; 224 226 225 void *ppl; 227 int fPageAccess = S_READ; 228 if (fPageAccess & RTMEM_PROT_WRITE) 229 fPageAccess = S_WRITE; 230 if (fPageAccess & RTMEM_PROT_EXEC) 231 fPageAccess = S_EXEC; 232 void *pvPageList = NULL; 226 233 227 234 /* Lock down user pages */ 228 int rc = vbi_lock_va((caddr_t)R3Ptr, cb, &ppl);235 int rc = vbi_lock_va((caddr_t)R3Ptr, cb, fPageAccess, &pvPageList); 229 236 if (rc != 0) 230 237 { … … 235 242 236 243 pMemSolaris->Core.u.Lock.R0Process = (RTR0PROCESS)vbi_proc(); 237 pMemSolaris->handle = ppl; 244 pMemSolaris->pvHandle = pvPageList; 245 pMemSolaris->fAccess = fPageAccess; 238 246 *ppMem = &pMemSolaris->Core; 239 247 return VINF_SUCCESS; … … 249 257 return VERR_NO_MEMORY; 250 258 251 void *ppl; 252 int rc = vbi_lock_va((caddr_t)pv, cb, &ppl); 259 int fPageAccess = S_READ; 260 if (fPageAccess & RTMEM_PROT_WRITE) 261 fPageAccess = S_WRITE; 262 if (fPageAccess & RTMEM_PROT_EXEC) 263 fPageAccess = S_EXEC; 264 void *pvPageList = NULL; 265 int rc = vbi_lock_va((caddr_t)pv, cb, fPageAccess, &pvPageList); 253 266 if (rc != 0) 254 267 { … … 259 272 260 273 pMemSolaris->Core.u.Lock.R0Process = NIL_RTR0PROCESS; 261 pMemSolaris->handle = ppl; 274 pMemSolaris->pvHandle = pvPageList; 275 pMemSolaris->fAccess = fPageAccess; 262 276 *ppMem = &pMemSolaris->Core; 263 277 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.