Changeset 91481 in vbox for trunk/src/VBox/Runtime/r0drv/darwin
- Timestamp:
- Sep 30, 2021 12:06:31 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 147165
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r91480 r91481 98 98 RTR0MEMOBJTYPE enmType; 99 99 size_t uAlignment; 100 const char *pszTag; 100 101 } RTR0MEMOBJDARWINALLOCARGS; 101 102 … … 555 556 * @param enmType The object type. 556 557 * @param uAlignment The allocation alignment (in bytes). 558 * @param pszTag Allocation tag used for statistics and such. 557 559 * @param fOnKernelThread Set if we're already on the kernel thread. 558 560 */ … … 560 562 bool fExecutable, bool fContiguous, 561 563 mach_vm_address_t PhysMask, uint64_t MaxPhysAddr, 562 RTR0MEMOBJTYPE enmType, size_t uAlignment, bool fOnKernelThread)564 RTR0MEMOBJTYPE enmType, size_t uAlignment, const char *pszTag, bool fOnKernelThread) 563 565 { 564 566 int rc; … … 591 593 Args.enmType = enmType; 592 594 Args.uAlignment = uAlignment; 595 Args.pszTag = pszTag; 593 596 return rtR0MemObjDarwinDoInKernelTaskThread(rtR0MemObjNativeAllockWorkerOnKernelThread, &Args.Core); 594 597 } … … 738 741 * Create the IPRT memory object. 739 742 */ 740 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, NULL);743 PRTR0MEMOBJDARWIN pMemDarwin = (PRTR0MEMOBJDARWIN)rtR0MemObjNew(sizeof(*pMemDarwin), enmType, pv, cb, pszTag); 741 744 if (pMemDarwin) 742 745 { … … 821 824 RTR0MEMOBJDARWINALLOCARGS volatile *pArgs = (RTR0MEMOBJDARWINALLOCARGS volatile *)pvUser0; 822 825 int rc = rtR0MemObjNativeAllocWorker(pArgs->ppMem, pArgs->cb, pArgs->fExecutable, pArgs->fContiguous, pArgs->PhysMask, 823 pArgs->MaxPhysAddr, pArgs->enmType, pArgs->uAlignment, true /*fOnKernelThread*/); 826 pArgs->MaxPhysAddr, pArgs->enmType, pArgs->uAlignment, pArgs->pszTag, 827 true /*fOnKernelThread*/); 824 828 rtR0MemObjDarwinSignalThreadWaitinOnTask(&pArgs->Core, rc); 825 829 } … … 831 835 832 836 int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, 0 /* PhysMask */, UINT64_MAX, 833 RTR0MEMOBJTYPE_PAGE, PAGE_SIZE, false /*fOnKernelThread*/);837 RTR0MEMOBJTYPE_PAGE, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 834 838 835 839 IPRT_DARWIN_RESTORE_EFL_AC(); … … 857 861 */ 858 862 int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, ~(uint32_t)PAGE_OFFSET_MASK, 859 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, false /*fOnKernelThread*/);863 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 860 864 if (rc == VERR_ADDRESS_TOO_BIG) 861 865 rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, false /* fContiguous */, 0 /* PhysMask */, 862 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, false /*fOnKernelThread*/);866 _4G - PAGE_SIZE, RTR0MEMOBJTYPE_LOW, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 863 867 864 868 IPRT_DARWIN_RESTORE_EFL_AC(); … … 873 877 int rc = rtR0MemObjNativeAllocWorker(ppMem, cb, fExecutable, true /* fContiguous */, 874 878 ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE, 875 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/);879 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 876 880 877 881 /* … … 882 886 rc = rtR0MemObjNativeAllocWorker(ppMem, cb + PAGE_SIZE, fExecutable, true /* fContiguous */, 883 887 ~(uint32_t)PAGE_OFFSET_MASK, _4G - PAGE_SIZE, 884 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, false /*fOnKernelThread*/);888 RTR0MEMOBJTYPE_CONT, PAGE_SIZE, NULL, false /*fOnKernelThread*/); 885 889 IPRT_DARWIN_RESTORE_EFL_AC(); 886 890 return rc; … … 888 892 889 893 890 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment) 894 DECLHIDDEN(int) rtR0MemObjNativeAllocPhys(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, size_t uAlignment, 895 const char *pszTag) 891 896 { 892 897 if (uAlignment != PAGE_SIZE) … … 906 911 rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */, 907 912 uAlignment <= PAGE_SIZE ? 0 : ~(mach_vm_address_t)(uAlignment - 1) /* PhysMask*/, 908 UINT64_MAX, RTR0MEMOBJTYPE_PHYS, uAlignment, false /*fOnKernelThread*/);913 UINT64_MAX, RTR0MEMOBJTYPE_PHYS, uAlignment, NULL, false /*fOnKernelThread*/); 909 914 else 910 915 { … … 917 922 918 923 rc = rtR0MemObjNativeAllocWorker(ppMem, cb, false /* fExecutable */, true /* fContiguous */, 919 PhysMask, PhysHighest, RTR0MEMOBJTYPE_PHYS, uAlignment, false /*fOnKernelThread*/); 924 PhysMask, PhysHighest, 925 RTR0MEMOBJTYPE_PHYS, uAlignment, NULL, false /*fOnKernelThread*/); 920 926 } 921 927 … … 925 931 926 932 927 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest )933 DECLHIDDEN(int) rtR0MemObjNativeAllocPhysNC(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, RTHCPHYS PhysHighest, const char *pszTag) 928 934 { 929 935 /** @todo rtR0MemObjNativeAllocPhys / darwin. … … 932 938 * Estimate is 2-3 days. 933 939 */ 934 RT_NOREF(ppMem, cb, PhysHighest );940 RT_NOREF(ppMem, cb, PhysHighest, pszTag); 935 941 return VERR_NOT_SUPPORTED; 936 942 }
Note:
See TracChangeset
for help on using the changeset viewer.