Changeset 4178 in vbox for trunk/src/VBox/Runtime/r0drv/solaris
- Timestamp:
- Aug 16, 2007 3:07:51 PM (17 years ago)
- Location:
- trunk/src/VBox/Runtime/r0drv/solaris
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/alloc-r0drv-solaris.c
r4071 r4178 37 37 PRTMEMHDR pHdr; 38 38 if (fFlags & RTMEMHDR_FLAG_ZEROED) 39 pHdr = (PRTMEMHDR)kmem_zalloc(cb + sizeof(*pHdr), KM_ NOSLEEP);39 pHdr = (PRTMEMHDR)kmem_zalloc(cb + sizeof(*pHdr), KM_SLEEP); 40 40 else 41 pHdr = (PRTMEMHDR)kmem_alloc(cb + sizeof(*pHdr), KM_ NOSLEEP);41 pHdr = (PRTMEMHDR)kmem_alloc(cb + sizeof(*pHdr), KM_SLEEP); 42 42 if (pHdr) 43 43 { … … 74 74 RTR0DECL(void *) RTMemContAlloc(PRTCCPHYS pPhys, size_t cb) 75 75 { 76 /* Solaris currently supports allocating contiguous memory 77 * only for DMA drivers which requires passing the driver's 78 * device ID, and upper/lower DMA memory limits 79 * Currently thus disabled since RTMemContAlloc isn't really used 80 * anywhere significant yet (only in GuestAdditions which is not 81 * there for Solaris) 82 * ddi_umem_alloc doesn't allocate contiguous memory! 83 */ 84 /**@todo Implement RTMemContAlloc on Solaris - there is no way around this. */ 76 /** @todo: implement RTMemContAlloc in Solaris */ 77 /* ddi_umem_alloc without PAGEABLE flag might produce contiguous physical memory, but 78 the documentation doesn't talk about contiguous at all :( 79 If we can use ddi_umem_alloc we need to keep track of the ddi_umem_cookie 80 which kernel allocates, but the ContFree() function only passes us back 81 the address. Maybe we could for each ContAlloc build a linked list of 82 structures that have the cookie and corresponding virtual address. */ 85 83 return NULL; 86 84 } -
trunk/src/VBox/Runtime/r0drv/solaris/semevent-r0drv-solaris.c
r4071 r4178 50 50 uint32_t volatile cWaking; 51 51 /** The Solaris mutex protecting this structure and pairing up the with the cv. */ 52 struct mutexMtx;52 kmutex_t Mtx; 53 53 /** The Solaris condition variable. */ 54 54 kcondvar_t Cnd; … … 104 104 { 105 105 mutex_exit(&pEventInt->Mtx); 106 cv_destroy(&pEventInt->Cnd); 106 107 mutex_destroy(&pEventInt->Mtx); 107 cv_destroy(&pEventInt->Cnd);108 108 RTMemFree(pEventInt); 109 109 } … … 166 166 else 167 167 cTicks = 0; 168 cTicks += timeout;168 timeout += cTicks; 169 169 170 170 ASMAtomicIncU32(&pEventInt->cWaiters); … … 178 178 { 179 179 rc = VERR_SEM_DESTROYED; 180 /** @todo r=bird: better make sure you're the last guy out before doing the cleanup.... */ 181 mutex_exit(&pEventInt->Mtx); 182 cv_destroy(&pEventInt->Cnd); 183 mutex_destroy(&pEventInt->Mtx); 184 RTMemFree(pEventInt); 185 return rc; 180 if (!ASMAtomicDecU32(&pEventInt->cWaking)) 181 { 182 mutex_exit(&pEventInt->Mtx); 183 cv_destroy(&pEventInt->Cnd); 184 mutex_destroy(&pEventInt->Mtx); 185 RTMemFree(pEventInt); 186 return rc; 187 } 186 188 } 187 189 -
trunk/src/VBox/Runtime/r0drv/solaris/semfastmutex-r0drv-solaris.c
r4071 r4178 42 42 uint32_t u32Magic; 43 43 /** The Solaris mutex. */ 44 struct mutexMtx;44 kmutex_t Mtx; 45 45 } RTSEMFASTMUTEXINTERNAL, *PRTSEMFASTMUTEXINTERNAL; 46 46 -
trunk/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c
r4071 r4178 41 41 uint32_t volatile u32Magic; 42 42 /** A Solaris spinlock. */ 43 struct mutexMtx;43 kmutex_t Mtx; 44 44 } RTSPINLOCKINTERNAL, *PRTSPINLOCKINTERNAL; 45 45 … … 59 59 */ 60 60 pSpinlockInt->u32Magic = RTSPINLOCK_MAGIC; 61 mutex_init(&pSpinlockInt->Mtx, " iprt-spinlock", MUTEX_SPIN, NULL);61 mutex_init(&pSpinlockInt->Mtx, "IPRT Spinlock", MUTEX_SPIN, NULL); 62 62 *pSpinlock = pSpinlockInt; 63 63 return VINF_SUCCESS; -
trunk/src/VBox/Runtime/r0drv/solaris/the-solaris-kernel.h
r4071 r4178 29 29 #include <sys/sdt.h> 30 30 #include <sys/schedctl.h> 31 #include <sys/time.h> 31 32 32 /* commented for now 33 /* commented for now 33 34 #include <iprt/cdefs.h> 34 35 35 __BEGIN_DECLS 36 extern int nanosleep(const struct timespec *, struct timespec *);37 36 38 37 __END_DECLS -
trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
r4071 r4178 35 35 { 36 36 int cTicks; 37 37 unsigned long timeout; 38 38 39 if (!cMillies) 39 40 { … … 46 47 else 47 48 cTicks = 0; 48 49 /* hm, maybe we could also use nanosleep() */ 49 #if 0 50 timeout = ddi_get_lbolt(); 51 timeout += cTicks; 52 53 kcondvar_t cnd; 54 kmutex_t mtx; 55 mutex_init(&mtx, "IPRT Sleep Mutex", MUTEX_DRIVER, NULL); 56 cv_init(&cnd, "IPRT Sleep CV", CV_DRIVER, NULL); 57 mutex_enter(&mtx); 58 cv_timedwait (&cnd, &mtx, 9000 * timeout); 59 mutex_exit(&mtx); 60 cv_destroy(&cnd); 61 mutex_destroy(&mtx); 62 #endif 63 64 #if 1 50 65 delay(cTicks); 51 52 /* Hmm, no same effect as using delay() 66 #endif 67 68 #if 0 69 /* Hmm, no same effect as using delay() */ 53 70 struct timespec t; 54 71 t.tv_sec = 0; 55 72 t.tv_nsec = cMillies * 1000000L; 56 73 nanosleep (&t, NULL); 57 */ 74 #endif 75 58 76 return VINF_SUCCESS; 59 77 } -
trunk/src/VBox/Runtime/r0drv/solaris/thread2-r0drv-solaris.c
r4071 r4178 39 39 40 40 41 /** @todo Solaris native threading, when more info. on priority etc. (namely default prio value) is available */42 41 int rtThreadNativeSetPriority(PRTTHREADINT pThread, RTTHREADTYPE enmType) 43 42 { … … 56 55 } 57 56 58 THREAD_CHANGE_PRI(curthread, iPriority); 57 pri_t threadPrio = iPriority; 58 curthread->t_pri = threadPrio; 59 59 return VINF_SUCCESS; 60 60 } … … 88 88 { 89 89 int rc; 90 /** @todo passing hardcoded priority: 52. Find what default priority to pass*/90 /** @todo Passing hardcoded priority of 52, Find correct default priority */ 91 91 /* We know its from 0 to 127 priority, but what's the default?? */ 92 92 kthread_t* pKernThread = thread_create(NULL, NULL, rtThreadNativeMain, pThreadInt, 0, 93 93 curproc, LMS_USER, 52); 94 if ( rc == 0)94 if (pKernThread) 95 95 { 96 96 *pNativeThread = (RTNATIVETHREAD)pKernThread;
Note:
See TracChangeset
for help on using the changeset viewer.