VirtualBox

Ignore:
Timestamp:
Dec 29, 2022 6:22:23 PM (2 years ago)
Author:
vboxsync
Message:

IPRT,SUPDrv: Dropping RTR0MemExecDonate and associated SUPDrv-linux code, it's not needed since linux started using RTR0MemObjAllocPage for r0 images. bugref:9801

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c

    r97872 r97905  
    122122#endif
    123123}
    124 
    125 
    126 /**
    127  * Donate read+write+execute memory to the exec heap.
    128  *
    129  * This API is specific to AMD64 and Linux/GNU. A kernel module that desires to
    130  * use RTMemExecAlloc on AMD64 Linux/GNU will have to donate some statically
    131  * allocated memory in the module if it wishes for GCC generated code to work.
    132  * GCC can only generate modules that work in the address range ~2GB to ~0
    133  * currently.
    134  *
    135  * The API only accept one single donation.
    136  *
    137  * @returns IPRT status code.
    138  * @retval  VERR_NOT_SUPPORTED if the code isn't enabled.
    139  * @param   pvMemory    Pointer to the memory block.
    140  * @param   cb          The size of the memory block.
    141  */
    142 RTR0DECL(int) RTR0MemExecDonate(void *pvMemory, size_t cb)
    143 {
    144 #ifdef RTMEMALLOC_EXEC_HEAP
    145     int rc;
    146     AssertReturn(g_HeapExec == NIL_RTHEAPSIMPLE, VERR_WRONG_ORDER);
    147 
    148     rc = RTSpinlockCreate(&g_HeapExecSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_SAFE, "RTR0MemExecDonate");
    149     if (RT_SUCCESS(rc))
    150     {
    151         rc = RTHeapSimpleInit(&g_HeapExec, pvMemory, cb);
    152         if (RT_FAILURE(rc))
    153             rtR0MemExecCleanup();
    154     }
    155     return rc;
    156 #else
    157     RT_NOREF_PV(pvMemory); RT_NOREF_PV(cb);
    158     return VERR_NOT_SUPPORTED;
    159 #endif
    160 }
    161 RT_EXPORT_SYMBOL(RTR0MemExecDonate);
    162 
    163124
    164125
Note: See TracChangeset for help on using the changeset viewer.

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