VirtualBox

Changeset 1190 in vbox


Ignore:
Timestamp:
Mar 4, 2007 8:42:13 PM (18 years ago)
Author:
vboxsync
Message:

Ported IPRT to ring-0 OS/2.

Location:
trunk
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r1075 r1190  
    163163# build enhanced version of rdesktop
    164164VBOX_WITH_VRDP_RDESKTOP = 1
    165 ifeq ($(BUILD_TARGET),darwin)
     165ifeq ($(filter-out darwin os2,$(BUILD_TARGET)),)
    166166# build the support driver & library without IDT patching.
    167167## @todo invert this!
     
    11161116ifeq ($(VBOX_LDR_FMT),lx)
    11171117TEMPLATE_VBOXR0_TOOL                = GCC3OMF
     1118TEMPLATE_VBOXR0_CFLAGS              = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
    11181119TEMPLATE_VBOXR0_CXXFLAGS            = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
    1119 TEMPLATE_VBOXR0_CFLAGS              = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
    11201120TEMPLATE_VBOXR0_LDFLAGS             = -Zdll -nostdlib
    11211121TEMPLATE_VBOXR0_LIBS                = \
     
    11801180ifeq ($(BUILD_TARGET),os2)
    11811181TEMPLATE_VBOXR0DRV_TOOL                = GCC3OMF
    1182 TEMPLATE_VBOXR0DRV_CXXFLAGS            = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
     1182TEMPLATE_VBOXR0DRV_CXXFLAGS            = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-rtti -fno-exceptions
    11831183TEMPLATE_VBOXR0DRV_CFLAGS              = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
     1184TEMPLATE_VBOXR0DRV_LIBS                = $(VBOX_GCC_LIBGCC)
     1185# wlink thinks physdevice doesn't need fixups and should have a stack - stupid!
     1186TEMPLATE_VBOXR0DRV_LDFLAGS             = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs
    11841187endif
    11851188
  • trunk/include/iprt/asmdefs.mac

    r74 r1190  
    115115
    116116;;
    117 ; Ends a C callabke procedure.
     117; Ends a C callable procedure.
    118118%macro ENDPROC 1
    119119GLOBALNAME %1_EndProc
     
    122122
    123123
     124;
     125; Do OMF segment definitions
     126;
     127%ifdef ASM_FORMAT_OMF
     128
     129 ; 16-bit segments first (OMF / OS/2 specific).
     130 %ifdef RT_INCL_16BIT_SEGMENTS
     131  segment DATA16 public CLASS=FAR_DATA align=16 use16
     132  segment DATA16_INIT public CLASS=FAR_DATA align=16 use16
     133  group DGROUP16 DATA16 DATA16_INIT
     134
     135  ;;
     136  ; Begins 16-bit data
     137   %macro BEGINDATA16 0
     138    segment DATA16
     139   %endmacro
     140
     141  ;;
     142  ; Begins 16-bit init data
     143   %macro BEGINDATA16INIT 0
     144    segment DATA16_INIT
     145   %endmacro
     146
     147  segment CODE16 public CLASS=FAR_CODE align=16 use16
     148  segment CODE16_INIT public CLASS=FAR_CODE align=16 use16
     149  group CGROUP16 CODE16 CODE16_INIT
     150
     151  ;;
     152  ; Begins 16-bit code
     153   %macro BEGINCODE16 0
     154    segment CODE16
     155   %endmacro
     156
     157  ;;
     158  ; Begins 16-bit init code
     159   %macro BEGINCODE16INIT 0
     160    segment CODE16_INIT
     161   %endmacro
     162
     163 %endif
     164
     165 ; 32-bit segments.
     166 segment TEXT32 public CLASS=CODE align=16 use32 flat
     167 segment DATA32 public CLASS=DATA align=16 use32 flat
     168 segment BSS32  public CLASS=BSS  align=16 use32 flat
     169
     170 ; Make the TEXT32 segment default.
     171 segment TEXT32
     172%endif
     173
     174
    124175;;
    125176; Begins code
    126177%ifdef ASM_FORMAT_OMF
    127178 %macro BEGINCODE 0
    128   %ifndef _DONE_BEGINCODE
    129    %define _DONE_BEGINCODE 1
    130    segment TEXT32 public CLASS=CODE align=16 use32 flat
    131   %else
    132    segment TEXT32
    133   %endif
     179  segment TEXT32
    134180 %endmacro
    135181%else
     
    144190%ifdef ASM_FORMAT_OMF
    145191 %macro BEGINDATA 0
    146   %ifndef _DONE_BEGINDATA
    147    %define _DONE_BEGINDATA 1
    148    segment DATA32 public CLASS=DATA align=16 use32 flat
    149   %else
    150    segment DATA32
    151   %endif
     192  segment DATA32
    152193 %endmacro
    153194%else
     
    161202%ifdef ASM_FORMAT_OMF
    162203 %macro BEGINBSS 0
    163   %ifndef _DONE_BEGINBSS
    164    %define _DONE_BEGINBSS
    165    segment BSS32 public CLASS=BSS align=16 use32 flat
    166   %else
    167    segment BSS32
    168   %endif
     204  segment BSS32
    169205 %endmacro
    170206%else
     
    407443
    408444;; @def RTHCPTR_RES
    409 ; The pesudo-instruction used to declare (=reserve space for) an uninitialized 
     445; The pesudo-instruction used to declare (=reserve space for) an uninitialized
    410446; host physical address variable
    411447%define RTHCPHYS_RES    resq
     
    426462
    427463;; @def RTGCPTR_RES
    428 ; The pesudo-instruction used to declare (=reserve space for) an uninitialized 
     464; The pesudo-instruction used to declare (=reserve space for) an uninitialized
    429465; guest physical address variable
    430466%define RTGCPHYS_RES    resd
     
    516552
    517553;; @def xAX
    518 ; RAX or EAX depending on context. 
     554; RAX or EAX depending on context.
    519555
    520556;; @def xBX
    521 ; RBX or EBX depending on context. 
     557; RBX or EBX depending on context.
    522558
    523559;; @def xCX
    524 ; RCX or ECX depending on context. 
     560; RCX or ECX depending on context.
    525561
    526562;; @def xDX
    527 ; RDX or EDX depending on context. 
     563; RDX or EDX depending on context.
    528564
    529565;; @def xDI
    530 ; RDI or EDI depending on context. 
     566; RDI or EDI depending on context.
    531567
    532568;; @def xSI
    533 ; RSI or ESI depending on context. 
     569; RSI or ESI depending on context.
    534570
    535571%ifdef __AMD64__
  • trunk/src/VBox/Runtime/Makefile

    r1174 r1190  
    657657        misc/sanity-c.c \
    658658        assert.cpp \
    659         generic/RTAssertDoBreakpoint-generic.cpp \
    660659        log.cpp \
    661660        logcom.cpp \
     
    678677
    679678RuntimeR0Drv_SOURCES.linux = \
     679        generic/RTAssertDoBreakpoint-generic.cpp \
    680680        alloc/heapsimple.cpp \
    681681        r0drv/linux/alloc-r0drv-linux.c \
     
    688688
    689689RuntimeR0Drv_SOURCES.win = \
     690        generic/RTAssertDoBreakpoint-generic.cpp \
    690691        nt/RTErrConvertFromNtStatus.cpp \
    691692        r0drv/nt/alloc-r0drv-nt.cpp \
     
    702703
    703704RuntimeR0Drv_SOURCES.darwin = \
     705        generic/RTAssertDoBreakpoint-generic.cpp \
    704706        RTErrConvertFromErrno.cpp \
    705707        string/memchr.asm \
     
    718720        generic/timer-generic.cpp \
    719721
     722RuntimeR0Drv_DEFS.os2 += RT_WITHOUT_NOCRT_WRAPPERS
    720723RuntimeR0Drv_SOURCES.os2 = \
     724        string/memchr.asm \
     725        string/memcmp.asm \
     726        string/memcpy.asm \
     727        string/mempcpy.asm \
     728        string/memset.asm \
     729        string/strchr.asm \
     730        string/strcmp.asm \
     731        \
     732        string/strcpy.cpp \
     733        string/strlen.cpp \
     734        string/strncmp.cpp \
     735        \
    721736        os2/RTErrConvertFromOS2.cpp \
    722         os2/sys0.asm
     737        os2/sys0.asm \
     738        thread.cpp \
     739        r0drv/memobj-r0drv.cpp \
     740        r0drv/os2/alloc-r0drv-os2.cpp \
     741        r0drv/os2/assert-r0drv-os2.cpp \
     742        r0drv/os2/assertA-r0drv-os2.asm \
     743        r0drv/os2/initterm-r0drv-os2.cpp \
     744        r0drv/os2/memobj-r0drv-os2.cpp \
     745        r0drv/os2/os2imports.imp \
     746        r0drv/os2/process-r0drv-os2.cpp \
     747        r0drv/os2/semevent-r0drv-os2.cpp \
     748        r0drv/os2/semeventmulti-r0drv-os2.cpp \
     749        r0drv/os2/semfastmutex-r0drv-os2.cpp \
     750        r0drv/os2/spinlock-r0drv-os2.cpp \
     751        r0drv/os2/thread-r0drv-os2.cpp \
     752        r0drv/os2/thread2-r0drv-os2.cpp \
     753        r0drv/os2/time-r0drv-os2.cpp \
     754        r0drv/os2/timer-r0drv-os2.cpp \
     755        r0drv/os2/timerA-r0drv-os2.asm \
     756        r0drv/os2/RTAssertDoBreakpoint-r0drv-os2.asm \
     757        r0drv/os2/RTR0Os2DHQueryDOSVar.asm \
     758        r0drv/os2/RTR0Os2DHVMGlobalToProcess.asm \
     759        generic/RTLogWriteDebugger-generic.cpp
    723760
    724761## PORTME: Porters create and add their selection of platform specific Ring-0 Driver files here.
  • trunk/src/VBox/Runtime/assert.cpp

    r938 r1190  
    7373#elif defined(IN_RING0)
    7474
    75 
    76 #if 0 /* this code is totally unused */
    77 
    78 #include <VBox/sup.h>
    79 
    80 
    81 /**
    82  * The 1st part of an assert message.
    83  *
    84  * @param   pszExpr     Expression. Can be NULL.
    85  * @param   uLine       Location line number.
    86  * @param   pszFile     Location file name.
    87  * @param   pszFunction Location function name.
    88  * @remark  This API exists in HC Ring-3 and GC.
    89  */
    90 RTDECL(void)    AssertMsg1(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
    91 {
    92     SUPR0Printf("\n!!Assertion Failed!!\n"
    93                 "Expression: %s\n"
    94                 "Location  : %s(%d) %s\n",
    95                 pszExpr, pszFile, uLine, pszFunction);
    96 #if !defined(IN_RING3) && !defined(LOG_NO_COM)
    97     RTLogComPrintf("\n!!Assertion Failed!!\n"
    98                    "Expression: %s\n"
    99                    "Location  : %s(%d) %s\n",
    100                    pszExpr, pszFile, uLine, pszFunction);
    101 #endif
    102 }
    103 
    104 
    105 /**
    106  * The 2nd (optional) part of an assert message.
    107  *
    108  * @param   pszFormat   Printf like format string.
    109  * @param   ...         Arguments to that string.
    110  * @remark  This API exists in HC Ring-3 and GC.
    111  */
    112 #ifdef __GNUC__
    113 /* asm (".globl AssertMsg2; AssertMsg2: jmp *SUPR0Printf"); - DEADLY! */
    114 #else
    115 __declspec(naked) void AssertMsg2(const char *pszFormat, ...)
    116 {   /* forwarder. */
    117     __asm jmp dword ptr [SUPR0Printf];
    118 }
    119 #endif
    120 
    121 #endif /* dead code */
     75/* OS specific.  */
    12276
    12377#else /* !IN_RING0 */
  • trunk/src/VBox/Runtime/include/internal/memobj.h

    r392 r1190  
    101101    /** The memory address.
    102102     * What this really is varies with the type.
    103      * For PAGE, CONT, LOW, and MAP_R0 it's the ring-0 mapping.
    104      * For LOCK_USER and MAP_R3 it is the ring-3 mapping.
     103     * For PAGE, CONT, LOW, RES_VIRT, LOCK/R0 and MAP/R0 it's the ring-0 mapping.
     104     * For LOCK/R3 and MAP/R3 it is the ring-3 mapping.
    105105     * For PHYS this might actually be NULL if there isn't any mapping.
    106106     */
     
    360360
    361361PRTR0MEMOBJINTERNAL rtR0MemObjNew(size_t cbSelf, RTR0MEMOBJTYPE enmType, void *pv, size_t cb);
     362void rtR0MemObjDelete(PRTR0MEMOBJINTERNAL pMem);
    362363
    363364/** @} */
  • trunk/src/VBox/Runtime/os2/RTErrConvertFromOS2.cpp

    r1 r1190  
    160160
    161161        case ERROR_INTERRUPT:               return VERR_INTERRUPTED;
     162
     163        case ERROR_BUSY:                    return VERR_MEMORY_BUSY;
    162164        //case ERROR_NO_UNICODE_TRANSLATION:  return VERR_NO_TRANSLATION;
    163165    }
  • trunk/src/VBox/Runtime/r0drv/memobj-r0drv.cpp

    r393 r1190  
    7070
    7171/**
     72 * Deletes an incomplete memory object.
     73 *
     74 * This is for cleaning up after failures during object creation.
     75 *
     76 * @param   pMem    The incomplete memory object to delete.
     77 */
     78void rtR0MemObjDelete(PRTR0MEMOBJINTERNAL pMem)
     79{
     80    if (pMem)
     81    {
     82        pMem->u32Magic++;
     83        pMem->enmType = RTR0MEMOBJTYPE_END;
     84        RTMemFree(pMem);
     85    }
     86}
     87
     88
     89/**
    7290 * Links a mapping object to a primary object.
    7391 *
     
    117135    AssertPtrReturn(MemObj, false);
    118136    PRTR0MEMOBJINTERNAL pMem = (PRTR0MEMOBJINTERNAL)MemObj;
    119     AssertReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, false);
    120     AssertReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, false);
     137    AssertMsgReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, ("%p: %#x\n", pMem, pMem->u32Magic), false);
     138    AssertMsgReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, ("%p: %d\n", pMem, pMem->enmType), false);
    121139
    122140    /* hand it on to the inlined worker. */
     
    137155    AssertPtrReturn(MemObj, 0);
    138156    PRTR0MEMOBJINTERNAL pMem = (PRTR0MEMOBJINTERNAL)MemObj;
    139     AssertReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, 0);
    140     AssertReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, 0);
     157    AssertMsgReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, ("%p: %#x\n", pMem, pMem->u32Magic), 0);
     158    AssertMsgReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, ("%p: %d\n", pMem, pMem->enmType), 0);
    141159
    142160    /* return the mapping address. */
     
    157175    AssertPtrReturn(MemObj, 0);
    158176    PRTR0MEMOBJINTERNAL pMem = (PRTR0MEMOBJINTERNAL)MemObj;
    159     AssertReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, 0);
    160     AssertReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, 0);
     177    AssertMsgReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, ("%p: %#x\n", pMem, pMem->u32Magic), 0);
     178    AssertMsgReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, ("%p: %d\n", pMem, pMem->enmType), 0);
    161179
    162180    /* return the size. */
     
    182200    AssertReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, NIL_RTHCPHYS);
    183201    AssertReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, NIL_RTHCPHYS);
     202    AssertMsgReturn(pMem->u32Magic == RTR0MEMOBJ_MAGIC, ("%p: %#x\n", pMem, pMem->u32Magic), NIL_RTHCPHYS);
     203    AssertMsgReturn(pMem->enmType > RTR0MEMOBJTYPE_INVALID && pMem->enmType < RTR0MEMOBJTYPE_END, ("%p: %d\n", pMem, pMem->enmType), NIL_RTHCPHYS);
    184204    const unsigned cPages = (pMem->cb >> PAGE_SHIFT);
    185205    if (iPage >= cPages)
  • trunk/src/VBox/Runtime/r3/alloc.cpp

    r1 r1190  
    128128    void *pv = calloc(1, cb);
    129129    AssertMsg(pv, ("calloc(1,%d) failed!!!\n", cb));
     130#ifdef __OS2__ /* temporary workaround until libc062. */
     131    AssertMsg(   cb < 32
     132              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
     133#else
    130134    AssertMsg(   cb < RTMEM_ALIGNMENT
    131135              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
     136#endif
    132137#endif /* !RTALLOC_USE_EFENCE */
    133138    return pv;
     
    152157    void *pv = realloc(pvOld, cbNew);
    153158    AssertMsg(pv && cbNew, ("realloc(%p, %d) failed!!!\n", pvOld, cbNew));
     159#ifdef __OS2__ /* temporary workaround until libc062. */
     160    AssertMsg(   cbNew < 32
     161              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
     162#else
    154163    AssertMsg(   cbNew < RTMEM_ALIGNMENT
    155164              || !((uintptr_t)pv & (RTMEM_ALIGNMENT - 1)), ("pv=%p RTMEM_ALIGNMENT=%#x\n", pv, RTMEM_ALIGNMENT));
     165#endif
    156166#endif  /* !RTALLOC_USE_EFENCE */
    157167    return pv;
  • trunk/src/VBox/Runtime/r3/os2/thread-os2.cpp

    r248 r1190  
    3333#include <stdlib.h>
    3434#include <signal.h>
     35#include <InnoTekLIBC/FastInfoBlocks.h>
    3536
    3637#include <iprt/thread.h>
     
    109110    *g_ppCurThread = pThread;
    110111
     112#ifdef fibGetTidPid
     113    rtThreadMain(pThread, fibGetTidPid());
     114#else
    111115    rtThreadMain(pThread, _gettid());
     116#endif
    112117
    113118    *g_ppCurThread = NULL;
     
    150155RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void)
    151156{
    152     PRTTHREADINT pThread = *g_ppCurThread;
    153     if (pThread)
    154         return (RTNATIVETHREAD)pThread->Core.Key;
     157#ifdef fibGetTidPid
     158    return fibGetTidPid();
     159#else
    155160    return _gettid();
     161#endif
    156162}
    157163
  • trunk/src/VBox/Runtime/testcase/Makefile

    r915 r1190  
    6868        tstLdrObj \
    6969        tstLdrObjR0
     70ifeq ($(filter-out lx pe,$(VBOX_LDR_FMT)), )
     71LIBRARIES += \
     72        tstLdr-4Imp
     73endif
     74       
    7075# tstSems
    7176endif # VBOX_WITH_TESTCASES
     
    159164        $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB)
    160165
     166tstLdr-4Imp_TEMPLATE = VBOXR0
     167ifeq ($(VBOX_LDR_FMT),lx)
     168 tstLdr-4Imp_SOURCES = tstLdr-4Imp-os2.def
     169else ifeq ($(VBOX_LDR_FMT),pe)
     170 tstLdr-4Imp_SOURCES.win = tstLdr-4Imp-win.def
     171endif
     172
    161173tstLdrObjR0_TEMPLATE = VBOXR0
    162174tstLdrObjR0_INST     = $(INST_TESTCASE)
     
    173185 tstLdrObjR0_LDFLAGS = -Entry:Entrypoint
    174186 tstLdrObjR0_LIBS   += \
    175         $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB)
     187        $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) \
     188        $(TARGET_tstLdr-4Imp)
    176189endif
    177190ifeq ($(VBOX_LDR_FMT),elf)
     
    180193ifeq ($(VBOX_LDR_FMT),lx)
    181194 tstLdrObjR0_LIBS   += \
    182         $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB)
     195        $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) \
     196        $(TARGET_tstLdr-4Imp)
    183197endif
    184198
  • trunk/src/VBox/Runtime/testcase/tstLdr-4.cpp

    r917 r1190  
    158158            if (RT_FAILURE(rc))
    159159            {
    160                 RTPrintf("tstLdr-4: Failed to get symbol \"Test1\" from load #%d: %Rrc\n", i, rc);
     160                RTPrintf("tstLdr-4: Failed to get symbol \"DisasmTest1\" from load #%d: %Rrc\n", i, rc);
    161161                cErrors++;
    162162                break;
  • trunk/src/VBox/Runtime/testcase/tstLdrDisasmTest.cpp

    r919 r1190  
    3434#include <iprt/string.h>
    3535
    36 #if defined(IN_RING0) && !defined(__WIN__) && !defined(__OS2__) /* Too lazy to make import libs. */
     36#if defined(IN_RING0) && !defined(__WIN__) /* Too lazy to make import libs. */
    3737extern "C" DECLIMPORT(int) MyPrintf(const char *pszFormat, ...);
    3838# define MY_PRINTF(a) MyPrintf a
  • trunk/src/VBox/Runtime/thread.cpp

    r403 r1190  
    240240    if (pThread)
    241241    {
     242        RTNATIVETHREAD NativeThread = RTThreadNativeSelf();
    242243        rc = rtThreadNativeAdopt(pThread);
    243244        if (RT_SUCCESS(rc))
    244245        {
    245             rtThreadInsert(pThread, RTThreadNativeSelf());
     246            rtThreadInsert(pThread, NativeThread);
    246247            pThread->enmState = RTTHREADSTATE_RUNNING;
    247248        }
     
    717718 * @returns NULL on failure.
    718719 */
    719 RTR3DECL(const char *) RTThreadSelfName(void)
     720RTDECL(const char *) RTThreadSelfName(void)
    720721{
    721722    RTTHREAD Thread = RTThreadSelf();
     
    737738 * @param   Thread      Thread handle of the thread to query the name of.
    738739 */
    739 RTR3DECL(const char *) RTThreadGetName(RTTHREAD Thread)
     740RTDECL(const char *) RTThreadGetName(RTTHREAD Thread)
    740741{
    741742    if (Thread == NIL_RTTHREAD)
     
    753754 * @param   pszName     The thread name.
    754755 */
    755 RTR3DECL(int) RTThreadSetName(RTTHREAD Thread, const char *pszName)
     756RTDECL(int) RTThreadSetName(RTTHREAD Thread, const char *pszName)
    756757{
    757758    /*
     
    782783 * @returns     iprt status code.
    783784 */
    784 RTR3DECL(int) RTThreadUserSignal(RTTHREAD Thread)
     785RTDECL(int) RTThreadUserSignal(RTTHREAD Thread)
    785786{
    786787    int             rc;
     
    805806 *                              an indefinite wait.
    806807 */
    807 RTR3DECL(int) RTThreadUserWait(RTTHREAD Thread, unsigned cMillies)
     808RTDECL(int) RTThreadUserWait(RTTHREAD Thread, unsigned cMillies)
    808809{
    809810    int             rc;
     
    828829 *                              an indefinite wait.
    829830 */
    830 RTR3DECL(int) RTThreadUserWaitNoResume(RTTHREAD Thread, unsigned cMillies)
     831RTDECL(int) RTThreadUserWaitNoResume(RTTHREAD Thread, unsigned cMillies)
    831832{
    832833    int             rc;
     
    849850 * @param       Thread          The thread to reset.
    850851 */
    851 RTR3DECL(int) RTThreadUserReset(RTTHREAD Thread)
     852RTDECL(int) RTThreadUserReset(RTTHREAD Thread)
    852853{
    853854    int     rc;
     
    941942 * @param       prc             Where to store the return code of the thread. Optional.
    942943 */
    943 RTR3DECL(int) RTThreadWaitNoResume(RTTHREAD Thread, unsigned cMillies, int *prc)
     944RTDECL(int) RTThreadWaitNoResume(RTTHREAD Thread, unsigned cMillies, int *prc)
    944945{
    945946    return rtThreadWait(Thread, cMillies, prc, false);
     
    954955 * @param   enmType     The new thread type.
    955956 */
    956 RTR3DECL(int) RTThreadSetType(RTTHREAD Thread, RTTHREADTYPE enmType)
     957RTDECL(int) RTThreadSetType(RTTHREAD Thread, RTTHREADTYPE enmType)
    957958{
    958959    /*
     
    10031004 * @param   Thread      The thread in question.
    10041005 */
    1005 RTR3DECL(RTTHREADTYPE) RTThreadGetType(RTTHREAD Thread)
     1006RTDECL(RTTHREADTYPE) RTThreadGetType(RTTHREAD Thread)
    10061007{
    10071008    RTTHREADTYPE enmType = RTTHREADTYPE_INVALID;
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