Changeset 29250 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- May 9, 2010 5:53:58 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61332
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/VBox/logbackdoor.cpp
r28800 r29250 30 30 #include <VBox/log.h> 31 31 #include "internal/iprt.h" 32 #include <iprt/asm .h>32 #include <iprt/asm-amd64-x86.h> 33 33 #include <iprt/string.h> 34 34 #ifdef IN_GUEST_R3 -
trunk/src/VBox/Runtime/common/log/log.cpp
r28800 r29250 47 47 #include <iprt/time.h> 48 48 #include <iprt/asm.h> 49 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 50 # include <iprt/asm-amd64-x86.h> 51 #endif 49 52 #include <iprt/assert.h> 50 53 #include <iprt/err.h> -
trunk/src/VBox/Runtime/common/log/logcom.cpp
r28800 r29250 49 49 50 50 #include <iprt/asm.h> 51 #include <iprt/asm-amd64-x86.h> 51 52 #include <iprt/stdarg.h> 52 53 #include <iprt/string.h> -
trunk/src/VBox/Runtime/common/rand/rand.cpp
r28800 r29250 33 33 34 34 #include <iprt/time.h> 35 #include <iprt/asm.h> 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 # include <iprt/asm-amd64-x86.h> 37 #endif 36 38 #include <iprt/err.h> 37 39 #include <iprt/assert.h> … … 68 70 if (RT_SUCCESS(rc)) 69 71 { 72 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 70 73 RTRandAdvSeed(hRand, ASMReadTSC() >> 8); 74 #else 75 RTRandAdvSeed(hRand, RTTimeNanoTS() >> 8); 76 #endif 71 77 g_hRand = hRand; 72 78 } -
trunk/src/VBox/Runtime/common/rand/randparkmiller.cpp
r28800 r29250 31 31 #include "internal/iprt.h" 32 32 33 #include <iprt/asm .h>33 #include <iprt/asm-math.h> 34 34 #include <iprt/mem.h> 35 35 #include <iprt/string.h> -
trunk/src/VBox/Runtime/common/time/timesup.cpp
r28800 r29250 33 33 #include "internal/iprt.h" 34 34 35 #include <iprt/asm.h>36 35 #include <iprt/assert.h> 37 36 #include <iprt/err.h> 38 37 #include <iprt/log.h> 39 38 #ifndef IN_GUEST 39 # include <iprt/asm.h> 40 # include <iprt/asm-amd64-x86.h> 40 41 # include <VBox/sup.h> 41 42 # include <VBox/x86.h> -
trunk/src/VBox/Runtime/common/time/timesupref.cpp
r28800 r29250 34 34 35 35 #include <iprt/asm.h> 36 #include <iprt/asm-math.h> 37 #include <iprt/asm-amd64-x86.h> 36 38 #include <VBox/sup.h> 37 39 #include "internal/time.h" -
trunk/src/VBox/Runtime/generic/spinlock-generic.cpp
r28800 r29250 43 43 #include <iprt/alloc.h> 44 44 #include <iprt/asm.h> 45 #include <iprt/asm-amd64-x86.h> 45 46 #include <iprt/err.h> 46 47 #include <iprt/assert.h> -
trunk/src/VBox/Runtime/include/internal/alignmentchecks.h
r28800 r29250 49 49 */ 50 50 51 #ifdef IPRT_WITH_ALIGNMENT_CHECKS 52 # include <iprt/asm.h> 51 #if defined(IPRT_WITH_ALIGNMENT_CHECKS) \ 52 && ( defined(RT_ARCH_AMD64) \ 53 || defined(RT_ARCH_X86) ) 54 # include <iprt/asm-amd64-x86.h> 53 55 54 56 RT_C_DECLS_BEGIN -
trunk/src/VBox/Runtime/include/internal/iprt.h
r28800 r29250 170 170 * Asserts that interrupts are disabled when RT_MORE_STRICT is defined. */ 171 171 #ifdef RT_MORE_STRICT 172 # define RT_ASSERT_INTS_ON() Assert(ASMIntAreEnabled()) 172 # if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 173 # define RT_ASSERT_INTS_ON() Assert(ASMIntAreEnabled()) 174 # else /* PORTME: Add architecture/platform specific test. */ 175 # define RT_ASSERT_INTS_ON() Assert(RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 176 # endif 173 177 #else 174 178 # define RT_ASSERT_INTS_ON() do { } while (0) -
trunk/src/VBox/Runtime/r0drv/alloc-r0drv.cpp
r28800 r29250 32 32 #include "internal/iprt.h" 33 33 34 #include <iprt/asm.h> 34 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 35 # include <iprt/asm-amd64-x86.h> 36 #endif 35 37 #include <iprt/assert.h> 36 38 #include <iprt/param.h> -
trunk/src/VBox/Runtime/r0drv/generic/semspinmutex-r0drv-generic.c
r28800 r29250 36 36 #include <iprt/semaphore.h> 37 37 #include <iprt/asm.h> 38 #include <iprt/asm-amd64-x86.h> 38 39 #include <iprt/assert.h> 39 40 #include <iprt/err.h> -
trunk/src/VBox/Runtime/r0drv/linux/spinlock-r0drv-linux.c
r28800 r29250 33 33 #include <iprt/spinlock.h> 34 34 35 #include <iprt/asm.h> 36 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 37 # include <iprt/asm-amd64-x86.h> 38 #endif 35 39 #include <iprt/assert.h> 36 #include <iprt/asm.h>37 40 #include <iprt/err.h> 38 41 #include <iprt/mem.h> -
trunk/src/VBox/Runtime/r0drv/mpnotification-r0drv.c
r28800 r29250 5 5 6 6 /* 7 * Copyright (C) 2008 Oracle Corporation7 * Copyright (C) 2008-2010 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 33 33 34 34 #include <iprt/asm.h> 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 # include <iprt/asm-amd64-x86.h> 37 #endif 35 38 #include <iprt/assert.h> 36 39 #include <iprt/err.h> -
trunk/src/VBox/Runtime/r0drv/powernotification-r0drv.c
r28800 r29250 33 33 34 34 #include <iprt/asm.h> 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 # include <iprt/asm-amd64-x86.h> 37 #endif 35 38 #include <iprt/assert.h> 36 39 #include <iprt/err.h> -
trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
r28800 r29250 45 45 #include <iprt/assert.h> 46 46 #include <iprt/asm.h> 47 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 48 # include <iprt/asm-amd64-x86.h> 49 #endif 47 50 #include <iprt/err.h> 48 51 #include <iprt/string.h> … … 329 332 RTDECL(bool) RTThreadYield(void) 330 333 { 334 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 331 335 uint64_t u64TS = ASMReadTSC(); 336 #endif 332 337 #ifdef RT_OS_DARWIN 333 338 pthread_yield_np(); … … 337 342 pthread_yield(); 338 343 #endif 344 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 339 345 u64TS = ASMReadTSC() - u64TS; 340 346 bool fRc = u64TS > 1500; 341 347 LogFlow(("RTThreadYield: returning %d (%llu ticks)\n", fRc, u64TS)); 348 #else 349 bool fRc = true; /* PORTME: Add heuristics for determining whether the cpus was yielded. */ 350 #endif 342 351 return fRc; 343 352 } -
trunk/src/VBox/Runtime/testcase/tstInlineAsm.cpp
r28800 r29250 29 29 *******************************************************************************/ 30 30 #include <iprt/asm.h> 31 #include <iprt/asm-math.h> 32 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 33 # include <iprt/asm-amd64-x86.h> 34 #endif 31 35 #include <iprt/stream.h> 32 36 #include <iprt/string.h> … … 63 67 64 68 65 #if !defined(PIC) || !defined(RT_ARCH_X86) 69 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 70 66 71 const char *getCacheAss(unsigned u) 67 72 { … … 430 435 } 431 436 } 432 #endif /* !PIC || !X86 */ 433 437 438 #endif /* AMD64 || X86 */ 434 439 435 440 static void tstASMAtomicXchgU8(void) … … 1178 1183 RTPrintf("tstInlineASM: Benchmarking:\n"); 1179 1184 1180 #define BENCH(op, str) \ 1185 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 1186 # define BENCH(op, str) \ 1187 do { \ 1181 1188 RTThreadYield(); \ 1182 1189 u64Elapsed = ASMReadTSC(); \ … … 1184 1191 op; \ 1185 1192 u64Elapsed = ASMReadTSC() - u64Elapsed; \ 1186 RTPrintf(" %-30s %3llu cycles\n", str, u64Elapsed / cRounds); 1193 RTPrintf(" %-30s %3llu cycles\n", str, u64Elapsed / cRounds); \ 1194 } while (0) 1195 #else 1196 # define BENCH(op, str) \ 1197 do { \ 1198 RTThreadYield(); \ 1199 u64Elapsed = RTTimeNanoTS(); \ 1200 for (i = cRounds; i > 0; i--) \ 1201 op; \ 1202 u64Elapsed = RTTimeNanoTS() - u64Elapsed; \ 1203 RTPrintf(" %-30s %3llu ns\n", str, u64Elapsed / cRounds); \ 1204 } while (0) 1205 #endif 1187 1206 1188 1207 BENCH(s_u32 = 0, "s_u32 = 0:"); … … 1259 1278 * Execute the tests. 1260 1279 */ 1261 #if !defined(PIC) || !defined(RT_ARCH_X86)1280 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 1262 1281 tstASMCpuId(); 1263 1282 #endif -
trunk/src/VBox/Runtime/testcase/tstPrfRT.cpp
r28800 r29250 33 33 #include <iprt/stream.h> 34 34 #include <iprt/thread.h> 35 #include <iprt/asm.h> 35 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 36 # include <iprt/asm-amd64-x86.h> 36 37 37 38 … … 42 43 } 43 44 44 # define ITERATE(preexpr, expr, postexpr, cIterations) \45 # define ITERATE(preexpr, expr, postexpr, cIterations) \ 45 46 for (i = 0, u64TotalTS = 0, u64MinTS = ~0, u64MaxTS = 0; i < (cIterations); i++) \ 46 47 { \ … … 61 62 u64TotalTS += u64ElapsedTS; \ 62 63 } 64 65 #else /* !AMD64 && !X86 */ 66 67 void PrintResult(uint64_t cNs, uint64_t cNsMax, uint64_t cNsMin, unsigned cTimes, const char *pszOperation) 68 { 69 RTPrintf("tstPrfRT: %-32s %5lld / %5lld / %5lld ns per call (%u calls %lld ns)\n", 70 pszOperation, cNsMin, cNs / (uint64_t)cTimes, cNsMax, cTimes, cNs); 71 } 72 73 # define ITERATE(preexpr, expr, postexpr, cIterations) \ 74 for (i = 0, u64TotalTS = 0, u64MinTS = ~0, u64MaxTS = 0; i < (cIterations); i++) \ 75 { \ 76 { preexpr } \ 77 uint64_t u64StartTS = RTTimeNanoTS(); \ 78 { expr } \ 79 uint64_t u64ElapsedTS = RTTimeNanoTS() - u64StartTS; \ 80 { postexpr } \ 81 if (u64ElapsedTS > u64MinTS * 32) \ 82 { \ 83 i--; \ 84 continue; \ 85 } \ 86 if (u64ElapsedTS < u64MinTS) \ 87 u64MinTS = u64ElapsedTS; \ 88 if (u64ElapsedTS > u64MaxTS) \ 89 u64MaxTS = u64ElapsedTS; \ 90 u64TotalTS += u64ElapsedTS; \ 91 } 92 93 #endif /* !AMD64 && !X86 */ 94 63 95 64 96 int main() -
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp
r28800 r29250 30 30 #include <iprt/thread.h> 31 31 32 #include <iprt/asm-amd64-x86.h> 32 33 #include <iprt/err.h> 33 34 #include <iprt/time.h> -
trunk/src/VBox/Runtime/testcase/tstTSC.cpp
r28800 r29250 28 28 * Header Files * 29 29 *******************************************************************************/ 30 #include <iprt/asm-amd64-x86.h> 30 31 #include <iprt/asm.h> 31 32 #include <iprt/getopt.h>
Note:
See TracChangeset
for help on using the changeset viewer.