Changeset 50008 in vbox
- Timestamp:
- Dec 27, 2013 2:20:34 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 91454
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPDrv.c
r49965 r50008 4461 4461 supdrvLdrUnsetVMMR0EPs(pDevExt); 4462 4462 } 4463 SUPR0Printf("vboxdrv: %p %s\n", pImage->pvImage, pImage->szName); 4463 4464 4464 4465 if (RT_FAILURE(rc)) -
trunk/src/VBox/HostDrivers/Support/linux/Makefile
r49395 r50008 276 276 #KFLAGS += -DIPRT_DEBUG_SEMS 277 277 endif 278 ifdef VBOX_WITH_TEXT_MODMEM_HACK 279 KFLAGS += -DRTMEMALLOC_EXEC_HEAP -DVBOX_WITH_TEXT_MODMEM_HACK 280 endif 278 281 279 282 # 2.6 and later -
trunk/src/VBox/HostDrivers/Support/linux/SUPDrv-linux.c
r49767 r50008 153 153 #define DEVICE_NAME_USR "vboxdrvu" 154 154 155 #if defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)155 #if (defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK) 156 156 /** 157 157 * Memory for the executable memory heap (in IPRT). 158 158 */ 159 extern uint8_t g_abExecMemory[1572864]; /* 1.5 MB */ 159 # ifdef DEBUG 160 # define EXEC_MEMORY_SIZE 6291456 /* 6 MB */ 161 # else 162 # define EXEC_MEMORY_SIZE 1572864 /* 1.5 MB */ 163 # endif 164 extern uint8_t g_abExecMemory[EXEC_MEMORY_SIZE]; 165 # ifndef VBOX_WITH_TEXT_MODMEM_HACK 160 166 __asm__(".section execmemory, \"awx\", @progbits\n\t" 161 167 ".align 32\n\t" 162 168 ".globl g_abExecMemory\n" 163 169 "g_abExecMemory:\n\t" 164 ".zero 1572864\n\t"170 ".zero " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t" 165 171 ".type g_abExecMemory, @object\n\t" 166 ".size g_abExecMemory, 1572864\n\t"172 ".size g_abExecMemory, " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t" 167 173 ".text\n\t"); 174 # else 175 __asm__(".text\n\t" 176 ".align 4096\n\t" 177 ".globl g_abExecMemory\n" 178 "g_abExecMemory:\n\t" 179 ".zero " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t" 180 ".type g_abExecMemory, @object\n\t" 181 ".size g_abExecMemory, " RT_XSTR(EXEC_MEMORY_SIZE) "\n\t" 182 ".text\n\t"); 183 # endif 168 184 #endif 169 185 … … 377 393 if (RT_SUCCESS(rc)) 378 394 { 379 #if defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) 395 #if (defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)) || defined(VBOX_WITH_TEXT_MODMEM_HACK) 396 # ifdef VBOX_WITH_TEXT_MODMEM_HACK 397 set_memory_x(&g_abExecMemory[0], sizeof(g_abExecMemory) / PAGE_SIZE); 398 set_memory_rw(&g_abExecMemory[0], sizeof(g_abExecMemory) / PAGE_SIZE); 399 # endif 380 400 rc = RTR0MemExecDonate(&g_abExecMemory[0], sizeof(g_abExecMemory)); 381 401 printk(KERN_DEBUG "VBoxDrv: dbg - g_abExecMemory=%p\n", (void *)&g_abExecMemory[0]); -
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r48935 r50008 38 38 39 39 40 #if defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)40 #if (defined(RT_ARCH_AMD64) || defined(DOXYGEN_RUNNING)) && !defined(RTMEMALLOC_EXEC_HEAP) 41 41 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) 42 42 /** … … 96 96 /** Spinlock protecting the heap. */ 97 97 static RTSPINLOCK g_HeapExecSpinlock = NIL_RTSPINLOCK; 98 #endif 98 99 99 100 … … 104 105 DECLHIDDEN(void) rtR0MemExecCleanup(void) 105 106 { 107 #ifdef RTMEMALLOC_EXEC_HEAP 106 108 RTSpinlockDestroy(g_HeapExecSpinlock); 107 109 g_HeapExecSpinlock = NIL_RTSPINLOCK; 110 #endif 108 111 } 109 112 … … 121 124 * 122 125 * @returns IPRT status code. 126 * @retval VERR_NOT_SUPPORTED if the code isn't enabled. 123 127 * @param pvMemory Pointer to the memory block. 124 128 * @param cb The size of the memory block. … … 126 130 RTR0DECL(int) RTR0MemExecDonate(void *pvMemory, size_t cb) 127 131 { 132 #ifdef RTMEMALLOC_EXEC_HEAP 128 133 int rc; 129 134 AssertReturn(g_HeapExec == NIL_RTHEAPSIMPLE, VERR_WRONG_ORDER); … … 137 142 } 138 143 return rc; 144 #else 145 return VERR_NOT_SUPPORTED; 146 #endif 139 147 } 140 148 RT_EXPORT_SYMBOL(RTR0MemExecDonate); 141 149 142 #endif /* RTMEMALLOC_EXEC_HEAP */143 150 144 151 -
trunk/src/VBox/Runtime/r0drv/linux/initterm-r0drv-linux.c
r48935 r50008 50 50 * Internal Functions * 51 51 *******************************************************************************/ 52 #if defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)53 52 /* in alloc-r0drv0-linux.c */ 54 53 DECLHIDDEN(void) rtR0MemExecCleanup(void); 55 #endif56 54 57 55 … … 115 113 #endif 116 114 117 #if defined(RT_ARCH_AMD64) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23)118 115 rtR0MemExecCleanup(); 119 #endif120 116 } 121 117
Note:
See TracChangeset
for help on using the changeset viewer.