Changeset 22052 in vbox for trunk/src/VBox/Runtime/r0drv/darwin
- Timestamp:
- Aug 7, 2009 9:45:48 AM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50790
- Location:
- trunk/src/VBox/Runtime/r0drv/darwin
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/darwin/RTLogWriteDebugger-r0drv-darwin.cpp
r8245 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 36 37 #include <iprt/log.h> 37 #include <iprt/assert.h>38 38 39 39 40 40 RTDECL(void) RTLogWriteDebugger(const char *pch, size_t cb) 41 41 { 42 kprintf("%.*s", cb, pch);42 kprintf("%.*s", (int)cb, pch); 43 43 return; 44 44 } -
trunk/src/VBox/Runtime/r0drv/darwin/RTLogWriteStdOut-r0drv-darwin.cpp
r10608 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 36 37 #include <iprt/log.h> 37 #include <iprt/assert.h>38 38 39 39 40 40 RTDECL(void) RTLogWriteStdOut(const char *pch, size_t cb) 41 41 { 42 printf("%.*s", cb, pch);42 printf("%.*s", (int)cb, pch); 43 43 return; 44 44 } -
trunk/src/VBox/Runtime/r0drv/darwin/alloc-r0drv-darwin.cpp
r8245 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 37 #include <iprt/mem.h> 36 38 37 #include <iprt/alloc.h>38 39 #include <iprt/assert.h> 40 #include <iprt/thread.h> 39 41 #include "r0drv/alloc-r0drv.h" 40 42 … … 54 56 } 55 57 else 56 printf("rmMemAlloc(%# x, %#x) failed\n", cb + sizeof(*pHdr), fFlags);58 printf("rmMemAlloc(%#zx, %#x) failed\n", cb + sizeof(*pHdr), fFlags); 57 59 return pHdr; 58 60 } … … 76 78 AssertPtr(pPhys); 77 79 Assert(cb > 0); 80 RT_ASSERT_PREEMPTIBLE(); 78 81 79 82 /* … … 105 108 RTR0DECL(void) RTMemContFree(void *pv, size_t cb) 106 109 { 110 RT_ASSERT_PREEMPTIBLE(); 107 111 if (pv) 108 112 { -
trunk/src/VBox/Runtime/r0drv/darwin/assert-r0drv-darwin.cpp
r14500 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 37 #include <iprt/assert.h> 36 38 37 #include <iprt/as sert.h>39 #include <iprt/asm.h> 38 40 #include <iprt/log.h> 41 #include <iprt/stdarg.h> 39 42 #include <iprt/string.h> 40 #include <iprt/stdarg.h>41 #include <iprt/asm.h>42 43 43 44 -
trunk/src/VBox/Runtime/r0drv/darwin/initterm-r0drv-darwin.cpp
r19919 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 37 36 38 #include <iprt/err.h> 37 39 #include <iprt/assert.h> -
trunk/src/VBox/Runtime/r0drv/darwin/memobj-r0drv-darwin.cpp
r21497 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 36 #include "internal/iprt.h" 37 37 #include <iprt/memobj.h> 38 38 … … 45 45 #include <iprt/string.h> 46 46 #include <iprt/thread.h> 47 48 47 #include "internal/memobj.h" 49 48 -
trunk/src/VBox/Runtime/r0drv/darwin/memuserkernel-r0drv-darwin.cpp
r21284 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 37 #include <iprt/mem.h> 36 38 37 #include <iprt/ mem.h>39 #include <iprt/asm.h> 38 40 #include <iprt/err.h> 39 41 … … 41 43 RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb) 42 44 { 45 RT_ASSERT_INTS_ON(); 43 46 int rc = copyin((const user_addr_t)R3PtrSrc, pvDst, cb); 44 47 if (RT_LIKELY(rc == 0)) … … 50 53 RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb) 51 54 { 55 RT_ASSERT_INTS_ON(); 52 56 int rc = copyout(pvSrc, R3PtrDst, cb); 53 57 if (RT_LIKELY(rc == 0)) -
trunk/src/VBox/Runtime/r0drv/darwin/mp-r0drv-darwin.cpp
r19389 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 36 #include "internal/iprt.h" 37 37 #include <iprt/mp.h> 38 39 #include <iprt/asm.h> 38 40 #include <iprt/cpuset.h> 39 41 #include <iprt/err.h> 40 #include <iprt/asm.h>41 42 #include "r0drv/mp-r0drv.h" 42 43 44 45 /******************************************************************************* 46 * Defined Constants And Macros * 47 *******************************************************************************/ 43 48 #define MY_DARWIN_MAX_CPUS (0xf + 1) /* see MAX_CPUS */ 44 49 … … 202 207 RTDECL(int) RTMpOnAll(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 203 208 { 209 RT_ASSERT_INTS_ON(); 210 204 211 RTMPARGS Args; 205 212 Args.pfnWorker = pfnWorker; … … 230 237 RTDECL(int) RTMpOnOthers(PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 231 238 { 239 RT_ASSERT_INTS_ON(); 240 232 241 int rc; 233 242 RTMPARGS Args; … … 262 271 RTDECL(int) RTMpOnSpecific(RTCPUID idCpu, PFNRTMPWORKER pfnWorker, void *pvUser1, void *pvUser2) 263 272 { 273 RT_ASSERT_INTS_ON(); 274 264 275 int rc; 265 276 RTMPARGS Args; … … 278 289 RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) 279 290 { 291 RT_ASSERT_INTS_ON(); 292 280 293 /* no unicast IPI */ 281 294 return VERR_NOT_SUPPORTED; -
trunk/src/VBox/Runtime/r0drv/darwin/process-r0drv-darwin.cpp
r8245 r22052 29 29 */ 30 30 31 31 32 /******************************************************************************* 32 33 * Header Files * 33 34 *******************************************************************************/ 34 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 35 37 #include <iprt/process.h> 36 38 -
trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp
r21537 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 36 #include "internal/iprt.h" 37 37 #include <iprt/semaphore.h> 38 38 39 #include <iprt/alloc.h> 39 40 #include <iprt/assert.h> 40 41 #include <iprt/asm.h> 41 42 #include <iprt/err.h> 43 #include <iprt/mp.h> 44 #include <iprt/thread.h> 42 45 43 46 #include "internal/magics.h" … … 115 118 Assert(sizeof(RTSEMEVENTINTERNAL) > sizeof(void *)); 116 119 AssertPtrReturn(pEventSem, VERR_INVALID_POINTER); 120 RT_ASSERT_PREEMPTIBLE(); 117 121 118 122 PRTSEMEVENTINTERNAL pEventInt = (PRTSEMEVENTINTERNAL)RTMemAlloc(sizeof(*pEventInt)); … … 147 151 ("pEventInt=%p u32Magic=%#x\n", pEventInt, pEventInt->u32Magic), 148 152 VERR_INVALID_HANDLE); 153 RT_ASSERT_INTS_ON(); 149 154 150 155 lck_spin_lock(pEventInt->pSpinlock); … … 178 183 ("pEventInt=%p u32Magic=%#x\n", pEventInt, pEventInt->u32Magic), 179 184 VERR_INVALID_HANDLE); 185 RT_ASSERT_PREEMPT_CPUID_VAR(); 186 RT_ASSERT_INTS_ON(); 180 187 181 188 /** @todo should probably disable interrupts here... update … … 188 195 ASMAtomicIncU32(&pEventInt->cWaking); 189 196 thread_wakeup_prim((event_t)pEventInt, TRUE /* one thread */, THREAD_AWAKENED); 190 197 /** @todo this isn't safe. a scheduling interrupt on the other cpu while we're in here 191 198 * could cause the thread to be timed out before we manage to wake it up and the event 192 199 * ends up in the wrong state. ditto for posix signals. 193 200 * Update: check the return code; it will return KERN_NOT_WAITING if no one is around. */ 194 201 } 195 202 else … … 197 204 198 205 lck_spin_unlock(pEventInt->pSpinlock); 206 207 RT_ASSERT_PREEMPT_CPUID(); 199 208 return VINF_SUCCESS; 200 209 } … … 208 217 ("pEventInt=%p u32Magic=%#x\n", pEventInt, pEventInt->u32Magic), 209 218 VERR_INVALID_HANDLE); 210 219 RT_ASSERT_PREEMPTIBLE(); 220 211 221 lck_spin_lock(pEventInt->pSpinlock); 212 222 … … 306 316 Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *)); 307 317 AssertPtrReturn(pEventMultiSem, VERR_INVALID_POINTER); 318 RT_ASSERT_PREEMPTIBLE(); 308 319 309 320 PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pEventMultiInt)); … … 338 349 ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic), 339 350 VERR_INVALID_HANDLE); 351 RT_ASSERT_INTS_ON(); 340 352 341 353 lck_spin_lock(pEventMultiInt->pSpinlock); … … 369 381 ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic), 370 382 VERR_INVALID_HANDLE); 383 RT_ASSERT_PREEMPT_CPUID_VAR(); 384 RT_ASSERT_INTS_ON(); 371 385 372 386 lck_spin_lock(pEventMultiInt->pSpinlock); … … 381 395 382 396 lck_spin_unlock(pEventMultiInt->pSpinlock); 397 398 RT_ASSERT_PREEMPT_CPUID(); 383 399 return VINF_SUCCESS; 384 400 } … … 407 423 ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic), 408 424 VERR_INVALID_HANDLE); 425 RT_ASSERT_PREEMPTIBLE(); 409 426 410 427 lck_spin_lock(pEventMultiInt->pSpinlock); … … 502 519 RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX pMutexSem) 503 520 { 521 RT_ASSERT_PREEMPTIBLE(); 504 522 AssertCompile(sizeof(RTSEMMUTEXINTERNAL) > sizeof(void *)); 505 523 PRTSEMMUTEXINTERNAL pMutexInt = (PRTSEMMUTEXINTERNAL)RTMemAlloc(sizeof(*pMutexInt)); … … 532 550 ("pMutexInt->u32Magic=%RX32 pMutexInt=%p\n", pMutexInt->u32Magic, pMutexInt) 533 551 VERR_INVALID_PARAMETER); 552 RT_ASSERT_INTS_ON(); 534 553 535 554 /* … … 559 578 ("pMutexInt->u32Magic=%RX32 pMutexInt=%p\n", pMutexInt->u32Magic, pMutexInt) 560 579 VERR_INVALID_PARAMETER); 580 RT_ASSERT_PREEMPTIBLE(); 561 581 562 582 /* … … 611 631 return VERR_INVALID_PARAMETER; 612 632 } 633 RT_ASSERT_PREEMPTIBLE(); 613 634 614 635 /* … … 632 653 AssertCompile(sizeof(RTSEMFASTMUTEXINTERNAL) > sizeof(void *)); 633 654 AssertPtrReturn(pMutexSem, VERR_INVALID_POINTER); 655 RT_ASSERT_PREEMPTIBLE(); 634 656 635 657 PRTSEMFASTMUTEXINTERNAL pFastInt = (PRTSEMFASTMUTEXINTERNAL)RTMemAlloc(sizeof(*pFastInt)); … … 660 682 ("pFastInt->u32Magic=%RX32 pFastInt=%p\n", pFastInt->u32Magic, pFastInt), 661 683 VERR_INVALID_PARAMETER); 684 RT_ASSERT_INTS_ON(); 662 685 663 686 ASMAtomicIncU32(&pFastInt->u32Magic); /* make the handle invalid. */ … … 678 701 ("pFastInt->u32Magic=%RX32 pFastInt=%p\n", pFastInt->u32Magic, pFastInt), 679 702 VERR_INVALID_PARAMETER); 703 RT_ASSERT_PREEMPTIBLE(); 680 704 lck_mtx_lock(pFastInt->pMtx); 681 705 return VINF_SUCCESS; … … 690 714 ("pFastInt->u32Magic=%RX32 pFastInt=%p\n", pFastInt->u32Magic, pFastInt), 691 715 VERR_INVALID_PARAMETER); 716 RT_ASSERT_PREEMPTIBLE(); 692 717 lck_mtx_unlock(pFastInt->pMtx); 693 718 return VINF_SUCCESS; -
trunk/src/VBox/Runtime/r0drv/darwin/spinlock-r0drv-darwin.cpp
r8245 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 36 37 #include <iprt/spinlock.h> 37 #include <iprt/err.h> 38 #include <iprt/alloc.h> 38 39 39 #include <iprt/assert.h> 40 40 #include <iprt/asm.h> 41 #include <iprt/err.h> 42 #include <iprt/mem.h> 43 #include <iprt/thread.h> 41 44 42 45 #include "internal/magics.h" … … 61 64 RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock) 62 65 { 66 RT_ASSERT_PREEMPTIBLE(); 67 63 68 /* 64 69 * Allocate. -
trunk/src/VBox/Runtime/r0drv/darwin/thread-r0drv-darwin.cpp
r8245 r22052 29 29 */ 30 30 31 31 32 /******************************************************************************* 32 33 * Header Files * 33 34 *******************************************************************************/ 34 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 35 37 #include <iprt/thread.h> 38 39 #include <iprt/assert.h> 36 40 #include <iprt/err.h> 37 41 … … 46 50 RTDECL(int) RTThreadSleep(unsigned cMillies) 47 51 { 52 RT_ASSERT_PREEMPTIBLE(); 48 53 uint64_t u64Deadline; 49 54 clock_interval_to_deadline(cMillies, kMillisecondScale, &u64Deadline); … … 55 60 RTDECL(bool) RTThreadYield(void) 56 61 { 62 RT_ASSERT_PREEMPTIBLE(); 57 63 thread_block(THREAD_CONTINUE_NULL); 58 64 return true; /* this is fishy */ -
trunk/src/VBox/Runtime/r0drv/darwin/thread2-r0drv-darwin.cpp
r8245 r22052 29 29 */ 30 30 31 31 32 /******************************************************************************* 32 33 * Header Files * 33 34 *******************************************************************************/ 34 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 35 37 #include <iprt/thread.h> 38 39 #include <iprt/asm.h> 40 #include <iprt/assert.h> 36 41 #include <iprt/err.h> 37 #include <iprt/assert.h>38 42 #include "internal/thread.h" 39 43 … … 102 106 return VERR_INVALID_PARAMETER; 103 107 } 108 RT_ASSERT_INTS_ON(); 104 109 105 110 /* … … 156 161 int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread) 157 162 { 163 RT_ASSERT_PREEMPTIBLE(); 164 158 165 thread_t NativeThread; 159 166 kern_return_t kr = kernel_thread_start(rtThreadNativeMain, pThreadInt, &NativeThread); -
trunk/src/VBox/Runtime/r0drv/darwin/threadpreempt-r0drv-darwin.cpp
r21536 r22052 34 34 *******************************************************************************/ 35 35 #include "the-darwin-kernel.h" 36 #include "internal/iprt.h" 36 37 #include <iprt/thread.h> 37 38 … … 191 192 { 192 193 Assert(hThread == NIL_RTTHREAD); NOREF(hThread); 193 /** @todo Solaris: Implement RTThreadIsInInterrupt. Required for guest194 /** @todo Darwin: Implement RTThreadIsInInterrupt. Required for guest 194 195 * additions! */ 195 196 return !ASMIntAreEnabled(); -
trunk/src/VBox/Runtime/r0drv/darwin/time-r0drv-darwin.cpp
r16332 r22052 35 35 #define LOG_GROUP RTLOGGROUP_TIME 36 36 #include "the-darwin-kernel.h" 37 #include "internal/iprt.h" 37 38 #include <iprt/time.h> 39 38 40 #include <iprt/asm.h> 39 41
Note:
See TracChangeset
for help on using the changeset viewer.