VirtualBox

Changeset 103014 in vbox for trunk/include


Ignore:
Timestamp:
Jan 24, 2024 12:58:12 AM (16 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161248
Message:

iprt/asm-mem.h: Eliminated the ASMMemZeroPage function, replaced the three actual uses in PGMPool with RT_BZERO/PAGE_SIZE.

Location:
trunk/include/iprt
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm-mem-watcom-x86-16.h

    r103005 r103014  
    5252 *       the watcom header at both the top and the bottom of asm.h file.
    5353 */
    54 
    55 #undef      ASMMemZeroPage
    56 #ifdef IPRT_ASM_WATCOM_X86_16_WITH_PRAGMAS
    57 # if defined(__SW_0) || defined(__SW_1) || defined(__SW_2)
    58 #  pragma aux ASMMemZeroPage = \
    59     "mov cx, 2048" \
    60     "xor ax, ax" \
    61     "rep stosw"  \
    62     parm [es di] \
    63     modify exact [ax cx di];
    64 # else
    65 #  pragma aux ASMMemZeroPage = \
    66     "mov ecx, 1024" \
    67     "xor eax, eax" \
    68     "rep stosd"  \
    69     parm [es di] \
    70     modify exact [ax cx di];
    71 # endif
    72 #endif
    7354
    7455#undef      ASMMemZero32
  • trunk/include/iprt/asm-mem-watcom-x86-32.h

    r103005 r103014  
    5353 */
    5454
    55 #undef      ASMMemZeroPage
    56 #ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
    57 #pragma aux ASMMemZeroPage = \
    58     "mov ecx, 1024" \
    59     "xor eax, eax" \
    60     "rep stosd"  \
    61     parm [edi] \
    62     modify exact [eax ecx edi];
    63 #endif
    64 
    6555#undef      ASMMemZero32
    6656#ifdef IPRT_ASM_WATCOM_X86_32_WITH_PRAGMAS
  • trunk/include/iprt/asm-mem.h

    r103013 r103014  
    101101# endif
    102102#endif
    103 
    104 
    105 #ifdef RT_ASM_PAGE_SIZE
    106 /**
    107  * Zeros a 4K memory page.
    108  *
    109  * @param   pv  Pointer to the memory block. This must be page aligned.
    110  */
    111 # if (RT_INLINE_ASM_EXTERNAL && !RT_INLINE_ASM_USES_INTRIN) || (!defined(RT_ARCH_AMD64) && !defined(RT_ARCH_X86))
    112 RT_ASM_DECL_PRAGMA_WATCOM(void) ASMMemZeroPage(volatile void RT_FAR *pv) RT_NOTHROW_PROTO;
    113 #  else
    114 DECLINLINE(void) ASMMemZeroPage(volatile void RT_FAR *pv) RT_NOTHROW_DEF
    115 {
    116 #   if RT_INLINE_ASM_USES_INTRIN
    117 #    ifdef RT_ARCH_AMD64
    118     __stosq((unsigned __int64 *)pv, 0, RT_ASM_PAGE_SIZE / 8);
    119 #    else
    120     __stosd((unsigned long *)pv, 0, RT_ASM_PAGE_SIZE / 4);
    121 #    endif
    122 
    123 #   elif RT_INLINE_ASM_GNU_STYLE
    124     RTCCUINTREG uDummy;
    125 #    ifdef RT_ARCH_AMD64
    126     __asm__ __volatile__("rep stosq"
    127                          : "=D" (pv),
    128                            "=c" (uDummy)
    129                          : "0" (pv),
    130                            "c" (RT_ASM_PAGE_SIZE >> 3),
    131                            "a" (0)
    132                          : "memory");
    133 #    else
    134     __asm__ __volatile__("rep stosl"
    135                          : "=D" (pv),
    136                            "=c" (uDummy)
    137                          : "0" (pv),
    138                            "c" (RT_ASM_PAGE_SIZE >> 2),
    139                            "a" (0)
    140                          : "memory");
    141 #    endif
    142 #   else
    143     __asm
    144     {
    145 #    ifdef RT_ARCH_AMD64
    146         xor     rax, rax
    147         mov     ecx, 0200h
    148         mov     rdi, [pv]
    149         rep     stosq
    150 #    else
    151         xor     eax, eax
    152         mov     ecx, 0400h
    153         mov     edi, [pv]
    154         rep     stosd
    155 #    endif
    156     }
    157 #   endif
    158 }
    159 # endif
    160 #endif /* RT_ASM_PAGE_SIZE */
    161103
    162104
  • trunk/include/iprt/mangling.h

    r102647 r103014  
    291291# define ASMMemZero32                                   RT_MANGLER(ASMMemZero32)
    292292# define ASMMemZero32_EndProc                           RT_MANGLER(ASMMemZero32_EndProc)
    293 # define ASMMemZeroPage                                 RT_MANGLER(ASMMemZeroPage)
    294 # define ASMMemZeroPage_EndProc                         RT_MANGLER(ASMMemZeroPage_EndProc)
    295293# define ASMMultU64ByU32DivByU32                        RT_MANGLER(ASMMultU64ByU32DivByU32)
    296294# define ASMMultU64ByU32DivByU32_EndProc                RT_MANGLER(ASMMultU64ByU32DivByU32_EndProc)
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette