84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync/* $Id$ */
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync/** @file
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * VirtualBox Support Library - Semaphores, ring-3 implementation.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync */
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2009-2011 Oracle Corporation
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync *
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * available from http://www.virtualbox.org. This file is free software;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * you can redistribute it and/or modify it under the terms of the GNU
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * General Public License (GPL) as published by the Free Software
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync *
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * The contents of this file may alternatively be used under the terms
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * of the Common Development and Distribution License Version 1.0
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * VirtualBox OSE distribution, in which case the provisions of the
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * CDDL are applicable instead of those of the GPL.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync *
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * You may elect to license modified versions of this file under the
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * terms and conditions of either the GPL or the CDDL or both.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync */
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync/*******************************************************************************
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync* Header Files *
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync*******************************************************************************/
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#define LOG_GROUP LOG_GROUP_SUP
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#include <VBox/sup.h>
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#include <VBox/err.h>
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#include <VBox/param.h>
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#include <iprt/assert.h>
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#include "SUPLibInternal.h"
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync#include "SUPDrvIOC.h"
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync/**
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * Worker that makes a SUP_IOCTL_SEM_OP2 request.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync *
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * @returns VBox status code.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * @param pSession The session handle.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * @param uType The semaphore type.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * @param hSem The semaphore handle.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync * @param uOp The operation.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @param u64Arg The argument if applicable, otherwise 0.
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync */
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncDECLINLINE(int) supSemOp2(PSUPDRVSESSION pSession, uint32_t uType, uintptr_t hSem, uint32_t uOp, uint64_t u64Arg)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
f7f5cd7b1e530eb5636da51c974b48ae0c1775b3vboxsync NOREF(pSession);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync SUPSEMOP2 Req;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.Hdr.u32Cookie = g_u32Cookie;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.Hdr.u32SessionCookie = g_u32SessionCookie;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync Req.Hdr.cbIn = SUP_IOCTL_SEM_OP2_SIZE_IN;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync Req.Hdr.cbOut = SUP_IOCTL_SEM_OP2_SIZE_OUT;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.Hdr.rc = VERR_INTERNAL_ERROR;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.u.In.uType = uType;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.u.In.hSem = (uint32_t)hSem;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync AssertReturn(Req.u.In.hSem == hSem, VERR_INVALID_HANDLE);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync Req.u.In.uOp = uOp;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync Req.u.In.uReserved = 0;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync Req.u.In.uArg.u64 = u64Arg;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync int rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_SEM_OP2, &Req, sizeof(Req));
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync if (RT_SUCCESS(rc))
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync rc = Req.Hdr.rc;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync return rc;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync/**
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * Worker that makes a SUP_IOCTL_SEM_OP3 request.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync *
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @returns VBox status code.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @param pSession The session handle.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @param uType The semaphore type.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @param hSem The semaphore handle.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @param uOp The operation.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * @param pReq The request structure. The caller should pick
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync * the output data from it himself.
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync */
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncDECLINLINE(int) supSemOp3(PSUPDRVSESSION pSession, uint32_t uType, uintptr_t hSem, uint32_t uOp, PSUPSEMOP3 pReq)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
f7f5cd7b1e530eb5636da51c974b48ae0c1775b3vboxsync NOREF(pSession);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->Hdr.u32Cookie = g_u32Cookie;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->Hdr.u32SessionCookie = g_u32SessionCookie;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->Hdr.cbIn = SUP_IOCTL_SEM_OP3_SIZE_IN;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->Hdr.cbOut = SUP_IOCTL_SEM_OP3_SIZE_OUT;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->Hdr.fFlags = SUPREQHDR_FLAGS_DEFAULT;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->Hdr.rc = VERR_INTERNAL_ERROR;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->u.In.uType = uType;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->u.In.hSem = (uint32_t)hSem;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync AssertReturn(pReq->u.In.hSem == hSem, VERR_INVALID_HANDLE);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->u.In.uOp = uOp;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->u.In.u32Reserved = 0;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync pReq->u.In.u64Reserved = 0;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync int rc = suplibOsIOCtl(&g_supLibData, SUP_IOCTL_SEM_OP3, pReq, sizeof(*pReq));
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync if (RT_SUCCESS(rc))
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync rc = pReq->Hdr.rc;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return rc;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventCreate(PSUPDRVSESSION pSession, PSUPSEMEVENT phEvent)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync AssertPtrReturn(phEvent, VERR_INVALID_POINTER);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync SUPSEMOP3 Req;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync int rc = supSemOp3(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)NIL_SUPSEMEVENT, SUPSEMOP3_CREATE, &Req);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync if (RT_SUCCESS(rc))
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync *phEvent = (SUPSEMEVENT)(uintptr_t)Req.u.Out.hSem;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync return rc;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventClose(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync if (hEvent == NIL_SUPSEMEVENT)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync return VINF_SUCCESS;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)hEvent, SUPSEMOP2_CLOSE, 0);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventSignal(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)hEvent, SUPSEMOP2_SIGNAL, 0);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint32_t cMillies)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)hEvent, SUPSEMOP2_WAIT_MS_REL, cMillies);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncSUPDECL(int) SUPSemEventWaitNsAbsIntr(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint64_t uNsTimeout)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)hEvent, SUPSEMOP2_WAIT_NS_ABS, uNsTimeout);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncSUPDECL(int) SUPSemEventWaitNsRelIntr(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent, uint64_t cNsTimeout)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)hEvent, SUPSEMOP2_WAIT_NS_REL, cNsTimeout);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncSUPDECL(uint32_t) SUPSemEventGetResolution(PSUPDRVSESSION pSession)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync SUPSEMOP3 Req;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync int rc = supSemOp3(pSession, SUP_SEM_TYPE_EVENT, (uintptr_t)NIL_SUPSEMEVENT, SUPSEMOP3_GET_RESOLUTION, &Req);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync if (RT_SUCCESS(rc))
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return Req.u.Out.cNsResolution;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return 1000 / 100;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION pSession, PSUPSEMEVENTMULTI phEventMulti)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync AssertPtrReturn(phEventMulti, VERR_INVALID_POINTER);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync SUPSEMOP3 Req;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync int rc = supSemOp3(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)NIL_SUPSEMEVENTMULTI, SUPSEMOP3_CREATE, &Req);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync if (RT_SUCCESS(rc))
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync *phEventMulti = (SUPSEMEVENTMULTI)(uintptr_t)Req.u.Out.hSem;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync return rc;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventMultiClose(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync if (hEventMulti == NIL_SUPSEMEVENTMULTI)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync return VINF_SUCCESS;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)hEventMulti, SUPSEMOP2_CLOSE, 0);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventMultiSignal(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)hEventMulti, SUPSEMOP2_SIGNAL, 0);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventMultiReset(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)hEventMulti, SUPSEMOP2_RESET, 0);
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsyncSUPDECL(int) SUPSemEventMultiWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint32_t cMillies)
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)hEventMulti, SUPSEMOP2_WAIT_MS_REL, cMillies);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncSUPDECL(int) SUPSemEventMultiWaitNsAbsIntr(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint64_t uNsTimeout)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)hEventMulti, SUPSEMOP2_WAIT_NS_ABS, uNsTimeout);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncSUPDECL(int) SUPSemEventMultiWaitNsRelIntr(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, uint64_t cNsTimeout)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return supSemOp2(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)hEventMulti, SUPSEMOP2_WAIT_NS_REL, cNsTimeout);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync}
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsyncSUPDECL(uint32_t) SUPSemEventMultiGetResolution(PSUPDRVSESSION pSession)
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync{
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync SUPSEMOP3 Req;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync int rc = supSemOp3(pSession, SUP_SEM_TYPE_EVENT_MULTI, (uintptr_t)NIL_SUPSEMEVENTMULTI, SUPSEMOP3_GET_RESOLUTION, &Req);
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync if (RT_SUCCESS(rc))
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return Req.u.Out.cNsResolution;
9b456547aefb8a2e8f5600eba9ec377dbc9b4475vboxsync return 1000 / 100;
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync}
84f746c9015f34e9ab096b87e063d0d6ab7fc7aevboxsync