- Timestamp:
- Dec 29, 2022 5:59:30 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/memobj-r0drv-solaris.c
r96407 r97901 76 76 /** Access during locking. */ 77 77 int fAccess; 78 /** Set if large pages are involved in an RTR0MEMOBJTYPE_PHYS 79 * allocation. */ 78 /** Set if large pages are involved in an RTR0MEMOBJTYPE_PHYS allocation. */ 80 79 bool fLargePage; 81 /** Whether we have individual pages or a kernel-mapped virtual memory block in82 * an RTR0MEMOBJTYPE_PHYS_NC allocation. */80 /** Whether we have individual pages or a kernel-mapped virtual memory 81 * block in an RTR0MEMOBJTYPE_PHYS_NC allocation. */ 83 82 bool fIndivPages; 83 /** Set if executable allocation - only RTR0MEMOBJTYPE_PHYS. */ 84 bool fExecutable; 84 85 } RTR0MEMOBJSOL, *PRTR0MEMOBJSOL; 85 86 … … 630 631 631 632 case RTR0MEMOBJTYPE_PAGE: 632 ddi_umem_free(pMemSolaris->Cookie); 633 if (!pMemSolaris->fExecutable) 634 ddi_umem_free(pMemSolaris->Cookie); 635 else 636 segkmem_free(heaptext_arena, pMemSolaris->Core.pv, pMemSolaris->Core.cb); 633 637 break; 634 638 … … 642 646 643 647 case RTR0MEMOBJTYPE_RES_VIRT: 644 {645 648 if (pMemSolaris->Core.u.ResVirt.R0Process == NIL_RTR0PROCESS) 646 649 vmem_xfree(heap_arena, pMemSolaris->Core.pv, pMemSolaris->Core.cb); … … 648 651 AssertFailed(); 649 652 break; 650 }651 653 652 654 case RTR0MEMOBJTYPE_CONT: /* we don't use this type here. */ … … 666 668 if (pMemSolaris) 667 669 { 668 void *pvMem = ddi_umem_alloc(cb, DDI_UMEM_SLEEP, &pMemSolaris->Cookie); 670 void *pvMem; 671 if (!fExecutable) 672 { 673 pMemSolaris->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC; 674 pvMem = ddi_umem_alloc(cb, DDI_UMEM_SLEEP, &pMemSolaris->Cookie); 675 } 676 else 677 { 678 pMemSolaris->Core.fFlags |= RTR0MEMOBJ_FLAGS_UNINITIALIZED_AT_ALLOC; /** @todo does segkmem_alloc zero the memory? */ 679 pvMem = segkmem_alloc(heaptext_arena, cb, KM_SLEEP); 680 } 669 681 if (pvMem) 670 682 { 671 pMemSolaris->Core.fFlags |= RTR0MEMOBJ_FLAGS_ZERO_AT_ALLOC;672 683 pMemSolaris->Core.pv = pvMem; 673 684 pMemSolaris->pvHandle = NULL; 685 pMemSolaris->fExecutable = fExecutable; 674 686 *ppMem = &pMemSolaris->Core; 675 687 return VINF_SUCCESS; … … 691 703 DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, const char *pszTag) 692 704 { 693 NOREF(fExecutable);705 AssertReturn(!fExecutable, VERR_NOT_SUPPORTED); 694 706 695 707 /* Create the object */ … … 717 729 DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable, const char *pszTag) 718 730 { 719 NOREF(fExecutable);731 AssertReturn(!fExecutable, VERR_NOT_SUPPORTED); 720 732 return rtR0MemObjNativeAllocPhys(ppMem, cb, _4G - 1, PAGE_SIZE /* alignment */, pszTag); 721 733 }
Note:
See TracChangeset
for help on using the changeset viewer.