VirtualBox

Changeset 75879 in vbox for trunk


Ignore:
Timestamp:
Dec 2, 2018 6:39:16 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
127083
Message:

Runtime: Introduce RTShMem* API for accessing shared memory objects with implementations for POSIX (via shm_*) and Windows (via CreateFileMapping)

Location:
trunk
Files:
4 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/err.h

    r75790 r75879  
    33953395/** @} */
    33963396
     3397
     3398/** @name RTShMem status codes
     3399 * @{ */
     3400/** Maximum number of mappings reached. */
     3401#define VERR_SHMEM_MAXIMUM_MAPPINGS_REACHED                     (-26000)
     3402/** @} */
     3403
    33973404/* SED-END */
    33983405
  • trunk/include/iprt/mangling.h

    r75652 r75879  
    19421942# define RTSha512t256ToString                           RT_MANGLER(RTSha512t256ToString)
    19431943# define RTSha512t256Update                             RT_MANGLER(RTSha512t256Update)
     1944# define RTShMemClose                                   RT_MANGLER(RTShMemClose)
     1945# define RTShMemMapRegion                               RT_MANGLER(RTShMemMapRegion)
     1946# define RTShMemOpen                                    RT_MANGLER(RTShMemOpen)
     1947# define RTShMemQuerySize                               RT_MANGLER(RTShMemQuerySize)
     1948# define RTShMemRefCount                                RT_MANGLER(RTShMemRefCount)
     1949# define RTShMemSetSize                                 RT_MANGLER(RTShMemSetSize)
     1950# define RTShMemUnmapRegion                             RT_MANGLER(RTShMemUnmapRegion)
    19441951# define RTSocketClose                                  RT_MANGLER(RTSocketClose)
    19451952# define RTSocketFromNative                             RT_MANGLER(RTSocketFromNative)
  • trunk/include/iprt/types.h

    r74672 r75879  
    25282528#define NIL_RTKRNLMODINFO                          ((RTKRNLMODINFO)~(uintptr_t)0);
    25292529
     2530/** Shared memory object handle. */
     2531typedef struct RTSHMEMINT                   RT_FAR *RTSHMEM;
     2532/** Pointer to a shared memory object handle. */
     2533typedef RTSHMEM                             RT_FAR *PRTSHMEM;
     2534/** A NIL shared memory object handle. */
     2535#define NIL_RTSHMEM                                ((RTSHMEM)~(uintptr_t)0)
     2536
    25302537/**
    25312538 * Handle type.
  • trunk/src/VBox/Runtime/Makefile.kmk

    r75315 r75879  
    877877        r3/win/semmutex-win.cpp \
    878878        r3/win/serialport-win.cpp \
     879        r3/win/shmem-win.cpp \
    879880        r3/win/symlink-win.cpp \
    880881        r3/win/thread-win.cpp \
     
    965966        r3/posix/semrw-posix.cpp \
    966967        r3/posix/serialport-posix.cpp \
     968        r3/posix/shmem-posix.cpp \
    967969        r3/posix/symlink-posix.cpp \
    968970        r3/posix/thread-posix.cpp \
     
    11481150        r3/posix/serialport-posix.cpp \
    11491151        r3/posix/symlink-posix.cpp \
     1152        r3/posix/shmem-posix.cpp \
    11501153        r3/posix/thread-posix.cpp \
    11511154        r3/posix/thread2-posix.cpp \
     
    12291232        r3/posix/serialport-posix.cpp \
    12301233        r3/posix/symlink-posix.cpp \
     1234        r3/posix/shmem-posix.cpp \
    12311235        r3/posix/thread-posix.cpp \
    12321236        r3/posix/thread2-posix.cpp \
     
    13051309        r3/posix/serialport-posix.cpp \
    13061310        r3/posix/symlink-posix.cpp \
     1311        r3/posix/shmem-posix.cpp \
    13071312        r3/posix/thread-posix.cpp \
    13081313        r3/posix/thread2-posix.cpp \
     
    13741379        r3/posix/serialport-posix.cpp \
    13751380        r3/posix/symlink-posix.cpp \
     1381        r3/posix/shmem-posix.cpp \
    13761382        r3/posix/thread-posix.cpp \
    13771383        r3/posix/thread2-posix.cpp \
  • trunk/src/VBox/Runtime/VBox/VBoxRTImp.def

    r74672 r75879  
    16621662    RTSha512ToString
    16631663    RTSha512Update
     1664    RTShMemClose
     1665    RTShMemMapRegion
     1666    RTShMemOpen
     1667    RTShMemQuerySize
     1668    RTShMemRefCount
     1669    RTShMemSetSize
     1670    RTShMemUnmapRegion
    16641671    RTSocketClose
    16651672    RTSocketFromNative
  • trunk/src/VBox/Runtime/include/internal/magics.h

    r74313 r75879  
    191191/** RTSERIALPORTINTERNAL::u32Magic value after RTSerialPortClose. */
    192192#define RTSERIALPORT_MAGIC_DEAD         UINT32_C(0x19050324)
     193/** RTSHMEMINT::u32Magic value (Stephen William Hawking) */
     194#define RTSHMEM_MAGIC                   UINT32_C(0x19420108)
     195/** RTSHMEMINT::u32Magic value after RTShMemClose */
     196#define RTSHMEM_MAGIC_DEAD              UINT32_C(0x20180314)
    193197/** The magic value for RTSOCKETINT::u32Magic. (Stanislaw Lem) */
    194198#define RTSOCKET_MAGIC                  UINT32_C(0x19210912)
  • trunk/src/VBox/Runtime/testcase/Makefile.kmk

    r74169 r75879  
    151151        tstRTVfs \
    152152        tstRTZip \
    153         tstRTJson
     153        tstRTJson \
     154        tstRTShMem
    154155
    155156PROGRAMS.win += \
     
    731732tstRTJson_SOURCES = tstRTJson.cpp
    732733
     734tstRTShMem_TEMPLATE = VBOXR3TSTEXE
     735tstRTShMem_SOURCES = tstRTShMem.cpp
     736
    733737#
    734738# Ring-0 testcases.
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