VirtualBox

Changeset 71916 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Apr 19, 2018 10:05:28 AM (7 years ago)
Author:
vboxsync
Message:

More fixes for SPARC: No ASM for openssl crypto, add simple memrchr() implementation for VBoxRT, cleanup IN_SUP_R3 usage and only enable for x86 and amd64

Location:
trunk/src/VBox/Runtime/common
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/asm/asm-fake.cpp

    r71522 r71916  
    55
    66/*
    7  * Copyright (C) 2010-2017 Oracle Corporation
     7 * Copyright (C) 2010-2018 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    139139}
    140140
     141RTDECL(uint32_t) ASMAtomicUoIncU32(uint32_t volatile *pu32)
     142{
     143    return *pu32 += 1;
     144}
     145
    141146RTDECL(uint32_t) ASMAtomicDecU32(uint32_t volatile *pu32)
    142147{
     
    144149}
    145150
     151RTDECL(uint32_t) ASMAtomicUoDecU32(uint32_t volatile *pu32)
     152{
     153    return *pu32 -= 1;
     154}
     155
    146156RTDECL(uint64_t) ASMAtomicIncU64(uint64_t volatile *pu64)
    147157{
     
    159169}
    160170
     171RTDECL(void) ASMAtomicUoOrU32(uint32_t volatile *pu32, uint32_t u32)
     172{
     173    *pu32 |= u32;
     174}
     175
    161176RTDECL(void) ASMAtomicAndU32(uint32_t volatile *pu32, uint32_t u32)
     177{
     178    *pu32 &= u32;
     179}
     180
     181RTDECL(void) ASMAtomicUoAndU32(uint32_t volatile *pu32, uint32_t u32)
    162182{
    163183    *pu32 &= u32;
     
    455475    uint32_t iBit;
    456476    for (iBit = 0; iBit < 64; iBit++)
     477        if (u32 & RT_BIT_64(iBit))
     478            return iBit + 1;
     479    return 0;
     480}
     481
     482RTDECL(unsigned) ASMBitLastSetU64(uint64_t u64)
     483{
     484    int32_t iBit = 64;
     485    while (iBit-- > 0)
    457486        if (u64 & RT_BIT_64(iBit))
    458487            return iBit + 1;
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