VirtualBox

Ignore:
Timestamp:
Nov 10, 2008 4:31:22 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39077
Message:

The VMMR0 template now uses the IPRT No-CRT stuff, as does RuntimeR0. Added nocrt strcpy and fixed completely busted aliases.

Location:
trunk/src/VBox/Runtime/common/string
Files:
9 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/memchr.asm

    r8256 r14021  
    3737; @param    ch      gcc: esi  msc: edx  x86:[esp+8]
    3838; @param    cb      gcc: rdx  msc: r8   x86:[esp+0ch]
    39 BEGINPROC RT_NOCRT(memchr)
     39RT_NOCRT_BEGINPROC memchr
    4040        cld
    4141%ifdef RT_ARCH_AMD64
  • trunk/src/VBox/Runtime/common/string/memcmp.asm

    r8256 r14021  
    3737; @param    pv2     gcc: rsi  msc: rdx  x86:[esp+8]
    3838; @param    cb      gcc: rdx  msc: r8   x86:[esp+0ch]
    39 BEGINPROC RT_NOCRT(memcmp)
     39RT_NOCRT_BEGINPROC memcmp
    4040        cld
    4141        xor     eax, eax
  • trunk/src/VBox/Runtime/common/string/memcpy.asm

    r8256 r14021  
    3737; @param    pvSrc   gcc: rsi  msc: rdx  x86:[esp+8]
    3838; @param    cb      gcc: rdx  msc: r8   x86:[esp+0ch]
    39 BEGINPROC RT_NOCRT(memcpy)
     39RT_NOCRT_BEGINPROC memcpy
    4040        cld
    4141
  • trunk/src/VBox/Runtime/common/string/memmove.asm

    r8256 r14021  
    3737; @param    pvSrc   gcc: rsi  msc: rdx  x86:[esp+8]
    3838; @param    cb      gcc: rdx  msc: r8   x86:[esp+0ch]
    39 BEGINPROC RT_NOCRT(memmove)
     39RT_NOCRT_BEGINPROC memmove
    4040        ; Prolog.
    4141%ifdef RT_ARCH_AMD64
  • trunk/src/VBox/Runtime/common/string/mempcpy.asm

    r8256 r14021  
    3737; @param    pvSrc   gcc: rsi  msc: rdx  x86:[esp+8]
    3838; @param    cb      gcc: rdx  msc: r8   x86:[esp+0ch]
    39 BEGINPROC RT_NOCRT(mempcpy)
     39RT_NOCRT_BEGINPROC mempcpy
    4040        cld                             ; paranoia
    4141
  • trunk/src/VBox/Runtime/common/string/memset.asm

    r8256 r14021  
    3737; @param    ch      gcc: esi  msc: edx  x86:[esp+8]
    3838; @param    cb      gcc: rdx  msc: r8   x86:[esp+0ch]
    39 BEGINPROC RT_NOCRT(memset)
     39RT_NOCRT_BEGINPROC memset
    4040        cld
    4141%ifdef RT_ARCH_AMD64
  • trunk/src/VBox/Runtime/common/string/strchr.asm

    r8256 r14021  
    3636; @param    psz     gcc: rdi  msc: rcx  x86:[esp+4]
    3737; @param    ch      gcc: esi  msc: edx  x86:[esp+8]
    38 BEGINPROC RT_NOCRT(strchr)
     38RT_NOCRT_BEGINPROC strchr
    3939        cld
    4040
  • trunk/src/VBox/Runtime/common/string/strcmp.asm

    r14017 r14021  
    3636; @param    psz1   gcc: rdi  msc: rcx  x86:[esp+4]
    3737; @param    psz2   gcc: rsi  msc: rdx  x86:[esp+8]
    38 BEGINPROC RT_NOCRT(strcmp)
     38RT_NOCRT_BEGINPROC strcmp
    3939        ; input
    4040%ifdef RT_ARCH_AMD64
  • trunk/src/VBox/Runtime/common/string/strcpy.asm

    r13991 r14021  
    11; $Id$
    22;; @file
    3 ; IPRT - No-CRT strcmp - AMD64 & X86.
     3; IPRT - No-CRT strcpy - AMD64 & X86.
    44;
    55
     
    3636; @param    psz1   gcc: rdi  msc: rcx  x86:[esp+4]
    3737; @param    psz2   gcc: rsi  msc: rdx  x86:[esp+8]
    38 BEGINPROC RT_NOCRT(strcmp)
     38RT_NOCRT_BEGINPROC strcpy
    3939        ; input
    4040%ifdef RT_ARCH_AMD64
     
    4646  %define psz2 rsi
    4747 %endif
     48        mov     r8, psz1
    4849%else
    4950        mov     ecx, [esp + 4]
     
    5152  %define psz1 ecx
    5253  %define psz2 edx
     54        push    psz1
    5355%endif
    5456
     
    5860.next:
    5961        mov     al, [psz1]
    60         mov     ah, [psz2]
    61         cmp     al, ah
    62         jne     .not_equal
     62        mov     [psz2], al
    6363        test    al, al
    64         jz      .equal
     64        jz      .done
    6565
    6666        mov     al, [psz1 + 1]
    67         mov     ah, [psz2 + 1]
    68         cmp     al, ah
    69         jne     .not_equal
     67        mov     [psz2 + 1], al
    7068        test    al, al
    71         jz      .equal
    72         inc     psz1
    73         inc     psz2
     69        jz      .done
    7470
    7571        mov     al, [psz1 + 2]
    76         mov     ah, [psz2 + 2]
    77         cmp     al, ah
    78         jne     .not_equal
     72        mov     [psz2 + 2], al
    7973        test    al, al
    80         jz      .equal
    81         inc     psz1
    82         inc     psz2
     74        jz      .done
    8375
    8476        mov     al, [psz1 + 3]
    85         mov     ah, [psz2 + 3]
    86         cmp     al, ah
    87         jne     .not_equal
     77        mov     [psz2 + 3], al
    8878        test    al, al
    89         jz      .equal
     79        jz      .done
    9080
    9181        add     psz1, 4
     
    9383        jmp     .next
    9484
    95 .equal:
    96         xor     eax, eax
     85.done:
     86%ifdef RT_ARCH_AMD64
     87        mov     rax, r8
     88%else
     89        pop     eax
     90%endif
    9791        ret
     92ENDPROC RT_NOCRT(strcpy)
    9893
    99 .not_equal:
    100         movzx   ecx, ah
    101         and     eax, 0ffh
    102         sub     eax, ecx
    103         ret
    104 ENDPROC RT_NOCRT(strcmp)
    105 
  • trunk/src/VBox/Runtime/common/string/strcpy_alias.c

    r13991 r14021  
    11/* $Id$ */
    22/** @file
    3  * IPRT - No-CRT strcmp() alias for gcc.
     3 * IPRT - No-CRT strcpy() alias for gcc.
    44 */
    55
     
    3434*******************************************************************************/
    3535#include <iprt/nocrt/string.h>
    36 #undef strcmp
     36#undef strcpy
    3737
    3838#if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS)
    3939# ifndef __MINGW32__
    40 #  pragma weak strcmp
     40#  pragma weak strcpy
    4141# endif
    4242
    4343/* No alias support here (yet in the ming case). */
    44 extern int (strcmp)(const char *psz1, const char *psz2)
     44extern char * (strcpy)(char *psz1, const char *psz2)
    4545{
    46     return RT_NOCRT(strcmp)(psz1, psz2);
     46    return RT_NOCRT(strcpy)(psz1, psz2);
    4747}
    4848
    4949#elif __GNUC__ >= 4
    5050/* create a weak alias. */
    51 __asm__(".weak strcmp\t\n"
    52         " .set strcmp," RT_NOCRT_STR(strcmp) "\t\n");
     51__asm__(".weak strcpy\t\n"
     52        " .set strcpy," RT_NOCRT_STR(strcpy) "\t\n"
     53        ".global strcpy\t\n"
     54        );
    5355#else
    5456/* create a weak alias. */
    55 extern __typeof(RT_NOCRT(strcmp)) strcmp __attribute__((weak, alias(RT_NOCRT_STR(strcmp))));
     57extern __typeof(RT_NOCRT(strcpy)) strcpy __attribute__((weak, alias(RT_NOCRT_STR(strcpy))));
    5658#endif
    5759
  • trunk/src/VBox/Runtime/common/string/strlen.asm

    r9502 r14021  
    3535;;
    3636; @param    psz     gcc: rdi  msc: rcx  x86: [esp+4]
    37 BEGINPROC RT_NOCRT(strlen)
     37RT_NOCRT_BEGINPROC strlen
    3838        cld
    3939%ifdef RT_ARCH_AMD64
Note: See TracChangeset for help on using the changeset viewer.

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