Lines 1-7
Link Here
|
1 |
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2017-04-28 15:04:48 UTC |
1 |
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig 2017-04-28 15:04:48 UTC |
2 |
+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c |
2 |
+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c |
3 |
@@ -121,16 +121,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR |
3 |
@@ -105,6 +105,7 @@ static vm_map_t rtR0MemObjFreeBSDGetMap( |
4 |
|
4 |
|
|
|
5 |
DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem) |
6 |
{ |
7 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
8 |
PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)pMem; |
9 |
int rc; |
10 |
|
11 |
@@ -121,16 +122,15 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR |
12 |
|
5 |
case RTR0MEMOBJTYPE_LOCK: |
13 |
case RTR0MEMOBJTYPE_LOCK: |
6 |
{ |
14 |
{ |
7 |
- vm_map_t pMap = kernel_map; |
15 |
- vm_map_t pMap = kernel_map; |
Lines 22-28
Link Here
|
22 |
break; |
30 |
break; |
23 |
} |
31 |
} |
24 |
|
32 |
|
25 |
@@ -224,18 +223,23 @@ static vm_page_t rtR0MemObjFreeBSDContig |
33 |
@@ -194,6 +194,7 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR |
|
|
34 |
return VERR_INTERNAL_ERROR; |
35 |
} |
36 |
|
37 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
38 |
return VINF_SUCCESS; |
39 |
} |
40 |
|
41 |
@@ -224,18 +225,23 @@ static vm_page_t rtR0MemObjFreeBSDContig |
26 |
#else |
42 |
#else |
27 |
VM_OBJECT_UNLOCK(pObject); |
43 |
VM_OBJECT_UNLOCK(pObject); |
28 |
#endif |
44 |
#endif |
Lines 51-57
Link Here
|
51 |
break; |
67 |
break; |
52 |
vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); |
68 |
vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh); |
53 |
cTries++; |
69 |
cTries++; |
54 |
@@ -243,11 +247,8 @@ static vm_page_t rtR0MemObjFreeBSDContig |
70 |
@@ -243,11 +249,8 @@ static vm_page_t rtR0MemObjFreeBSDContig |
55 |
|
71 |
|
56 |
if (!pPages) |
72 |
if (!pPages) |
57 |
return pPages; |
73 |
return pPages; |
Lines 64-70
Link Here
|
64 |
for (vm_pindex_t iPage = 0; iPage < cPages; iPage++) |
80 |
for (vm_pindex_t iPage = 0; iPage < cPages; iPage++) |
65 |
{ |
81 |
{ |
66 |
vm_page_t pPage = pPages + iPage; |
82 |
vm_page_t pPage = pPages + iPage; |
67 |
@@ -259,13 +260,9 @@ static vm_page_t rtR0MemObjFreeBSDContig |
83 |
@@ -259,13 +262,9 @@ static vm_page_t rtR0MemObjFreeBSDContig |
68 |
atomic_add_int(&cnt.v_wire_count, 1); |
84 |
atomic_add_int(&cnt.v_wire_count, 1); |
69 |
} |
85 |
} |
70 |
} |
86 |
} |
Lines 78-84
Link Here
|
78 |
} |
94 |
} |
79 |
|
95 |
|
80 |
static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages, |
96 |
static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages, |
81 |
@@ -292,16 +289,17 @@ static int rtR0MemObjFreeBSDPhysAllocHel |
97 |
@@ -292,16 +291,17 @@ static int rtR0MemObjFreeBSDPhysAllocHel |
82 |
#else |
98 |
#else |
83 |
VM_OBJECT_LOCK(pObject); |
99 |
VM_OBJECT_LOCK(pObject); |
84 |
#endif |
100 |
#endif |
Lines 98-107
Link Here
|
98 |
vm_page_unlock_queues(); |
114 |
vm_page_unlock_queues(); |
99 |
#endif |
115 |
#endif |
100 |
} |
116 |
} |
101 |
@@ -519,14 +517,19 @@ static int rtR0MemObjNativeLockInMap(PPR |
117 |
@@ -364,58 +364,77 @@ static int rtR0MemObjFreeBSDAllocHelper( |
|
|
118 |
} |
119 |
DECLHIDDEN(int) rtR0MemObjNativeAllocPage(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) |
120 |
{ |
121 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
122 |
PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), |
123 |
RTR0MEMOBJTYPE_PAGE, NULL, cb); |
102 |
if (!pMemFreeBSD) |
124 |
if (!pMemFreeBSD) |
|
|
125 |
+ { |
126 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
103 |
return VERR_NO_MEMORY; |
127 |
return VERR_NO_MEMORY; |
|
|
128 |
+ } |
104 |
|
129 |
|
|
|
130 |
int rc = rtR0MemObjFreeBSDAllocHelper(pMemFreeBSD, fExecutable, ~(vm_paddr_t)0, false, VERR_NO_MEMORY); |
131 |
if (RT_FAILURE(rc)) |
132 |
{ |
133 |
rtR0MemObjDelete(&pMemFreeBSD->Core); |
134 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
135 |
return rc; |
136 |
} |
137 |
|
138 |
*ppMem = &pMemFreeBSD->Core; |
139 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
140 |
return rc; |
141 |
} |
142 |
|
143 |
|
144 |
DECLHIDDEN(int) rtR0MemObjNativeAllocLow(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) |
145 |
{ |
146 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
147 |
PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), |
148 |
RTR0MEMOBJTYPE_LOW, NULL, cb); |
149 |
if (!pMemFreeBSD) |
150 |
+ { |
151 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
152 |
return VERR_NO_MEMORY; |
153 |
+ } |
154 |
|
155 |
int rc = rtR0MemObjFreeBSDAllocHelper(pMemFreeBSD, fExecutable, _4G - 1, false, VERR_NO_LOW_MEMORY); |
156 |
if (RT_FAILURE(rc)) |
157 |
{ |
158 |
rtR0MemObjDelete(&pMemFreeBSD->Core); |
159 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
160 |
return rc; |
161 |
} |
162 |
|
163 |
*ppMem = &pMemFreeBSD->Core; |
164 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
165 |
return rc; |
166 |
} |
167 |
|
168 |
|
169 |
DECLHIDDEN(int) rtR0MemObjNativeAllocCont(PPRTR0MEMOBJINTERNAL ppMem, size_t cb, bool fExecutable) |
170 |
{ |
171 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
172 |
+ |
173 |
PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), |
174 |
RTR0MEMOBJTYPE_CONT, NULL, cb); |
175 |
if (!pMemFreeBSD) |
176 |
+ { |
177 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
178 |
return VERR_NO_MEMORY; |
179 |
+ } |
180 |
|
181 |
int rc = rtR0MemObjFreeBSDAllocHelper(pMemFreeBSD, fExecutable, _4G - 1, true, VERR_NO_CONT_MEMORY); |
182 |
if (RT_FAILURE(rc)) |
183 |
{ |
184 |
rtR0MemObjDelete(&pMemFreeBSD->Core); |
185 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
186 |
return rc; |
187 |
} |
188 |
|
189 |
pMemFreeBSD->Core.u.Cont.Phys = vtophys(pMemFreeBSD->Core.pv); |
190 |
*ppMem = &pMemFreeBSD->Core; |
191 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
192 |
return rc; |
193 |
} |
194 |
|
195 |
@@ -425,6 +444,7 @@ static int rtR0MemObjFreeBSDAllocPhysPag |
196 |
RTHCPHYS PhysHighest, size_t uAlignment, |
197 |
bool fContiguous, int rcNoMem) |
198 |
{ |
199 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
200 |
uint32_t cPages = atop(cb); |
201 |
vm_paddr_t VmPhysAddrHigh; |
202 |
|
203 |
@@ -432,7 +452,10 @@ static int rtR0MemObjFreeBSDAllocPhysPag |
204 |
PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), |
205 |
enmType, NULL, cb); |
206 |
if (!pMemFreeBSD) |
207 |
+ { |
208 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
209 |
return VERR_NO_MEMORY; |
210 |
+ } |
211 |
|
212 |
pMemFreeBSD->pObject = vm_object_allocate(OBJT_PHYS, atop(cb)); |
213 |
|
214 |
@@ -470,6 +493,7 @@ static int rtR0MemObjFreeBSDAllocPhysPag |
215 |
rtR0MemObjDelete(&pMemFreeBSD->Core); |
216 |
} |
217 |
|
218 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
219 |
return rc; |
220 |
} |
221 |
|
222 |
@@ -489,17 +513,22 @@ DECLHIDDEN(int) rtR0MemObjNativeAllocPhy |
223 |
DECLHIDDEN(int) rtR0MemObjNativeEnterPhys(PPRTR0MEMOBJINTERNAL ppMem, RTHCPHYS Phys, size_t cb, uint32_t uCachePolicy) |
224 |
{ |
225 |
AssertReturn(uCachePolicy == RTMEM_CACHE_POLICY_DONT_CARE, VERR_NOT_SUPPORTED); |
226 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
227 |
|
228 |
/* create the object. */ |
229 |
PRTR0MEMOBJFREEBSD pMemFreeBSD = (PRTR0MEMOBJFREEBSD)rtR0MemObjNew(sizeof(*pMemFreeBSD), RTR0MEMOBJTYPE_PHYS, NULL, cb); |
230 |
if (!pMemFreeBSD) |
231 |
+ { |
232 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
233 |
return VERR_NO_MEMORY; |
234 |
+ } |
235 |
|
236 |
/* there is no allocation here, it needs to be mapped somewhere first. */ |
237 |
pMemFreeBSD->Core.u.Phys.fAllocated = false; |
238 |
pMemFreeBSD->Core.u.Phys.PhysBase = Phys; |
239 |
pMemFreeBSD->Core.u.Phys.uCachePolicy = uCachePolicy; |
240 |
*ppMem = &pMemFreeBSD->Core; |
241 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
242 |
return VINF_SUCCESS; |
243 |
} |
244 |
|
245 |
@@ -511,6 +540,7 @@ static int rtR0MemObjNativeLockInMap(PPR |
246 |
vm_offset_t AddrStart, size_t cb, uint32_t fAccess, |
247 |
RTR0PROCESS R0Process, int fFlags) |
248 |
{ |
249 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
250 |
int rc; |
251 |
NOREF(fAccess); |
252 |
|
253 |
@@ -519,21 +549,28 @@ static int rtR0MemObjNativeLockInMap(PPR |
254 |
if (!pMemFreeBSD) |
255 |
return VERR_NO_MEMORY; |
256 |
|
105 |
- /* |
257 |
- /* |
106 |
- * We could've used vslock here, but we don't wish to be subject to |
258 |
- * We could've used vslock here, but we don't wish to be subject to |
107 |
- * resource usage restrictions, so we'll call vm_map_wire directly. |
259 |
- * resource usage restrictions, so we'll call vm_map_wire directly. |
Lines 126-132
Link Here
|
126 |
if (rc == KERN_SUCCESS) |
278 |
if (rc == KERN_SUCCESS) |
127 |
{ |
279 |
{ |
128 |
pMemFreeBSD->Core.u.Lock.R0Process = R0Process; |
280 |
pMemFreeBSD->Core.u.Lock.R0Process = R0Process; |
129 |
@@ -751,7 +754,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser( |
281 |
*ppMem = &pMemFreeBSD->Core; |
|
|
282 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
283 |
return VINF_SUCCESS; |
284 |
} |
285 |
rtR0MemObjDelete(&pMemFreeBSD->Core); |
286 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
287 |
return VERR_NO_MEMORY;/** @todo fix mach -> vbox error conversion for freebsd. */ |
288 |
} |
289 |
|
290 |
@@ -569,6 +606,7 @@ DECLHIDDEN(int) rtR0MemObjNativeLockKern |
291 |
*/ |
292 |
static int rtR0MemObjNativeReserveInMap(PPRTR0MEMOBJINTERNAL ppMem, void *pvFixed, size_t cb, size_t uAlignment, RTR0PROCESS R0Process, vm_map_t pMap) |
293 |
{ |
294 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
295 |
int rc; |
296 |
|
297 |
/* |
298 |
@@ -626,11 +664,13 @@ static int rtR0MemObjNativeReserveInMap( |
299 |
pMemFreeBSD->Core.pv = (void *)MapAddress; |
300 |
pMemFreeBSD->Core.u.ResVirt.R0Process = R0Process; |
301 |
*ppMem = &pMemFreeBSD->Core; |
302 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
303 |
return VINF_SUCCESS; |
304 |
} |
305 |
|
306 |
rc = VERR_NO_MEMORY; /** @todo fix translation (borrow from darwin) */ |
307 |
rtR0MemObjDelete(&pMemFreeBSD->Core); |
308 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
309 |
return rc; |
310 |
|
311 |
} |
312 |
@@ -652,6 +692,8 @@ DECLHIDDEN(int) rtR0MemObjNativeReserveU |
313 |
DECLHIDDEN(int) rtR0MemObjNativeMapKernel(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, void *pvFixed, size_t uAlignment, |
314 |
unsigned fProt, size_t offSub, size_t cbSub) |
315 |
{ |
316 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
317 |
+ |
318 |
// AssertMsgReturn(!offSub && !cbSub, ("%#x %#x\n", offSub, cbSub), VERR_NOT_SUPPORTED); |
319 |
AssertMsgReturn(pvFixed == (void *)-1, ("%p\n", pvFixed), VERR_NOT_SUPPORTED); |
320 |
|
321 |
@@ -707,6 +749,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKerne |
322 |
Assert((vm_offset_t)pMemFreeBSD->Core.pv == Addr); |
323 |
pMemFreeBSD->Core.u.Mapping.R0Process = NIL_RTR0PROCESS; |
324 |
*ppMem = &pMemFreeBSD->Core; |
325 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
326 |
return VINF_SUCCESS; |
327 |
} |
328 |
rc = vm_map_remove(kernel_map, Addr, Addr + cbSub); |
329 |
@@ -715,6 +758,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKerne |
330 |
else |
331 |
vm_object_deallocate(pMemToMapFreeBSD->pObject); |
332 |
|
333 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
334 |
return VERR_NO_MEMORY; |
335 |
} |
336 |
|
337 |
@@ -722,6 +766,8 @@ DECLHIDDEN(int) rtR0MemObjNativeMapKerne |
338 |
DECLHIDDEN(int) rtR0MemObjNativeMapUser(PPRTR0MEMOBJINTERNAL ppMem, RTR0MEMOBJ pMemToMap, RTR3PTR R3PtrFixed, size_t uAlignment, |
339 |
unsigned fProt, RTR0PROCESS R0Process) |
340 |
{ |
341 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
342 |
+ |
343 |
/* |
344 |
* Check for unsupported stuff. |
345 |
*/ |
346 |
@@ -751,7 +797,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser( |
130 |
{ |
347 |
{ |
131 |
/** @todo is this needed?. */ |
348 |
/** @todo is this needed?. */ |
132 |
PROC_LOCK(pProc); |
349 |
PROC_LOCK(pProc); |
Lines 140-147
Link Here
|
140 |
PROC_UNLOCK(pProc); |
357 |
PROC_UNLOCK(pProc); |
141 |
} |
358 |
} |
142 |
else |
359 |
else |
143 |
@@ -850,11 +858,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGet |
360 |
@@ -793,6 +844,7 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser( |
|
|
361 |
Assert((vm_offset_t)pMemFreeBSD->Core.pv == AddrR3); |
362 |
pMemFreeBSD->Core.u.Mapping.R0Process = R0Process; |
363 |
*ppMem = &pMemFreeBSD->Core; |
364 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
365 |
return VINF_SUCCESS; |
366 |
} |
144 |
|
367 |
|
|
|
368 |
@@ -802,19 +854,25 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser( |
369 |
else |
370 |
vm_object_deallocate(pMemToMapFreeBSD->pObject); |
371 |
|
372 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
373 |
return VERR_NO_MEMORY; |
374 |
} |
375 |
|
376 |
|
377 |
DECLHIDDEN(int) rtR0MemObjNativeProtect(PRTR0MEMOBJINTERNAL pMem, size_t offSub, size_t cbSub, uint32_t fProt) |
378 |
{ |
379 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
380 |
+ |
381 |
vm_prot_t ProtectionFlags = 0; |
382 |
vm_offset_t AddrStart = (uintptr_t)pMem->pv + offSub; |
383 |
vm_offset_t AddrEnd = AddrStart + cbSub; |
384 |
vm_map_t pVmMap = rtR0MemObjFreeBSDGetMap(pMem); |
385 |
|
386 |
if (!pVmMap) |
387 |
+ { |
388 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
389 |
return VERR_NOT_SUPPORTED; |
390 |
+ } |
391 |
|
392 |
if ((fProt & RTMEM_PROT_NONE) == RTMEM_PROT_NONE) |
393 |
ProtectionFlags = VM_PROT_NONE; |
394 |
@@ -826,6 +884,7 @@ DECLHIDDEN(int) rtR0MemObjNativeProtect( |
395 |
ProtectionFlags |= VM_PROT_EXECUTE; |
396 |
|
397 |
int krc = vm_map_protect(pVmMap, AddrStart, AddrEnd, ProtectionFlags, FALSE); |
398 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
399 |
if (krc == KERN_SUCCESS) |
400 |
return VINF_SUCCESS; |
401 |
|
402 |
@@ -850,11 +909,19 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGet |
403 |
|
145 |
vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage); |
404 |
vm_offset_t pb = (vm_offset_t)pMemFreeBSD->Core.pv + ptoa(iPage); |
146 |
|
405 |
|
147 |
- struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Lock.R0Process; |
406 |
- struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Lock.R0Process; |
Lines 149-162
Link Here
|
149 |
- pmap_t pPhysicalMap = vm_map_pmap(pProcMap); |
408 |
- pmap_t pPhysicalMap = vm_map_pmap(pProcMap); |
150 |
+ if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) |
409 |
+ if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) |
151 |
+ { |
410 |
+ { |
|
|
411 |
+ RTHCPHYS addr; |
412 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
152 |
+ struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Lock.R0Process; |
413 |
+ struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Lock.R0Process; |
153 |
+ struct vm_map *pProcMap = &pProc->p_vmspace->vm_map; |
414 |
+ struct vm_map *pProcMap = &pProc->p_vmspace->vm_map; |
154 |
+ pmap_t pPhysicalMap = vm_map_pmap(pProcMap); |
415 |
+ pmap_t pPhysicalMap = vm_map_pmap(pProcMap); |
155 |
|
416 |
|
156 |
- return pmap_extract(pPhysicalMap, pb); |
417 |
- return pmap_extract(pPhysicalMap, pb); |
157 |
+ return pmap_extract(pPhysicalMap, pb); |
418 |
+ addr = pmap_extract(pPhysicalMap, pb); |
|
|
419 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
420 |
+ return addr; |
158 |
+ } |
421 |
+ } |
159 |
+ return vtophys(pb); |
422 |
+ return vtophys(pb); |
160 |
} |
423 |
} |
161 |
|
424 |
|
162 |
case RTR0MEMOBJTYPE_MAPPING: |
425 |
case RTR0MEMOBJTYPE_MAPPING: |
|
|
426 |
@@ -863,11 +930,15 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGet |
427 |
|
428 |
if (pMemFreeBSD->Core.u.Mapping.R0Process != NIL_RTR0PROCESS) |
429 |
{ |
430 |
+ RTHCPHYS addr; |
431 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
432 |
struct proc *pProc = (struct proc *)pMemFreeBSD->Core.u.Mapping.R0Process; |
433 |
struct vm_map *pProcMap = &pProc->p_vmspace->vm_map; |
434 |
pmap_t pPhysicalMap = vm_map_pmap(pProcMap); |
435 |
|
436 |
- return pmap_extract(pPhysicalMap, pb); |
437 |
+ addr = pmap_extract(pPhysicalMap, pb); |
438 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
439 |
+ return addr; |
440 |
} |
441 |
return vtophys(pb); |
442 |
} |
443 |
@@ -877,6 +948,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGet |
444 |
case RTR0MEMOBJTYPE_PHYS_NC: |
445 |
{ |
446 |
RTHCPHYS addr; |
447 |
+ IPRT_FREEBSD_SAVE_EFL_AC(); |
448 |
#if __FreeBSD_version >= 1000030 |
449 |
VM_OBJECT_WLOCK(pMemFreeBSD->pObject); |
450 |
#else |
451 |
@@ -888,6 +960,7 @@ DECLHIDDEN(RTHCPHYS) rtR0MemObjNativeGet |
452 |
#else |
453 |
VM_OBJECT_UNLOCK(pMemFreeBSD->pObject); |
454 |
#endif |
455 |
+ IPRT_FREEBSD_RESTORE_EFL_AC(); |
456 |
return addr; |
457 |
} |
458 |
|