Changeset 100321 in vbox
- Timestamp:
- Jun 28, 2023 10:55:34 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/linux/alloc-r0drv-linux.c
r98103 r100321 155 155 int cOrder; 156 156 unsigned cPages; 157 void *pvRet; 158 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 157 159 struct page *paPages; 158 void *pvRet; 160 #endif 159 161 IPRT_LINUX_SAVE_EFL_AC(); 160 162 … … 171 173 cPages = cb >> PAGE_SHIFT; 172 174 cOrder = CalcPowerOf2Order(cPages); 173 #if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) 175 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 176 # if (defined(RT_ARCH_AMD64) || defined(CONFIG_X86_PAE)) && defined(GFP_DMA32) 174 177 /* ZONE_DMA32: 0-4GB */ 175 178 paPages = alloc_pages(GFP_DMA32 | __GFP_NOWARN, cOrder); 176 179 if (!paPages) 177 # endif178 # ifdef RT_ARCH_AMD64180 # endif 181 # ifdef RT_ARCH_AMD64 179 182 /* ZONE_DMA; 0-16MB */ 180 183 paPages = alloc_pages(GFP_DMA | __GFP_NOWARN, cOrder); 181 # else184 # else 182 185 /* ZONE_NORMAL: 0-896MB */ 183 186 paPages = alloc_pages(GFP_USER | __GFP_NOWARN, cOrder); 184 # endif187 # endif 185 188 if (paPages) 186 189 { … … 210 213 else 211 214 pvRet = NULL; 215 #else 216 pvRet = (void *)__get_free_pages(GFP_DMA32 | __GFP_NOWARN, cOrder); 217 if (pvRet) 218 *pPhys = virt_to_phys(pvRet); 219 #endif 212 220 213 221 IPRT_LINUX_RESTORE_EFL_AC(); … … 229 237 int cOrder; 230 238 unsigned cPages; 239 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 231 240 unsigned iPage; 232 241 struct page *paPages; 242 #endif 233 243 IPRT_LINUX_SAVE_EFL_AC(); 234 244 … … 241 251 cPages = cb >> PAGE_SHIFT; 242 252 cOrder = CalcPowerOf2Order(cPages); 253 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 243 254 paPages = virt_to_page(pv); 244 255 … … 251 262 } 252 263 __free_pages(paPages, cOrder); 264 #else 265 free_pages((uintptr_t)pv, cOrder); 266 #endif 253 267 IPRT_LINUX_RESTORE_EFL_AC(); 254 268 }
Note:
See TracChangeset
for help on using the changeset viewer.