Changeset 22073 in vbox for trunk/src/VBox/Runtime/r0drv/solaris/vbi
- Timestamp:
- Aug 7, 2009 3:26:56 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 50819
- Location:
- trunk/src/VBox/Runtime/r0drv/solaris/vbi
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/RTLogWriteDebugger-r0drv-solaris.c
-
Property svn:keywords
set to
Author Date Id Revision
r21292 r22073 29 29 */ 30 30 31 32 /******************************************************************************* 33 * Header Files * 34 *******************************************************************************/ 31 35 #include "the-solaris-kernel.h" 32 36 #include <iprt/log.h> 37 33 38 #include <iprt/assert.h> 34 39 -
Property svn:keywords
set to
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/RTMpPokeCpu-r0drv-solaris.c
r19501 r22073 34 34 *******************************************************************************/ 35 35 #include "the-solaris-kernel.h" 36 #include "internal/iprt.h" 36 37 #include <iprt/mp.h> 38 39 #include <iprt/asm.h> 37 40 #include <iprt/err.h> 38 41 … … 41 44 RTDECL(int) RTMpPokeCpu(RTCPUID idCpu) 42 45 { 46 RT_ASSERT_INTS_ON(); 43 47 vbi_poke_cpu(idCpu); 44 48 return VINF_SUCCESS; -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/alloc-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r9149 r22073 34 34 *******************************************************************************/ 35 35 #include "the-solaris-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> 39 #include <iprt/types.h>40 40 #include <iprt/param.h> 41 #include <iprt/thread.h> 41 42 #include "r0drv/alloc-r0drv.h" 43 42 44 43 45 … … 93 95 AssertPtr(pPhys); 94 96 Assert(cb > 0); 97 RT_ASSERT_PREEMPTIBLE(); 95 98 96 99 /* Allocate physically contiguous page-aligned memory. */ … … 111 114 RTR0DECL(void) RTMemContFree(void *pv, size_t cb) 112 115 { 116 RT_ASSERT_PREEMPTIBLE(); 113 117 if (pv) 114 118 vbi_contig_free(pv, cb); -
Property svn:keywords
changed from
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/memobj-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r21633 r22073 34 34 *******************************************************************************/ 35 35 #include "the-solaris-kernel.h" 36 36 #include "internal/iprt.h" 37 37 #include <iprt/memobj.h> 38 39 #include <iprt/assert.h> 40 #include <iprt/err.h> 41 #include <iprt/log.h> 38 42 #include <iprt/mem.h> 39 #include <iprt/err.h>40 #include <iprt/assert.h>41 #include <iprt/log.h>42 43 #include <iprt/param.h> 43 44 #include <iprt/process.h> … … 326 327 cmn_err(CE_NOTE, "rtR0MemObjNativeMapUser: no page to map.\n"); 327 328 rc = VERR_MAP_FAILED; 328 goto done;329 goto l_done; 329 330 } 330 331 pv = (void *)((uintptr_t)pv + PAGE_SIZE); … … 337 338 rc = VERR_MAP_FAILED; 338 339 rtR0MemObjDelete(&pMemSolaris->Core); 339 goto done;340 goto l_done; 340 341 } 341 342 else … … 345 346 pMemSolaris->Core.pv = addr; 346 347 *ppMem = &pMemSolaris->Core; 347 done:348 l_done: 348 349 kmem_free(paddrs, sizeof(uint64_t) * cPages); 349 350 return rc; -
Property svn:keywords
changed from
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/mp-r0drv-solaris.c
r19391 r22073 34 34 *******************************************************************************/ 35 35 #include "the-solaris-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" 43 42 44 43 45 … … 160 162 { 161 163 RTMPARGS Args; 164 RT_ASSERT_INTS_ON(); 162 165 163 166 Args.pfnWorker = pfnWorker; … … 203 206 int rc; 204 207 RTMPARGS Args; 208 RT_ASSERT_INTS_ON(); 205 209 206 210 /* The caller is supposed to have disabled preemption, but take no chances. */ … … 249 253 int rc; 250 254 RTMPARGS Args; 255 RT_ASSERT_INTS_ON(); 251 256 252 257 if (idCpu >= vbi_cpu_count()) -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/mpnotification-r0drv-solaris.c
r11982 r22073 33 33 *******************************************************************************/ 34 34 #include "the-solaris-kernel.h" 35 #include "internal/iprt.h" 35 36 37 #include <iprt/err.h> 36 38 #include <iprt/mp.h> 37 #include <iprt/err.h>38 39 #include "r0drv/mp-r0drv.h" 40 41 42 /******************************************************************************* 43 * Global Variables * 44 *******************************************************************************/ 45 static vbi_cpu_watch_t *g_hVbiCpuWatch = NULL; 39 46 40 47 … … 50 57 } 51 58 52 static vbi_cpu_watch_t *watch_handle = NULL;53 59 54 60 int rtR0MpNotificationNativeInit(void) … … 56 62 if (vbi_revision_level < 2) 57 63 return VERR_NOT_SUPPORTED; 58 if ( watch_handle!= NULL)59 return VERR_ INVALID_PARAMETER;60 watch_handle= vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 0);64 if (g_hVbiCpuWatch != NULL) 65 return VERR_WRONG_ORDER; 66 g_hVbiCpuWatch = vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 0); 61 67 return VINF_SUCCESS; 62 68 } … … 65 71 void rtR0MpNotificationNativeTerm(void) 66 72 { 67 if (vbi_revision_level >= 2 && watch_handle!= NULL)68 vbi_ignore_cpus( watch_handle);69 watch_handle= NULL;73 if (vbi_revision_level >= 2 && g_hVbiCpuWatch != NULL) 74 vbi_ignore_cpus(g_hVbiCpuWatch); 75 g_hVbiCpuWatch = NULL; 70 76 } 71 77 -
trunk/src/VBox/Runtime/r0drv/solaris/vbi/process-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r9149 r22073 29 29 */ 30 30 31 31 32 /******************************************************************************* 32 33 * Header Files * 33 34 *******************************************************************************/ 34 35 #include "the-solaris-kernel.h" 36 #include "internal/iprt.h" 37 #include <iprt/process.h> 35 38 36 #include <iprt/process.h>37 39 38 40 -
Property svn:keywords
changed from
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r21595 r22073 34 34 *******************************************************************************/ 35 35 #include "the-solaris-kernel.h" 36 #include "internal/iprt.h" 37 #include <iprt/thread.h> 36 38 37 #include <iprt/thread.h>38 39 #include <iprt/asm.h> 39 40 #include <iprt/assert.h> 40 41 #include <iprt/err.h> 42 41 43 42 44 … … 51 53 clock_t cTicks; 52 54 unsigned long timeout; 55 RT_ASSERT_PREEMPTIBLE(); 53 56 54 57 if (!cMillies) … … 96 99 RTDECL(bool) RTThreadYield(void) 97 100 { 101 RT_ASSERT_PREEMPTIBLE(); 98 102 return vbi_yield(); 99 103 } -
Property svn:keywords
changed from
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread2-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r9149 r22073 29 29 */ 30 30 31 31 32 /******************************************************************************* 32 33 * Header Files * 33 34 *******************************************************************************/ 34 35 #include "the-solaris-kernel.h" 36 #include "internal/iprt.h" 37 #include <iprt/thread.h> 35 38 36 39 #include <iprt/assert.h> 37 40 #include <iprt/err.h> 38 #include <iprt/thread.h>41 #include "internal/thread.h" 39 42 40 #include "internal/thread.h" 43 41 44 42 45 int rtThreadNativeInit(void) … … 90 93 { 91 94 PRTTHREADINT pThreadInt = (PRTTHREADINT)pvThreadInt; 92 int rc;93 95 94 r c = rtThreadMain(pThreadInt, (RTNATIVETHREAD)vbi_curthread(), &pThreadInt->szName[0]);96 rtThreadMain(pThreadInt, (RTNATIVETHREAD)vbi_curthread(), &pThreadInt->szName[0]); 95 97 vbi_thread_exit(); 96 98 } … … 99 101 int rtThreadNativeCreate(PRTTHREADINT pThreadInt, PRTNATIVETHREAD pNativeThread) 100 102 { 101 int rc; 102 void *pKernThread = vbi_thread_create(rtThreadNativeMain, pThreadInt, 103 sizeof (pThreadInt), minclsyspri); 104 if (pKernThread) 103 void *pvKernThread; 104 RT_ASSERT_PREEMPTIBLE(); 105 106 pvKernThread = vbi_thread_create(rtThreadNativeMain, pThreadInt, sizeof(pThreadInt), minclsyspri); 107 if (pvKernThread) 105 108 { 106 *pNativeThread = (RTNATIVETHREAD)p KernThread;109 *pNativeThread = (RTNATIVETHREAD)pvKernThread; 107 110 return VINF_SUCCESS; 108 111 } 109 112 110 return RTErrConvertFromErrno(rc);113 return VERR_OUT_OF_RESOURCES; 111 114 } 112 115 -
Property svn:keywords
changed from
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/time-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r9149 r22073 33 33 * Header Files * 34 34 *******************************************************************************/ 35 #define RTTIME_INCL_TIMESPEC 35 36 #include "the-solaris-kernel.h" 36 #define RTTIME_INCL_TIMESPEC 37 37 #include "internal/iprt.h" 38 38 #include <iprt/time.h> 39 39 … … 67 67 return RTTimeSpecSetNano(pTime, vbi_tod()); 68 68 } 69 -
Property svn:keywords
changed from
-
trunk/src/VBox/Runtime/r0drv/solaris/vbi/timer-r0drv-solaris.c
-
Property svn:keywords
changed from
Id
toAuthor Date Id Revision
r14318 r22073 1 /* *$Id$ */1 /* $Id$ */ 2 2 /** @file 3 3 * IPRT - Timer, Ring-0 Driver, Solaris. … … 34 34 *******************************************************************************/ 35 35 #include "the-solaris-kernel.h" 36 36 #include "internal/iprt.h" 37 37 #include <iprt/timer.h> 38 #include <iprt/time.h> 38 39 #include <iprt/asm.h> 40 #include <iprt/assert.h> 41 #include <iprt/err.h> 42 #include <iprt/mem.h> 39 43 #include <iprt/mp.h> 40 44 #include <iprt/spinlock.h> 41 #include <iprt/err.h> 42 #include <iprt/asm.h> 43 #include <iprt/assert.h> 44 #include <iprt/alloc.h> 45 45 #include <iprt/time.h> 46 #include <iprt/thread.h> 46 47 #include "internal/magics.h" 47 48 … … 70 71 uint64_t interval; 71 72 /** simple Solaris timer handle. */ 72 vbi_stimer_t 73 vbi_stimer_t *stimer; 73 74 /** global Solaris timer handle. */ 74 vbi_gtimer_t 75 vbi_gtimer_t *gtimer; 75 76 /** The user callback. */ 76 77 PFNRTTIMER pfnTimer; 77 78 /** The argument for the user callback. */ 78 void 79 void *pvUser; 79 80 } RTTIMER; 81 82 83 /******************************************************************************* 84 * Defined Constants And Macros * 85 *******************************************************************************/ 86 /** Validates that the timer is valid. */ 87 #define RTTIMER_ASSERT_VALID_RET(pTimer) \ 88 do \ 89 { \ 90 AssertPtrReturn(pTimer, VERR_INVALID_HANDLE); \ 91 AssertReturn((pTimer)->u32Magic == RTTIMER_MAGIC, VERR_INVALID_HANDLE); \ 92 } while (0) 80 93 81 94 … … 93 106 RTDECL(int) RTTimerCreateEx(PRTTIMER *ppTimer, uint64_t u64NanoInterval, unsigned fFlags, PFNRTTIMER pfnTimer, void *pvUser) 94 107 { 108 RT_ASSERT_PREEMPTIBLE(); 95 109 *ppTimer = NULL; 96 110 … … 149 163 150 164 151 /**152 * Validates the timer handle.153 *154 * @returns true if valid, false if invalid.155 * @param pTimer The handle.156 */157 DECLINLINE(bool) rtTimerIsValid(PRTTIMER pTimer)158 {159 AssertReturn(VALID_PTR(pTimer), false);160 AssertReturn(pTimer->u32Magic == RTTIMER_MAGIC, false);161 return true;162 }163 164 165 165 RTDECL(int) RTTimerDestroy(PRTTIMER pTimer) 166 166 { 167 167 if (pTimer == NULL) 168 168 return VINF_SUCCESS; 169 if (!rtTimerIsValid(pTimer))170 return VERR_INVALID_HANDLE;169 RTTIMER_ASSERT_VALID_RET(pTimer); 170 RT_ASSERT_INTS_ON(); 171 171 172 172 /* … … 174 174 */ 175 175 RTTimerStop(pTimer); 176 pTimer->u32Magic++;176 ASMAtomicWriteU32(pTimer, ~RTTIMER_MAGIC); 177 177 RTMemFree(pTimer); 178 178 return VINF_SUCCESS; … … 182 182 RTDECL(int) RTTimerStart(PRTTIMER pTimer, uint64_t u64First) 183 183 { 184 int cpu = VBI_ANY_CPU; 185 186 if (!rtTimerIsValid(pTimer)) 187 return VERR_INVALID_HANDLE; 184 RTTIMER_ASSERT_VALID_RET(pTimer); 185 RT_ASSERT_INTS_ON(); 186 188 187 if (!pTimer->fSuspended) 189 188 return VERR_TIMER_ACTIVE; … … 198 197 else 199 198 { 199 int cpu = VBI_ANY_CPU; 200 200 if (pTimer->fSpecificCpu) 201 201 cpu = pTimer->iCpu; … … 215 215 RTDECL(int) RTTimerStop(PRTTIMER pTimer) 216 216 { 217 if (!rtTimerIsValid(pTimer)) 218 return VERR_INVALID_HANDLE; 217 RTTIMER_ASSERT_VALID_RET(pTimer); 218 RT_ASSERT_INTS_ON(); 219 219 220 if (pTimer->fSuspended) 220 221 return VERR_TIMER_SUSPENDED; -
Property svn:keywords
changed from
Note:
See TracChangeset
for help on using the changeset viewer.