VirtualBox

儲存庫 vbox 的更動 40304


忽略:
時間撮記:
2012-2-29 下午08:02:14 (13 年 以前)
作者:
vboxsync
訊息:

IPRT: fixed OS/2 'bitrot'.

位置:
trunk/src/VBox/Runtime
檔案:
新增 1 筆資料
修改 10 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/Makefile.kmk

    r40052 r40304  
    617617        r3/posix/RTPathUserHome-posix.cpp \
    618618        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    619         r3/posix/RTSystemQueryTotalRam-posix.cpp \
     619        r3/posix/RTSystemQueryTotalRam-posix.cpp \
    620620        r3/posix/RTTimeNow-posix.cpp \
    621621        r3/posix/RTTimeSet-posix.cpp \
     
    715715        r3/posix/RTTimeNow-posix.cpp \
    716716        r3/posix/RTTimeSet-posix.cpp \
    717         r3/posix/rtmempage-exec-mmap-heap-posix.cpp \
    718717        r3/posix/dir-posix.cpp \
    719718        r3/posix/env-posix.cpp \
     
    734733        r3/posix/timelocal-posix.cpp \
    735734        r3/posix/utf8-posix.cpp
     735## @todo r3/posix/rtmempage-exec-mmap-heap-posix.cpp
    736736
    737737RuntimeR3_SOURCES.darwin = \
     
    775775        r3/posix/RTPathUserHome-posix.cpp \
    776776        r3/posix/RTSystemQueryOSInfo-posix.cpp \
    777         r3/posix/RTSystemQueryTotalRam-posix.cpp \
     777        r3/posix/RTSystemQueryTotalRam-posix.cpp \
    778778        r3/posix/RTTimeSet-posix.cpp \
    779779        r3/posix/dir-posix.cpp \
     
    18221822        generic/mppresent-generic.cpp \
    18231823        os2/RTErrConvertFromOS2.cpp \
     1824        os2/rtSemWaitOs2ConvertTimeout.cpp \
    18241825        os2/sys0.asm \
    18251826        r0drv/generic/RTMpIsCpuWorkPending-r0drv-generic.cpp \
     
    19351936#
    19361937RuntimeGuestR0_TEMPLATE  := VBOXGUESTR0LIB
     1938RuntimeGuestR0_EXTENDS    = RuntimeR0Drv
    19371939RuntimeGuestR0_SOURCES   := $(filter-out generic/RTLogWriteUser-generic.cpp, $(RuntimeR0Drv_SOURCES))
    19381940RuntimeGuestR0_SOURCES   += \
    19391941        VBox/logbackdoor.cpp
    1940 RuntimeGuestR0_EXTENDS    = RuntimeR0Drv
    19411942
    19421943
  • trunk/src/VBox/Runtime/include/internal/iprt.h

    r35662 r40304  
    192192#endif
    193193
    194 #endif
    195 
     194
     195RT_C_DECLS_BEGIN
     196
     197#ifdef RT_OS_OS2
     198uint32_t rtR0SemWaitOs2ConvertTimeout(uint32_t fFlags, uint64_t uTimeout);
     199#endif
     200
     201RT_C_DECLS_END
     202
     203#endif
     204
  • trunk/src/VBox/Runtime/r0drv/os2/memuserkernel-r0drv-os2.cpp

    r28800 r40304  
    4646RTR0DECL(int) RTR0MemUserCopyTo(RTR3PTR R3PtrDst, void const *pvSrc, size_t cb)
    4747{
    48     int rc = KernCopyOut((void *)R3PtrDst, pvSrc, cb);
     48    int rc = KernCopyOut((void *)R3PtrDst, (void *)pvSrc, cb);
    4949    if (RT_LIKELY(rc == 0))
    5050        return VINF_SUCCESS;
  • trunk/src/VBox/Runtime/r0drv/os2/semevent-r0drv-os2.cpp

    r33269 r40304  
    3434*******************************************************************************/
    3535#include "the-os2-kernel.h"
     36#include "internal/iprt.h"
    3637
    3738#include <iprt/semaphore.h>
    38 #include <iprt/alloc.h>
    3939#include <iprt/asm.h>
    4040#include <iprt/assert.h>
    4141#include <iprt/err.h>
     42#include <iprt/mem.h>
     43#include <iprt/lockvalidator.h>
    4244
    4345#include "internal/magics.h"
     
    155157
    156158
    157 static int rtSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies, bool fInterruptible)
    158 {
    159     PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
     159/**
     160 * Worker for RTSemEventWaitEx and RTSemEventWaitExDebug.
     161 *
     162 * @returns VBox status code.
     163 * @param   pThis           The event semaphore.
     164 * @param   fFlags          See RTSemEventWaitEx.
     165 * @param   uTimeout        See RTSemEventWaitEx.
     166 * @param   pSrcPos         The source code position of the wait.
     167 */
     168static int rtR0SemEventOs2Wait(PRTSEMEVENTINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout,
     169                               PCRTLOCKVALSRCPOS pSrcPos)
     170{
     171    /*
     172     * Validate and convert input.
     173     */
     174    if (!pThis)
     175        return VERR_INVALID_HANDLE;
    160176    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    161177    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
    162 
     178    AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER);
     179
     180    ULONG cMsTimeout = rtR0SemWaitOs2ConvertTimeout(fFlags, uTimeout);
     181    ULONG fBlock     = BLOCK_SPINLOCK;
     182    if (!(fFlags & RTSEMWAIT_FLAGS_INTERRUPTIBLE))
     183        fBlock |= BLOCK_UNINTERRUPTABLE;
     184       
     185    /*
     186     * Do the job.
     187     */
    163188    KernAcquireSpinLock(&pThis->Spinlock);
    164189
     
    175200
    176201        ULONG ulData = (ULONG)VERR_INTERNAL_ERROR;
    177         rc = KernBlock((ULONG)pThis,
    178                        cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies,
    179                        BLOCK_SPINLOCK | (!fInterruptible ? BLOCK_UNINTERRUPTABLE : 0),
     202        rc = KernBlock((ULONG)pThis, cMsTimeout, fBlock,
    180203                       &pThis->Spinlock,
    181204                       &ulData);
     
    199222
    200223            case ERROR_TIMEOUT:
    201                 Assert(cMillies != RT_INDEFINITE_WAIT);
     224                Assert(cMsTimeout != SEM_INDEFINITE_WAIT);
    202225                ASMAtomicDecU32(&pThis->cWaiters);
    203226                rc = VERR_TIMEOUT;
     
    205228
    206229            case ERROR_INTERRUPT:
    207                 Assert(fInterruptible);
     230                Assert(fFlags & RTSEMWAIT_FLAGS_INTERRUPTIBLE);
    208231                ASMAtomicDecU32(&pThis->cWaiters);
    209232                rc = VERR_INTERRUPTED;
     
    222245
    223246
    224 RTDECL(int)  RTSemEventWait(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    225 {
    226     return rtSemEventWait(hEventSem, cMillies, false /* not interruptible */);
    227 }
    228 
    229 
    230 RTDECL(int)  RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
    231 {
    232     return rtSemEventWait(hEventSem, cMillies, true /* interruptible */);
     247RTDECL(int)  RTSemEventWaitEx(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout)
     248{
     249#ifndef RTSEMEVENT_STRICT
     250    return rtR0SemEventOs2Wait(hEventSem, fFlags, uTimeout, NULL);
     251#else
     252    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
     253    return rtR0SemEventOs2Wait(hEventSem, fFlags, uTimeout, &SrcPos);
     254#endif
     255}
     256
     257
     258RTDECL(int)  RTSemEventWaitExDebug(RTSEMEVENT hEventSem, uint32_t fFlags, uint64_t uTimeout,
     259                                   RTHCUINTPTR uId, RT_SRC_POS_DECL)
     260{
     261    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
     262    return rtR0SemEventOs2Wait(hEventSem, fFlags, uTimeout, &SrcPos);
    233263}
    234264
  • trunk/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp

    r33155 r40304  
    3434*******************************************************************************/
    3535#include "the-os2-kernel.h"
     36#include "internal/iprt.h"
    3637
    3738#include <iprt/semaphore.h>
    38 #include <iprt/alloc.h>
    3939#include <iprt/asm.h>
    4040#include <iprt/assert.h>
    4141#include <iprt/err.h>
     42#include <iprt/lockvalidator.h>
     43#include <iprt/mem.h>
    4244#include "internal/magics.h"
    4345
     
    164166
    165167
    166 static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, bool fInterruptible)
    167 {
    168     PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     168/**
     169 * Worker for RTSemEventWaitEx and RTSemEventWaitExDebug.
     170 *
     171 * @returns VBox status code.
     172 * @param   pThis           The event semaphore.
     173 * @param   fFlags          See RTSemEventWaitEx.
     174 * @param   uTimeout        See RTSemEventWaitEx.
     175 * @param   pSrcPos         The source code position of the wait.
     176 */
     177static int rtR0SemEventMultiOs2Wait(PRTSEMEVENTMULTIINTERNAL pThis, uint32_t fFlags, uint64_t uTimeout,
     178                                    PCRTLOCKVALSRCPOS pSrcPos)
     179{
     180    /*
     181     * Validate and convert the input.
     182     */
     183    if (!pThis)
     184        return VERR_INVALID_HANDLE;
    169185    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    170186    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
    171187                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
    172188                    VERR_INVALID_HANDLE);
    173 
     189    AssertReturn(RTSEMWAIT_FLAGS_ARE_VALID(fFlags), VERR_INVALID_PARAMETER);
     190
     191    ULONG cMsTimeout = rtR0SemWaitOs2ConvertTimeout(fFlags, uTimeout);
     192    ULONG fBlock     = BLOCK_SPINLOCK;
     193    if (!(fFlags & RTSEMWAIT_FLAGS_INTERRUPTIBLE))
     194        fBlock |= BLOCK_UNINTERRUPTABLE;
     195       
     196    /*
     197     * Do the job.
     198     */
    174199    KernAcquireSpinLock(&pThis->Spinlock);
    175200
     
    182207
    183208        ULONG ulData = (ULONG)VERR_INTERNAL_ERROR;
    184         rc = KernBlock((ULONG)pThis,
    185                        cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies,
    186                        BLOCK_SPINLOCK | (!fInterruptible ? BLOCK_UNINTERRUPTABLE : 0),
     209        rc = KernBlock((ULONG)pThis, cMsTimeout, fBlock,
    187210                       &pThis->Spinlock,
    188211                       &ulData);
     
    207230
    208231            case ERROR_TIMEOUT:
    209                 Assert(cMillies != RT_INDEFINITE_WAIT);
     232                Assert(cMsTimeout != SEM_INDEFINITE_WAIT);
    210233                ASMAtomicDecU32(&pThis->cWaiters);
    211234                rc = VERR_TIMEOUT;
     
    213236
    214237            case ERROR_INTERRUPT:
    215                 Assert(fInterruptible);
     238                Assert(fFlags & RTSEMWAIT_FLAGS_INTERRUPTIBLE);
    216239                ASMAtomicDecU32(&pThis->cWaiters);
    217240                rc = VERR_INTERRUPTED;
     
    230253
    231254
    232 RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    233 {
    234     return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
    235 }
    236 
    237 
    238 RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
    239 {
    240     return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
     255RTDECL(int)  RTSemEventMultiWaitEx(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout)
     256{
     257#ifndef RTSEMEVENT_STRICT
     258    return rtR0SemEventMultiOs2Wait(hEventMultiSem, fFlags, uTimeout, NULL);
     259#else
     260    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
     261    return rtR0SemEventMultiOs2Wait(hEventMultiSem, fFlags, uTimeout, &SrcPos);
     262#endif
     263}
     264
     265
     266RTDECL(int)  RTSemEventMultiWaitExDebug(RTSEMEVENTMULTI hEventMultiSem, uint32_t fFlags, uint64_t uTimeout,
     267                                        RTHCUINTPTR uId, RT_SRC_POS_DECL)
     268{
     269    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
     270    return rtR0SemEventMultiOs2Wait(hEventMultiSem, fFlags, uTimeout, &SrcPos);
    241271}
    242272
  • trunk/src/VBox/Runtime/r3/init.cpp

    r39753 r40304  
    4646#ifdef RT_OS_OS2
    4747# include <InnoTekLIBC/fork.h>
     48# define INCL_DOSMISC
     49# include <os2.h>
    4850#endif
    4951#include <locale.h>
     
    334336    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX | fOldErrMode);
    335337#elif defined(RT_OS_OS2)
    336 # error "FIXME"
     338    DosError(FERR_DISABLEHARDERR);
    337339#endif
    338340
  • trunk/src/VBox/Runtime/r3/os2/filelock-os2.cpp

    r33540 r40304  
    8383
    8484    Assert(RTFILE_LOCK_WAIT);
    85     if (fcntl(File, (fLock & RTFILE_LOCK_WAIT) ? F_SETLKW : F_SETLK, &fl) >= 0)
     85    if (fcntl(RTFileToNative(File), (fLock & RTFILE_LOCK_WAIT) ? F_SETLKW : F_SETLK, &fl) >= 0)
    8686        return VINF_SUCCESS;
    8787
     
    163163    fl.l_pid    = 0;
    164164
    165     if (fcntl(File, F_SETLK, &fl) >= 0)
     165    if (fcntl(RTFileToNative(File), F_SETLK, &fl) >= 0)
    166166        return VINF_SUCCESS;
    167167
  • trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp

    r33393 r40304  
    5252RTDECL(int)  RTSemEventCreateEx(PRTSEMEVENT phEventSem, uint32_t fFlags, RTLOCKVALCLASS hClass, const char *pszNameFmt, ...)
    5353{
    54     AssertReturn(!(fFlags & ~(RTSEMEVENT_FLAGS_NO_LOCK_VAL | RTSEMEVENT_FLAGS_BOOTSTRAP_HACK), VERR_INVALID_PARAMETER);
     54    AssertReturn(!(fFlags & ~(RTSEMEVENT_FLAGS_NO_LOCK_VAL | RTSEMEVENT_FLAGS_BOOTSTRAP_HACK)), VERR_INVALID_PARAMETER);
    5555    Assert(!(fFlags & RTSEMEVENT_FLAGS_BOOTSTRAP_HACK) || (fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL));
    5656
  • trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp

    r39443 r40304  
    4646#include <iprt/alloc.h>
    4747#include <iprt/asm-amd64-x86.h>
     48#include <iprt/cpuset.h>
    4849#include <iprt/string.h>
    4950#include <iprt/err.h>
     
    208209RTR3DECL(int) RTThreadGetAffinity(PRTCPUSET pCpuSet)
    209210{
    210     return VINF_SUCCESS;
    211 }
    212 
    213 RTR3DECL(int) RTThreadGetAffinity(PRTCPUSET pCpuSet)
    214 {
    215211    union
    216212    {
  • trunk/src/VBox/Runtime/r3/stream.cpp

    r39395 r40304  
    5353#include <stdio.h>
    5454#include <errno.h>
    55 #ifdef RT_OS_WINDOWS
     55#if defined(RT_OS_WINDOWS) || defined(RT_OS_OS2)
    5656# include <io.h>
    5757# include <fcntl.h>
     58#endif
     59#ifdef RT_OS_WINDOWS
    5860# include <Windows.h>
     61#endif
     62
     63#ifdef RT_OS_OS2
     64# define _O_TEXT   O_TEXT
     65# define _O_BINARY O_BINARY
    5966#endif
    6067
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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