Changeset 29276 in vbox
- Timestamp:
- May 9, 2010 11:24:53 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 61360
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r29273 r29276 30 30 #include <iprt/types.h> 31 31 #include <iprt/assert.h> 32 /** @todo @code #include <iprt/param.h> @endcode for PAGE_SIZE. */33 32 /** @def RT_INLINE_ASM_USES_INTRIN 34 33 * Defined as 1 if we're using a _MSC_VER 1400. … … 2409 2408 2410 2409 2411 #if defined(PAGE_SIZE) && !defined(NT_INCLUDED) 2412 # if PAGE_SIZE != 0x1000 2413 # error "PAGE_SIZE is not 0x1000!" 2410 /** @def RT_ASM_PAGE_SIZE 2411 * We try avoid dragging in iprt/param.h here. 2412 * @internal 2413 */ 2414 #if defined(RT_ARCH_SPARC64) 2415 # define RT_ASM_PAGE_SIZE 0x2000 2416 # if defined(PAGE_SIZE) && !defined(NT_INCLUDED) 2417 # if PAGE_SIZE != 0x2000 2418 # error "PAGE_SIZE is not 0x2000!" 2419 # endif 2420 # endif 2421 #else 2422 # define RT_ASM_PAGE_SIZE 0x1000 2423 # if defined(PAGE_SIZE) && !defined(NT_INCLUDED) 2424 # if PAGE_SIZE != 0x1000 2425 # error "PAGE_SIZE is not 0x1000!" 2426 # endif 2414 2427 # endif 2415 2428 #endif … … 2427 2440 # if RT_INLINE_ASM_USES_INTRIN 2428 2441 # ifdef RT_ARCH_AMD64 2429 __stosq((unsigned __int64 *)pv, 0, /*PAGE_SIZE*/0x1000/ 8);2442 __stosq((unsigned __int64 *)pv, 0, RT_ASM_PAGE_SIZE / 8); 2430 2443 # else 2431 __stosd((unsigned long *)pv, 0, /*PAGE_SIZE*/0x1000/ 4);2444 __stosd((unsigned long *)pv, 0, RT_ASM_PAGE_SIZE / 4); 2432 2445 # endif 2433 2446 … … 2439 2452 "=c" (uDummy) 2440 2453 : "0" (pv), 2441 "c" ( 0x1000>> 3),2454 "c" (RT_ASM_PAGE_SIZE >> 3), 2442 2455 "a" (0) 2443 2456 : "memory"); … … 2447 2460 "=c" (uDummy) 2448 2461 : "0" (pv), 2449 "c" ( 0x1000>> 2),2462 "c" (RT_ASM_PAGE_SIZE >> 2), 2450 2463 "a" (0) 2451 2464 : "memory"); … … 2592 2605 : "mr" (pvPage), 2593 2606 # ifdef RT_ARCH_AMD64 2594 "0" ( 0x1000/8),2595 # else 2596 "0" ( 0x1000/4),2607 "0" (RT_ASM_PAGE_SIZE/8), 2608 # else 2609 "0" (RT_ASM_PAGE_SIZE/4), 2597 2610 # endif 2598 2611 "1" (pvPage), … … 2601 2614 # else 2602 2615 uintptr_t const *puPtr = (uintptr_t const *)pvPage; 2603 int cLeft = 0x1000/ sizeof(uintptr_t) / 8;2616 int cLeft = RT_ASM_PAGE_SIZE / sizeof(uintptr_t) / 8; 2604 2617 Assert(!((uintptr_t)pvPage & 15)); 2605 2618 for (;;) … … 2737 2750 2738 2751 /* the pages in between pages. */ 2739 while (cbBuf > /*PAGE_SIZE*/0x1000)2752 while (cbBuf > RT_ASM_PAGE_SIZE) 2740 2753 { 2741 2754 ASMProbeReadByte(pu8); 2742 cbBuf -= /*PAGE_SIZE*/0x1000;2743 pu8 += /*PAGE_SIZE*/0x1000;2755 cbBuf -= RT_ASM_PAGE_SIZE; 2756 pu8 += RT_ASM_PAGE_SIZE; 2744 2757 } 2745 2758
Note:
See TracChangeset
for help on using the changeset viewer.