Lines Matching refs:pMemOs2

74     PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)pMem;
77 switch (pMemOs2->Core.enmType)
85 if (!pMemOs2->Core.pv)
89 if (pMemOs2->Core.u.Mapping.R0Process == NIL_RTR0PROCESS)
96 rc = KernVMFree(pMemOs2->Core.pv);
97 AssertMsg(!rc, ("rc=%d type=%d pv=%p cb=%#zx\n", rc, pMemOs2->Core.enmType, pMemOs2->Core.pv, pMemOs2->Core.cb));
101 rc = KernVMUnlock(&pMemOs2->Lock);
107 AssertMsgFailed(("enmType=%d\n", pMemOs2->Core.enmType));
121 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, aPages[cPages]), RTR0MEMOBJTYPE_PAGE, NULL, cb);
122 if (!pMemOs2)
126 int rc = KernVMAlloc(cb, VMDHA_FIXED, &pMemOs2->Core.pv, (PPVOID)-1, NULL);
130 rc = KernLinToPageList(pMemOs2->Core.pv, cb, &pMemOs2->aPages[0], &cPagesRet);
133 rtR0MemObjFixPageList(&pMemOs2->aPages[0], cPages, cPagesRet);
134 *ppMem = &pMemOs2->Core;
137 KernVMFree(pMemOs2->Core.pv);
139 rtR0MemObjDelete(&pMemOs2->Core);
150 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, aPages[cPages]), RTR0MEMOBJTYPE_LOW, NULL, cb);
151 if (!pMemOs2)
155 int rc = KernVMAlloc(cb, VMDHA_FIXED, &pMemOs2->Core.pv, (PPVOID)-1, NULL);
159 rc = KernLinToPageList(pMemOs2->Core.pv, cb, &pMemOs2->aPages[0], &cPagesRet);
162 rtR0MemObjFixPageList(&pMemOs2->aPages[0], cPages, cPagesRet);
163 *ppMem = &pMemOs2->Core;
166 KernVMFree(pMemOs2->Core.pv);
168 rtR0MemObjDelete(&pMemOs2->Core);
179 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_CONT, NULL, cb);
180 if (!pMemOs2)
185 int rc = KernVMAlloc(cb, VMDHA_FIXED | VMDHA_CONTIG, &pMemOs2->Core.pv, (PPVOID)&ulPhys, NULL);
189 pMemOs2->Core.u.Cont.Phys = ulPhys;
190 *ppMem = &pMemOs2->Core;
193 rtR0MemObjDelete(&pMemOs2->Core);
207 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_PHYS, NULL, cb);
208 if (!pMemOs2)
213 int rc = KernVMAlloc(cb, VMDHA_FIXED | VMDHA_CONTIG | (PhysHighest < _4G ? VMDHA_16M : 0), &pMemOs2->Core.pv, (PPVOID)&ulPhys, NULL);
217 pMemOs2->Core.u.Phys.fAllocated = true;
218 pMemOs2->Core.u.Phys.PhysBase = ulPhys;
219 *ppMem = &pMemOs2->Core;
222 rtR0MemObjDelete(&pMemOs2->Core);
239 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_PHYS, NULL, cb);
240 if (!pMemOs2)
244 pMemOs2->Core.u.Phys.fAllocated = false;
245 pMemOs2->Core.u.Phys.PhysBase = Phys;
246 pMemOs2->Core.u.Phys.uCachePolicy = uCachePolicy;
247 *ppMem = &pMemOs2->Core;
259 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, aPages[cPages]), RTR0MEMOBJTYPE_LOCK, (void *)R3Ptr, cb);
260 if (!pMemOs2)
266 (void *)R3Ptr, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
269 rtR0MemObjFixPageList(&pMemOs2->aPages[0], cPages, cPagesRet);
270 Assert(cb == pMemOs2->Core.cb);
271 Assert(R3Ptr == (RTR3PTR)pMemOs2->Core.pv);
272 pMemOs2->Core.u.Lock.R0Process = R0Process;
273 *ppMem = &pMemOs2->Core;
276 rtR0MemObjDelete(&pMemOs2->Core);
285 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, aPages[cPages]), RTR0MEMOBJTYPE_LOCK, pv, cb);
286 if (!pMemOs2)
292 pv, cb, &pMemOs2->Lock, &pMemOs2->aPages[0], &cPagesRet);
295 rtR0MemObjFixPageList(&pMemOs2->aPages[0], cPages, cPagesRet);
296 pMemOs2->Core.u.Lock.R0Process = NIL_RTR0PROCESS;
297 *ppMem = &pMemOs2->Core;
300 rtR0MemObjDelete(&pMemOs2->Core);
388 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_MAPPING, pvR0, pMemToMapOs2->Core.cb);
389 if (pMemOs2)
391 pMemOs2->Core.u.Mapping.R0Process = NIL_RTR0PROCESS;
392 *ppMem = &pMemOs2->Core;
476 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)rtR0MemObjNew(RT_OFFSETOF(RTR0MEMOBJOS2, Lock), RTR0MEMOBJTYPE_MAPPING, pvR3, pMemToMapOs2->Core.cb);
477 if (pMemOs2)
479 Assert(pMemOs2->Core.pv == pvR3);
480 pMemOs2->Core.u.Mapping.R0Process = R0Process;
481 *ppMem = &pMemOs2->Core;
501 PRTR0MEMOBJOS2 pMemOs2 = (PRTR0MEMOBJOS2)pMem;
503 switch (pMemOs2->Core.enmType)
509 return pMemOs2->aPages[iPage].Addr;
512 return pMemOs2->Core.u.Cont.Phys + (iPage << PAGE_SHIFT);
515 return pMemOs2->Core.u.Phys.PhysBase + (iPage << PAGE_SHIFT);