thread-r0drv-freebsd.c revision b79e4344bf4eb8033fd06d560cd864192728bd0b
5b281ba489ca18f0380d7efc7a5108b606cce449vboxsync * IPRT - Threads (Part 1), Ring-0 Driver, FreeBSD.
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * Copyright (C) 2007-2009 Sun Microsystems, Inc.
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * available from http://www.virtualbox.org. This file is free software;
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * you can redistribute it and/or modify it under the terms of the GNU
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * General Public License (GPL) as published by the Free Software
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * The contents of this file may alternatively be used under the terms
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * of the Common Development and Distribution License Version 1.0
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * VirtualBox OSE distribution, in which case the provisions of the
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * CDDL are applicable instead of those of the GPL.
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * You may elect to license modified versions of this file under the
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * terms and conditions of either the GPL or the CDDL or both.
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
10ecaf3570b345a45fe1687eb5512c4f39103887vboxsync * additional information or have any questions.
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync/*******************************************************************************
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync* Header Files *
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync*******************************************************************************/
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * 0 ms sleep -> yield.
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync * Translate milliseconds into ticks and go to sleep.
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync int64_t cTicks64 = ((uint64_t)cMillies * hz) / 1000;
1f1986470af9f0bb750dd859b142dc2e952deb20vboxsync return false; /** @todo figure this one ... */
1f6aceca6eb044aee08cc9dacac639b0ea0c45f9vboxsyncRTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread)
670732e50b0d42e68d59a3bab835ba0e91b00c30vboxsync && ASMIntAreEnabled(); /** @todo is there a native freebsd function/macro for this? */
1f6aceca6eb044aee08cc9dacac639b0ea0c45f9vboxsyncRTDECL(bool) RTThreadPreemptIsPending(RTTHREAD hThread)
1f6aceca6eb044aee08cc9dacac639b0ea0c45f9vboxsync /* yes, RTThreadPreemptIsPending is reliable. */
1f6aceca6eb044aee08cc9dacac639b0ea0c45f9vboxsync return true;
670732e50b0d42e68d59a3bab835ba0e91b00c30vboxsync /* yes, kernel preemption is possible. */
670732e50b0d42e68d59a3bab835ba0e91b00c30vboxsync return true;
1f6aceca6eb044aee08cc9dacac639b0ea0c45f9vboxsyncRTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState)
1f6aceca6eb044aee08cc9dacac639b0ea0c45f9vboxsyncRTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState)
670732e50b0d42e68d59a3bab835ba0e91b00c30vboxsyncRTDECL(bool) RTThreadIsInInterrupt(RTTHREAD hThread)
670732e50b0d42e68d59a3bab835ba0e91b00c30vboxsync /** @todo FreeBSD: Implement RTThreadIsInInterrupt. Required for guest
670732e50b0d42e68d59a3bab835ba0e91b00c30vboxsync * additions! */