VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c@ 8330

Last change on this file since 8330 was 8330, checked in by vboxsync, 17 years ago

Solaris vboxdrv: some memobj error handling fixes and cleanups.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.1 KB
Line 
1/* $Id: memobj-r0drv-solaris.c 8330 2008-04-23 14:21:31Z vboxsync $ */
2/** @file
3 * IPRT - Ring-0 Memory Objects, Solaris.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 *
26 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31
32/*******************************************************************************
33* Header Files *
34*******************************************************************************/
35#include "the-solaris-kernel.h"
36
37#include <iprt/memobj.h>
38#include <iprt/mem.h>
39#include <iprt/err.h>
40#include <iprt/assert.h>
41#include <iprt/log.h>
42#include <iprt/param.h>
43#include <iprt/process.h>
44#include "internal/memobj.h"
45
46
47/*******************************************************************************
48* Structures and Typedefs *
49*******************************************************************************/
50/**
51 * The Solaris version of the memory object structure.
52 */
53typedef struct RTR0MEMOBJSOLARIS
54{
55 /** The core structure. */
56 RTR0MEMOBJINTERNAL Core;
57 /** Pointer to kernel memory cookie. */
58 ddi_umem_cookie_t Cookie;
59 /** Shadow locked pages. */
60 page_t **ppShadowPages;
61} RTR0MEMOBJSOLARIS, *PRTR0MEMOBJSOLARIS;
62
63/**
64 * Used for supplying the solaris kernel info. about memory limits
65 * during contiguous allocations (i_ddi_mem_alloc)
66 */
67struct ddi_dma_attr g_SolarisX86PhysMemLimits =
68{
69 DMA_ATTR_V0, /* Version Number */
70 (uint64_t)0, /* lower limit */
71 (uint64_t)0xffffffff, /* high limit (32-bit PA, 4G) */
72 (uint64_t)0xffffffff, /* counter limit */
73 (uint64_t)PAGE_SIZE, /* alignment */
74 (uint64_t)PAGE_SIZE, /* burst size */
75 (uint64_t)PAGE_SIZE, /* effective DMA size */
76 (uint64_t)0xffffffff, /* max DMA xfer size */
77 (uint64_t)0xffffffff, /* segment boundary */
78 1, /* scatter-gather list length (1 for contiguous) */
79 1, /* device granularity */
80 0 /* bus-specific flags */
81};
82
83
84
85static uint64_t rtR0MemObjSolarisVirtToPhys(struct hat* hatSpace, caddr_t virtAddr)
86{
87 /* We could use paddr_t (more solaris-like) rather than uint64_t but paddr_t isn't defined for 64-bit */
88 pfn_t pfn = hat_getpfnum(hatSpace, virtAddr);
89 if (pfn == PFN_INVALID)
90 {
91 AssertMsgFailed(("rtR0MemObjSolarisVirtToPhys: hat_getpfnum for %p failed.\n", virtAddr));
92 return PFN_INVALID;
93 }
94
95 /* Both works, but second will work for non-page aligned virtAddr */
96#if 0
97 uint64_t physAddr = PAGE_SIZE * pfn;
98#else
99 uint64_t physAddr = ((uint64_t)pfn << MMU_PAGESHIFT) | ((uintptr_t)virtAddr & MMU_PAGEOFFSET);
100#endif
101 return physAddr;
102}
103
104
105int rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
106{
107 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)pMem;
108
109 switch (pMemSolaris->Core.enmType)
110 {
111 case RTR0MEMOBJTYPE_CONT:
112 i_ddi_mem_free(pMemSolaris->Core.pv, NULL);
113 break;
114
115 case RTR0MEMOBJTYPE_PAGE:
116 ddi_umem_free(pMemSolaris->Cookie);
117 break;
118
119 case RTR0MEMOBJTYPE_LOCK:
120 {
121 struct as *addrSpace;
122 if (pMemSolaris->Core.u.Lock.R0Process == NIL_RTR0PROCESS)
123 addrSpace = &kas;
124 else
125 addrSpace = ((proc_t *)pMemSolaris->Core.u.Lock.R0Process)->p_as;
126
127 as_pageunlock(addrSpace, pMemSolaris->ppShadowPages, pMemSolaris->Core.pv, pMemSolaris->Core.cb, S_WRITE);
128 break;
129 }
130
131 case RTR0MEMOBJTYPE_MAPPING:
132 {
133 struct hat *hatSpace;
134 struct as *addrSpace;
135 if (pMemSolaris->Core.u.Mapping.R0Process == NIL_RTR0PROCESS)
136 {
137 /* Kernel process*/
138 hatSpace = kas.a_hat;
139 addrSpace = &kas;
140 }
141 else
142 {
143 /* User process */
144 proc_t *userProc = (proc_t *)pMemSolaris->Core.u.Mapping.R0Process;
145 hatSpace = userProc->p_as->a_hat;
146 addrSpace = userProc->p_as;
147 }
148
149 rw_enter(&addrSpace->a_lock, RW_READER);
150 hat_unload(hatSpace, pMemSolaris->Core.pv, pMemSolaris->Core.cb, HAT_UNLOAD_UNLOCK);
151 rw_exit(&addrSpace->a_lock);
152 as_unmap(addrSpace, pMemSolaris->Core.pv, pMemSolaris->Core.cb);
153 break;
154 }
155
156 /* unused */
157 case RTR0MEMOBJTYPE_LOW:
158 case RTR0MEMOBJTYPE_PHYS:
159 case RTR0MEMOBJTYPE_RES_VIRT:
160 default:
161 AssertMsgFailed(("enmType=%d\n", pMemSolaris->Core.enmType));
162 return VERR_INTERNAL_ERROR;
163 }
164
165 return VINF_SUCCESS;
166}
167
168
169int rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
170{
171 /* Create the object */
172 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PAGE, NULL, cb);
173 if (!pMemSolaris)
174 return VERR_NO_MEMORY;
175
176 void *virtAddr = ddi_umem_alloc(cb, DDI_UMEM_SLEEP, &pMemSolaris->Cookie);
177 if (!virtAddr)
178 {
179 rtR0MemObjDelete(&pMemSolaris->Core);
180 return VERR_NO_PAGE_MEMORY;
181 }
182
183 pMemSolaris->Core.pv = virtAddr;
184 pMemSolaris->ppShadowPages = NULL;
185 *ppMem = &pMemSolaris->Core;
186 return VINF_SUCCESS;
187}
188
189
190int rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
191{
192 /* Try page alloc first */
193 int rc = rtR0MemObjNativeAllocPage(ppMem, cb, fExecutable);
194 if (RT_SUCCESS(rc))
195 {
196 size_t iPage = cb >> PAGE_SHIFT;
197 while (iPage-- > 0)
198 if (rtR0MemObjNativeGetPagePhysAddr(*ppMem, iPage) > (_4G - PAGE_SIZE))
199 {
200 /* Failed! Fall back to physical contiguous alloc */
201 RTR0MemObjFree(*ppMem, false);
202 rc = rtR0MemObjNativeAllocCont(ppMem, cb, fExecutable);
203 break;
204 }
205 }
206 return rc;
207}
208
209
210int rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
211{
212 NOREF(fExecutable);
213
214 /* Create the object */
215 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_CONT, NULL, cb);
216 if (!pMemSolaris)
217 return VERR_NO_MEMORY;
218
219 /* Allocate physically contiguous page-aligned memory. */
220 caddr_t virtAddr;
221 int rc = i_ddi_mem_alloc(NULL, &g_SolarisX86PhysMemLimits, cb, 1, 0, NULL, &virtAddr, NULL, NULL);
222 if (rc != DDI_SUCCESS)
223 {
224 rtR0MemObjDelete(&pMemSolaris->Core);
225 return VERR_NO_CONT_MEMORY;
226 }
227
228 pMemSolaris->Core.pv = virtAddr;
229 pMemSolaris->Core.u.Cont.Phys = rtR0MemObjSolarisVirtToPhys(kas.a_hat, virtAddr);
230 pMemSolaris->ppShadowPages = NULL;
231 *ppMem = &pMemSolaris->Core;
232 return VINF_SUCCESS;
233}
234
235
236int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
237{
238 /** @todo rtR0MemObjNativeAllocPhysNC / solaris */
239 return VERR_NOT_SUPPORTED; /* see the RTR0MemObjAllocPhysNC specs */
240}
241
242
243int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
244{
245 AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%VHp\n", PhysHighest), VERR_NOT_IMPLEMENTED);
246
247 return rtR0MemObjNativeAllocCont(ppMem, cb, false);
248}
249
250
251int rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb)
252{
253 /* Create the object */
254 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb);
255 if (!pMemSolaris)
256 return VERR_NO_MEMORY;
257
258 /* There is no allocation here, it needs to be mapped somewhere first */
259 pMemSolaris->Core.u.Phys.fAllocated = false;
260 pMemSolaris->Core.u.Phys.PhysBase = Phys;
261 *ppMem = &pMemSolaris->Core;
262 return VINF_SUCCESS;
263}
264
265
266int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, RTR0PROCESS R0Process)
267{
268 AssertReturn(R0Process == RTR0ProcHandleSelf(), VERR_INVALID_PARAMETER);
269
270 /* Create the locking object */
271 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_LOCK, (void *)R3Ptr, cb);
272 if (!pMemSolaris)
273 return VERR_NO_MEMORY;
274
275 proc_t *userproc = (proc_t *)R0Process;
276
277 struct as *useras = userproc->p_as;
278 page_t **ppl;
279
280 /* Lock down user pages */
281 int rc = as_pagelock(useras, &ppl, (caddr_t)R3Ptr, cb, S_WRITE);
282 if (!rc)
283 {
284 if (ppl)
285 {
286 pMemSolaris->Core.u.Lock.R0Process = (RTR0PROCESS)userproc;
287 pMemSolaris->ppShadowPages = ppl;
288 *ppMem = &pMemSolaris->Core;
289 return VINF_SUCCESS;
290 }
291
292 as_pageunlock(useras, ppl, (caddr_t)R3Ptr, cb, S_WRITE);
293 cmn_err(CE_NOTE, "rtR0MemObjNativeLockUser: as_pagelock failed to get shadow pages\n");
294 }
295 else
296 cmn_err(CE_NOTE,"rtR0MemObjNativeLockUser: as_pagelock failed rc=%d\n", rc);
297 rtR0MemObjDelete(pMemSolaris);
298 return VERR_LOCK_FAILED;
299}
300
301
302int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb)
303{
304 /* Create the locking object */
305 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_LOCK, pv, cb);
306 if (!pMemSolaris)
307 return VERR_NO_MEMORY;
308
309 caddr_t virtAddr = (caddr_t)((uintptr_t)pv & (uintptr_t)PAGEMASK);
310 page_t **ppl;
311
312 /* Lock down kernel pages */
313 int rc = as_pagelock(&kas, &ppl, virtAddr, cb, S_WRITE);
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
324 as_pageunlock(&kas, ppl, virtAddr, cb, S_WRITE);
325 cmn_err(CE_NOTE, "rtR0MemObjNativeLockKernel: failed to get shadow pages\n");
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}
332
333
334int rtR0MemObjNativeReserveKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment)
335{
336 return VERR_NOT_IMPLEMENTED;
337}
338
339
340int rtR0MemObjNativeReserveUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process)
341{
342 return VERR_NOT_IMPLEMENTED;
343}
344
345int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, unsigned fProt)
346{
347 PRTR0MEMOBJSOLARIS pMemToMapSolaris = (PRTR0MEMOBJSOLARIS)pMemToMap;
348 size_t size = pMemToMapSolaris->Core.cb;
349 void *pv = pMemToMapSolaris->Core.pv;
350 pgcnt_t cPages = btop(size);
351 pgcnt_t iPage;
352 caddr_t addr;
353 int rc;
354
355 /* Create the mapping object */
356 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pv, size);
357 if (!pMemSolaris)
358 return VERR_NO_MEMORY;
359
360 as_rangelock(&kas);
361 if (pvFixed != (void *)-1)
362 {
363 /* Use user specified address */
364 addr = (caddr_t)pvFixed;
365
366 /* Blow away any previous mapping */
367 as_unmap(&kas, addr, size);
368 }
369 else
370 {
371 /* Let the system choose an address */
372 map_addr(&addr, size, 0, 1, MAP_SHARED | MAP_ANONYMOUS);
373 if (addr == NULL)
374 {
375 as_rangeunlock(&kas);
376 cmn_err(CE_NOTE, "rtR0MemObjNativeMapKernel: map_addr failed\n");
377 return VERR_NO_MEMORY;
378 }
379
380 /* Check address against alignment, fail if it doesn't match */
381 if ((uintptr_t)addr & (uAlignment - 1))
382 {
383 as_rangeunlock(&kas);
384 cmn_err(CE_NOTE, "rtR0MemObjNativeMapKernel: map_addr alignment(%ld) failed.\n", uAlignment);
385 return VERR_MAP_FAILED;
386 }
387 }
388
389 /* Our protection masks are identical to <sys/mman.h> but we
390 * need to add PROT_USER for the pages to be accessible by user
391 */
392 struct segvn_crargs crArgs = SEGVN_ZFOD_ARGS(fProt | PROT_USER, PROT_ALL);
393 rc = as_map(&kas, addr, size, segvn_create, &crArgs);
394 as_rangeunlock(&kas);
395 if (rc != 0)
396 {
397 cmn_err(CE_NOTE, "rtR0MemObjNativeMapKernel: as_map failure.\n");
398 return VERR_NO_MEMORY;
399 }
400
401 /* Map each page into kernel space */
402 rw_enter(&kas.a_lock, RW_READER);
403 caddr_t kernAddr = pv;
404 caddr_t pageAddr = addr;
405 for (iPage = 0; iPage < cPages; iPage++)
406 {
407 page_t *pp = page_numtopp_nolock(hat_getpfnum(kas.a_hat, kernAddr));
408 hat_memload(kas.a_hat, pageAddr, pp, (fProt | PROT_USER), HAT_LOAD_LOCK);
409 pageAddr += ptob(1);
410 kernAddr += ptob(1);
411 }
412 rw_exit(&kas.a_lock);
413
414 pMemSolaris->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; /* means kernel */
415 pMemSolaris->Core.pv = addr;
416 *ppMem = &pMemSolaris->Core;
417 return VINF_SUCCESS;
418}
419
420
421int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)
422{
423 PRTR0MEMOBJSOLARIS pMemToMapSolaris = (PRTR0MEMOBJSOLARIS)pMemToMap;
424 size_t size = pMemToMapSolaris->Core.cb;
425 proc_t *userproc = (proc_t *)R0Process;
426 struct as *useras = userproc->p_as;
427 void *pv = pMemToMapSolaris->Core.pv;
428 pgcnt_t cPages = btop(size);
429 pgcnt_t iPage;
430 caddr_t addr;
431 int rc;
432
433 as_rangelock(useras);
434 if (R3PtrFixed != (RTR3PTR)-1)
435 {
436 /* Use user specified address */
437 addr = (caddr_t)R3PtrFixed;
438
439 /* Verify user address (a bit paranoid) */
440 rc = valid_usr_range(addr, size, fProt, useras, (caddr_t)USERLIMIT32);
441 if (rc != RANGE_OKAY)
442 {
443 as_rangeunlock(useras);
444 cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: valid_usr_range failed, returned %d\n", rc);
445 return VERR_INVALID_POINTER;
446 }
447
448 /* Blow away any previous mapping */
449 as_unmap(useras, addr, size);
450 }
451 else
452 {
453 /* Let the system choose an address */
454 map_addr(&addr, size, 0, 1, MAP_SHARED | MAP_ANONYMOUS);
455 if (addr == NULL)
456 {
457 as_rangeunlock(useras);
458 cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: map_addr failed\n");
459 return VERR_MAP_FAILED;
460 }
461
462 /* Check address against alignment, fail if it doesn't match */
463 if ((uintptr_t)addr & (uAlignment - 1))
464 {
465 as_rangeunlock(useras);
466 cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: map_addr alignment(%ld) failed.\n", uAlignment);
467 return VERR_MAP_FAILED;
468 }
469 }
470
471 /* Our protection masks are identical to <sys/mman.h> but we
472 * need to add PROT_USER for the pages to be accessible by user
473 */
474 struct segvn_crargs crArgs = SEGVN_ZFOD_ARGS(fProt | PROT_USER, PROT_ALL);
475 rc = as_map(useras, addr, size, segvn_create, &crArgs);
476 as_rangeunlock(useras);
477 if (rc != 0)
478 {
479 cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: as_map failure.\n");
480 return VERR_MAP_FAILED;
481 }
482
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. */
488 as_unmap(useras, addr, size);
489 return VERR_NO_MEMORY;
490 }
491
492 /* Map each page into user space */
493 rw_enter(&useras->a_lock, RW_READER);
494 caddr_t kernAddr = pv;
495 caddr_t pageAddr = addr;
496 for (iPage = 0; iPage < cPages; iPage++)
497 {
498 page_t *pp = page_numtopp_nolock(hat_getpfnum(kas.a_hat, kernAddr));
499 hat_memload(useras->a_hat, pageAddr, pp, (fProt | PROT_USER), HAT_LOAD_LOCK);
500 pageAddr += ptob(1);
501 kernAddr += ptob(1);
502 }
503 rw_exit(&useras->a_lock);
504
505 pMemSolaris->Core.u.Mapping.R0Process = (RTR0PROCESS)userproc;
506 pMemSolaris->Core.pv = addr;
507 *ppMem = &pMemSolaris->Core;
508 return VINF_SUCCESS;
509}
510
511
512RTHCPHYS rtR0MemObjNativeGetPagePhysAddr(PRTR0MEMOBJINTERNAL pMem, size_t iPage)
513{
514 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)pMem;
515
516 switch (pMemSolaris->Core.enmType)
517 {
518 case RTR0MEMOBJTYPE_PAGE:
519 case RTR0MEMOBJTYPE_LOW:
520 case RTR0MEMOBJTYPE_MAPPING:
521 {
522 uint8_t *pb = (uint8_t *)pMemSolaris->Core.pv + ((size_t)iPage << PAGE_SHIFT);
523 return rtR0MemObjSolarisVirtToPhys(kas.a_hat, pb);
524 }
525
526 case RTR0MEMOBJTYPE_LOCK:
527 {
528 struct hat *hatSpace;
529 if (pMemSolaris->Core.u.Lock.R0Process != NIL_RTR0PROCESS)
530 {
531 /* User */
532 proc_t *userProc = (proc_t *)pMemSolaris->Core.u.Lock.R0Process;
533 hatSpace = userProc->p_as->a_hat;
534 }
535 else /* Kernel */
536 hatSpace = kas.a_hat;
537
538 uint8_t *pb = (uint8_t *)pMemSolaris->Core.pv + ((size_t)iPage << PAGE_SHIFT);
539 return rtR0MemObjSolarisVirtToPhys(hatSpace, pb);
540 }
541
542 case RTR0MEMOBJTYPE_CONT:
543 return pMemSolaris->Core.u.Cont.Phys + (iPage << PAGE_SHIFT);
544
545 case RTR0MEMOBJTYPE_PHYS:
546 return pMemSolaris->Core.u.Phys.PhysBase + (iPage << PAGE_SHIFT);
547
548 case RTR0MEMOBJTYPE_PHYS_NC:
549 AssertFailed(/* not implemented */);
550 case RTR0MEMOBJTYPE_RES_VIRT:
551 default:
552 return NIL_RTHCPHYS;
553 }
554}
555
Note: See TracBrowser for help on using the repository browser.

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