VirtualBox

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

Last change on this file since 29281 was 29027, checked in by vboxsync, 15 years ago

RTR0MemObjEnterPhys/rtR0MemObjNativeEnterPhys: Validate the cache policy in the common code. Use uint32_t as parameter type. All native implementations must set the policy member.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.1 KB
Line 
1/* $Id: memobj-r0drv-solaris.c 29027 2010-05-04 14:33:41Z vboxsync $ */
2/** @file
3 * IPRT - Ring-0 Memory Objects, Solaris.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Oracle Corporation
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
27
28/*******************************************************************************
29* Header Files *
30*******************************************************************************/
31#include "../the-solaris-kernel.h"
32#include "internal/iprt.h"
33#include <iprt/memobj.h>
34
35#include <iprt/assert.h>
36#include <iprt/err.h>
37#include <iprt/log.h>
38#include <iprt/mem.h>
39#include <iprt/param.h>
40#include <iprt/process.h>
41#include "internal/memobj.h"
42
43/*******************************************************************************
44* Structures and Typedefs *
45*******************************************************************************/
46/**
47 * The Solaris version of the memory object structure.
48 */
49typedef struct RTR0MEMOBJSOLARIS
50{
51 /** The core structure. */
52 RTR0MEMOBJINTERNAL Core;
53 /** Pointer to kernel memory cookie. */
54 ddi_umem_cookie_t Cookie;
55 /** Shadow locked pages. */
56 void *pvHandle;
57 /** Access during locking. */
58 int fAccess;
59} RTR0MEMOBJSOLARIS, *PRTR0MEMOBJSOLARIS;
60
61
62
63int rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
64{
65 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)pMem;
66
67 switch (pMemSolaris->Core.enmType)
68 {
69 case RTR0MEMOBJTYPE_LOW:
70 vbi_lowmem_free(pMemSolaris->Core.pv, pMemSolaris->Core.cb);
71 break;
72
73 case RTR0MEMOBJTYPE_CONT:
74 case RTR0MEMOBJTYPE_PHYS:
75 vbi_phys_free(pMemSolaris->Core.pv, pMemSolaris->Core.cb);
76 break;
77
78 case RTR0MEMOBJTYPE_PHYS_NC:
79#if 0
80 vbi_phys_free(pMemSolaris->Core.pv, pMemSolaris->Core.cb);
81#else
82 if (pMemSolaris->Core.u.Phys.fAllocated == true)
83 ddi_umem_free(pMemSolaris->Cookie);
84 else
85 vbi_pages_free(pMemSolaris->pvHandle, pMemSolaris->Core.cb);
86#endif
87 break;
88
89 case RTR0MEMOBJTYPE_PAGE:
90 ddi_umem_free(pMemSolaris->Cookie);
91 break;
92
93 case RTR0MEMOBJTYPE_LOCK:
94 vbi_unlock_va(pMemSolaris->Core.pv, pMemSolaris->Core.cb, pMemSolaris->fAccess, pMemSolaris->pvHandle);
95 break;
96
97 case RTR0MEMOBJTYPE_MAPPING:
98 vbi_unmap(pMemSolaris->Core.pv, pMemSolaris->Core.cb);
99 break;
100
101 case RTR0MEMOBJTYPE_RES_VIRT:
102 {
103 if (pMemSolaris->Core.u.ResVirt.R0Process == NIL_RTR0PROCESS)
104 vmem_xfree(heap_arena, pMemSolaris->Core.pv, pMemSolaris->Core.cb);
105 else
106 AssertFailed();
107 break;
108 }
109
110 default:
111 AssertMsgFailed(("enmType=%d\n", pMemSolaris->Core.enmType));
112 return VERR_INTERNAL_ERROR;
113 }
114
115 return VINF_SUCCESS;
116}
117
118
119int rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
120{
121 /* Create the object. */
122 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PAGE, NULL, cb);
123 if (!pMemSolaris)
124 return VERR_NO_MEMORY;
125
126 void *virtAddr = ddi_umem_alloc(cb, DDI_UMEM_SLEEP, &pMemSolaris->Cookie);
127 if (!virtAddr)
128 {
129 rtR0MemObjDelete(&pMemSolaris->Core);
130 return VERR_NO_PAGE_MEMORY;
131 }
132
133 pMemSolaris->Core.pv = virtAddr;
134 pMemSolaris->pvHandle = NULL;
135 *ppMem = &pMemSolaris->Core;
136 return VINF_SUCCESS;
137}
138
139
140int rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
141{
142 NOREF(fExecutable);
143
144 /* Create the object */
145 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_LOW, NULL, cb);
146 if (!pMemSolaris)
147 return VERR_NO_MEMORY;
148
149 /* Allocate physically low page-aligned memory. */
150 uint64_t physAddr = _4G - 1;
151 caddr_t virtAddr = vbi_lowmem_alloc(physAddr, cb);
152 if (virtAddr == NULL)
153 {
154 rtR0MemObjDelete(&pMemSolaris->Core);
155 return VERR_NO_LOW_MEMORY;
156 }
157 pMemSolaris->Core.pv = virtAddr;
158 pMemSolaris->pvHandle = NULL;
159 *ppMem = &pMemSolaris->Core;
160 return VINF_SUCCESS;
161}
162
163
164int rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable)
165{
166 NOREF(fExecutable);
167 return rtR0MemObjNativeAllocPhys(ppMem, cb, _4G - 1, PAGE_SIZE /* alignment */);
168}
169
170
171int rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest)
172{
173#if HC_ARCH_BITS == 64
174 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS_NC, NULL, cb);
175 if (!pMemSolaris)
176 return VERR_NO_MEMORY;
177
178 /* Allocate physically non-contiguous page-aligned memory. */
179 uint64_t physAddr = PhysHighest;
180
181#if 0
182 /*
183 * The contig_alloc() way of allocating NC pages is broken or does not match our semantics. Refer #4716 for details.
184 */
185 /* caddr_t virtAddr = vbi_phys_alloc(&physAddr, cb, PAGE_SIZE, 0 /* non-contiguous */); */
186 caddr_t virtAddr = ddi_umem_alloc(cb, DDI_UMEM_SLEEP, &pMemSolaris->Cookie);
187 if (RT_UNLIKELY(virtAddr == NULL))
188 {
189 rtR0MemObjDelete(&pMemSolaris->Core);
190 return VERR_NO_MEMORY;
191 }
192 pMemSolaris->Core.pv = virtAddr;
193 pMemSolaris->Core.u.Phys.PhysBase = physAddr;
194 pMemSolaris->Core.u.Phys.fAllocated = true;
195 pMemSolaris->pvHandle = NULL;
196#else
197 void *pvPages = vbi_pages_alloc(&physAddr, cb);
198 if (!pvPages)
199 {
200 LogRel(("rtR0MemObjNativeAllocPhysNC: vbi_pages_alloc failed.\n"));
201 rtR0MemObjDelete(&pMemSolaris->Core);
202 return VERR_NO_MEMORY;
203 }
204 pMemSolaris->Core.pv = NULL;
205 pMemSolaris->Core.u.Phys.PhysBase = physAddr;
206 pMemSolaris->Core.u.Phys.fAllocated = false;
207 pMemSolaris->pvHandle = pvPages;
208#endif
209
210 Assert(!(physAddr & PAGE_OFFSET_MASK));
211 *ppMem = &pMemSolaris->Core;
212 return VINF_SUCCESS;
213#else
214 /** @todo rtR0MemObjNativeAllocPhysNC / solaris */
215 return VERR_NOT_SUPPORTED; /* see the RTR0MemObjAllocPhysNC specs */
216#endif
217}
218
219
220int rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment)
221{
222 AssertMsgReturn(PhysHighest >= 16 *_1M, ("PhysHigest=%RHp\n", PhysHighest), VERR_NOT_IMPLEMENTED);
223
224 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb);
225 if (!pMemSolaris)
226 return VERR_NO_MEMORY;
227
228 AssertCompile(NIL_RTHCPHYS == UINT64_MAX);
229
230 /* Allocate physically contiguous memory aligned as specified. */
231 uint64_t physAddr = PhysHighest;
232 caddr_t virtAddr = vbi_phys_alloc(&physAddr, cb, uAlignment, 1 /* contiguous */);
233 if (RT_UNLIKELY(virtAddr == NULL))
234 {
235 rtR0MemObjDelete(&pMemSolaris->Core);
236 return VERR_NO_CONT_MEMORY;
237 }
238 Assert(!(physAddr & PAGE_OFFSET_MASK));
239 Assert(physAddr < PhysHighest);
240 Assert(physAddr + cb <= PhysHighest);
241#if 0
242 if (uAlignment != PAGE_SIZE)
243 {
244 /* uAlignment is always a multiple of PAGE_SIZE */
245 pgcnt_t cPages = (cb + uAlignment - 1) >> PAGE_SHIFT;
246 void *pvPage = virtAddr;
247 while (cPages-- > 0)
248 {
249 uint64_t u64Page = vbi_va_to_pa(pvPage);
250 if (u64Page & (uAlignment - 1))
251 {
252 LogRel(("rtR0MemObjNativeAllocPhys: alignment mismatch! cb=%u uAlignment=%u physAddr=%#x\n", cb, uAlignment, u64Page));
253 vbi_phys_free(virtAddr, cb);
254 rtR0MemObjDelete(&pMemSolaris->Core);
255 return VERR_NO_MEMORY;
256 }
257 pvPage = (void *)((uintptr_t)pvPage + PAGE_SIZE);
258 }
259 }
260#endif
261 pMemSolaris->Core.pv = virtAddr;
262 pMemSolaris->Core.u.Cont.Phys = physAddr;
263 pMemSolaris->pvHandle = NULL;
264 *ppMem = &pMemSolaris->Core;
265 return VINF_SUCCESS;
266}
267
268
269int rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy)
270{
271 AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_IMPLEMENTED);
272
273 /* Create the object. */
274 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_PHYS, NULL, cb);
275 if (!pMemSolaris)
276 return VERR_NO_MEMORY;
277
278 /* There is no allocation here, it needs to be mapped somewhere first. */
279 pMemSolaris->Core.u.Phys.fAllocated = false;
280 pMemSolaris->Core.u.Phys.PhysBase = Phys;
281 pMemSolaris->Core.u.Phys.uCachePolicy = uCachePolicy;
282 *ppMem = &pMemSolaris->Core;
283 return VINF_SUCCESS;
284}
285
286
287int rtR0MemObjNativeLockUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3Ptr, size_t cb, uint32_t fAccess, RTR0PROCESS R0Process)
288{
289 AssertReturn(R0Process == RTR0ProcHandleSelf(), VERR_INVALID_PARAMETER);
290 NOREF(fAccess);
291
292 /* Create the locking object */
293 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_LOCK, (void *)R3Ptr, cb);
294 if (!pMemSolaris)
295 return VERR_NO_MEMORY;
296
297 int fPageAccess = S_READ;
298 if (fAccess & RTMEM_PROT_WRITE)
299 fPageAccess = S_WRITE;
300 if (fAccess & RTMEM_PROT_EXEC)
301 fPageAccess = S_EXEC;
302 void *pvPageList = NULL;
303
304 /* Lock down user pages */
305 int rc = vbi_lock_va((caddr_t)R3Ptr, cb, fPageAccess, &pvPageList);
306 if (rc != 0)
307 {
308 LogRel(("rtR0MemObjNativeLockUser: vbi_lock_va failed rc=%d\n", rc));
309 rtR0MemObjDelete(&pMemSolaris->Core);
310 return VERR_LOCK_FAILED;
311 }
312
313 pMemSolaris->Core.u.Lock.R0Process = (RTR0PROCESS)vbi_proc();
314 pMemSolaris->pvHandle = pvPageList;
315 pMemSolaris->fAccess = fPageAccess;
316 *ppMem = &pMemSolaris->Core;
317 return VINF_SUCCESS;
318}
319
320
321int rtR0MemObjNativeLockKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pv, size_t cb, uint32_t fAccess)
322{
323 NOREF(fAccess);
324
325 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_LOCK, pv, cb);
326 if (!pMemSolaris)
327 return VERR_NO_MEMORY;
328
329 int fPageAccess = S_READ;
330 if (fAccess & RTMEM_PROT_WRITE)
331 fPageAccess = S_WRITE;
332 if (fAccess & RTMEM_PROT_EXEC)
333 fPageAccess = S_EXEC;
334 void *pvPageList = NULL;
335 int rc = vbi_lock_va((caddr_t)pv, cb, fPageAccess, &pvPageList);
336 if (rc != 0)
337 {
338 LogRel(("rtR0MemObjNativeLockKernel: vbi_lock_va failed rc=%d\n", rc));
339 rtR0MemObjDelete(&pMemSolaris->Core);
340 return VERR_LOCK_FAILED;
341 }
342
343 pMemSolaris->Core.u.Lock.R0Process = NIL_RTR0PROCESS;
344 pMemSolaris->pvHandle = pvPageList;
345 pMemSolaris->fAccess = fPageAccess;
346 *ppMem = &pMemSolaris->Core;
347 return VINF_SUCCESS;
348}
349
350
351int rtR0MemObjNativeReserveKernel(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment)
352{
353 PRTR0MEMOBJSOLARIS pMemSolaris;
354
355 /*
356 * Use xalloc.
357 */
358 void *pv = vmem_xalloc(heap_arena, cb, uAlignment, 0 /*phase*/, 0 /*nocross*/,
359 NULL /*minaddr*/, NULL /*maxaddr*/, VM_SLEEP);
360 if (RT_UNLIKELY(!pv))
361 return VERR_NO_MEMORY;
362
363 /* Create the object. */
364 pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_RES_VIRT, pv, cb);
365 if (!pMemSolaris)
366 {
367 LogRel(("rtR0MemObjNativeReserveKernel failed to alloc memory object.\n"));
368 vmem_xfree(heap_arena, pv, cb);
369 return VERR_NO_MEMORY;
370 }
371
372 pMemSolaris->Core.u.ResVirt.R0Process = NIL_RTR0PROCESS;
373 *ppMem = &pMemSolaris->Core;
374 return VINF_SUCCESS;
375}
376
377
378int rtR0MemObjNativeReserveUser(PPRTR0MEMOBJINTERNAL ppMem, RTR3PTR R3PtrFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process)
379{
380 return VERR_NOT_IMPLEMENTED;
381}
382
383int rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment,
384 unsigned fProt, size_t offSub, size_t cbSub)
385{
386 /** @todo rtR0MemObjNativeMapKernel / Solaris - Should be fairly simple alloc kernel memory and memload it. */
387 return VERR_NOT_IMPLEMENTED;
388}
389
390
391int rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, PRTR0MEMOBJINTERNAL pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, unsigned fProt, RTR0PROCESS R0Process)
392{
393 AssertMsgReturn(R3PtrFixed == (RTR3PTR)-1, ("%p\n", R3PtrFixed), VERR_NOT_SUPPORTED);
394 AssertMsgReturn(R0Process == RTR0ProcHandleSelf(), ("%p != %p\n", R0Process, RTR0ProcHandleSelf()), VERR_NOT_SUPPORTED);
395 if (uAlignment != PAGE_SIZE)
396 return VERR_NOT_SUPPORTED;
397
398 PRTR0MEMOBJSOLARIS pMemToMapSolaris = (PRTR0MEMOBJSOLARIS)pMemToMap;
399 size_t cb = pMemToMapSolaris->Core.cb;
400 void *pv = pMemToMapSolaris->Core.pv;
401 pgcnt_t cPages = (cb + PAGE_SIZE - 1) >> PAGE_SHIFT;
402
403 /* Create the mapping object */
404 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)rtR0MemObjNew(sizeof(*pMemSolaris), RTR0MEMOBJTYPE_MAPPING, pv, cb);
405 if (RT_UNLIKELY(!pMemSolaris))
406 return VERR_NO_MEMORY;
407
408 uint64_t *paPhysAddrs = kmem_zalloc(sizeof(uint64_t) * cPages, KM_SLEEP);
409 if (RT_UNLIKELY(!paPhysAddrs))
410 return VERR_NO_MEMORY;
411
412 if ( pMemToMapSolaris->Core.enmType == RTR0MEMOBJTYPE_PHYS_NC
413 && pMemSolaris->Core.u.Phys.fAllocated == false)
414 {
415 /*
416 * The PhysNC object has no kernel mapping backing it. The call to vbi_pages_premap()
417 * prepares the physical pages to be mapped into user or kernel space.
418 */
419 int rc = vbi_pages_premap(pMemToMapSolaris->pvHandle, cb, paPhysAddrs);
420 if (rc)
421 {
422 LogRel(("rtR0MemObjNativeMapUser: vbi_pages_premap failed. rc=%d\n", rc));
423 kmem_free(paPhysAddrs, sizeof(uint64_t) * cPages);
424 rtR0MemObjDelete(&pMemSolaris->Core);
425 return VERR_MAP_FAILED;
426 }
427 }
428 else
429 {
430 /*
431 * All other memory object types have allocated memory with kernel mappings.
432 */
433 for (pgcnt_t iPage = 0; iPage < cPages; iPage++)
434 {
435 paPhysAddrs[iPage] = vbi_va_to_pa(pv);
436 if (RT_UNLIKELY(paPhysAddrs[iPage] == -(uint64_t)1))
437 {
438 LogRel(("rtR0MemObjNativeMapUser: no page to map.\n"));
439 kmem_free(paPhysAddrs, sizeof(uint64_t) * cPages);
440 rtR0MemObjDelete(&pMemSolaris->Core);
441 return VERR_MAP_FAILED;
442 }
443 pv = (void *)((uintptr_t)pv + PAGE_SIZE);
444 }
445 }
446
447 caddr_t virtAddr = NULL;
448 int rc = vbi_user_map(&virtAddr, fProt, paPhysAddrs, cb);
449 if (rc != 0)
450 {
451 LogRel(("rtR0MemObjNativeMapUser: vbi mapping failure.\n"));
452 kmem_free(paPhysAddrs, sizeof(uint64_t) * cPages);
453 rtR0MemObjDelete(&pMemSolaris->Core);
454 return VERR_MAP_FAILED;
455 }
456 else
457 rc = VINF_SUCCESS;
458
459 pMemSolaris->Core.u.Mapping.R0Process = (RTR0PROCESS)vbi_proc();
460 pMemSolaris->Core.pv = virtAddr;
461 *ppMem = &pMemSolaris->Core;
462 kmem_free(paPhysAddrs, sizeof(uint64_t) * cPages);
463 return rc;
464}
465
466
467int rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t offSub, size_t cbSub, uint32_t fProt)
468{
469 NOREF(pMem);
470 NOREF(offSub);
471 NOREF(cbSub);
472 NOREF(fProt);
473 return VERR_NOT_SUPPORTED;
474}
475
476
477RTHCPHYS rtR0MemObjNativeGetPagePhysAddr(PRTR0MEMOBJINTERNAL pMem, size_t iPage)
478{
479 PRTR0MEMOBJSOLARIS pMemSolaris = (PRTR0MEMOBJSOLARIS)pMem;
480
481 switch (pMemSolaris->Core.enmType)
482 {
483 case RTR0MEMOBJTYPE_PAGE:
484 case RTR0MEMOBJTYPE_LOW:
485 case RTR0MEMOBJTYPE_LOCK:
486 {
487 uint8_t *pb = (uint8_t *)pMemSolaris->Core.pv + ((size_t)iPage << PAGE_SHIFT);
488 return vbi_va_to_pa(pb);
489 }
490
491 /*
492 * Although mapping can be handled by vbi_va_to_pa(offset) like the above case,
493 * request it from the parent so that we have a clear distinction between CONT/PHYS_NC.
494 */
495 case RTR0MEMOBJTYPE_MAPPING:
496 return rtR0MemObjNativeGetPagePhysAddr(pMemSolaris->Core.uRel.Child.pParent, iPage);
497
498 case RTR0MEMOBJTYPE_CONT:
499 case RTR0MEMOBJTYPE_PHYS:
500 return pMemSolaris->Core.u.Cont.Phys + (iPage << PAGE_SHIFT);
501
502 case RTR0MEMOBJTYPE_PHYS_NC:
503 if (pMemSolaris->Core.u.Phys.fAllocated == true)
504 {
505 uint8_t *pb = (uint8_t *)pMemSolaris->Core.pv + ((size_t)iPage << PAGE_SHIFT);
506 return vbi_va_to_pa(pb);
507 }
508 return vbi_page_to_pa(pMemSolaris->pvHandle, iPage);
509
510 case RTR0MEMOBJTYPE_RES_VIRT:
511 default:
512 return NIL_RTHCPHYS;
513 }
514}
515
Note: See TracBrowser for help on using the repository browser.

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