thread-r0drv-nt.cpp revision 41c15aa44c4acfe6760552150eb931319835cfaf
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * IPRT - Threads, Ring-0 Driver, NT.
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * available from http://www.virtualbox.org. This file is free software;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * you can redistribute it and/or modify it under the terms of the GNU
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * General Public License (GPL) as published by the Free Software
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * The contents of this file may alternatively be used under the terms
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * of the Common Development and Distribution License Version 1.0
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * VirtualBox OSE distribution, in which case the provisions of the
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * CDDL are applicable instead of those of the GPL.
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * You may elect to license modified versions of this file under the
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * terms and conditions of either the GPL or the CDDL or both.
df3d4c8e9c81584c535676a3d40c57d868ac61bbvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * additional information or have any questions.
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync/*******************************************************************************
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync* Header Files *
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync*******************************************************************************/
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync NTSTATUS rcNt = KeDelayExecutionThread(KernelMode, TRUE, &Interval);
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync return ZwYieldExecution() != STATUS_NO_YIELD_PERFORMED;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsyncRTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread)
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync return false;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync return false;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync return true;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsyncRTDECL(bool) RTThreadPreemptIsPending(RTTHREAD hThread)
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * Read the globals and check if they are useful.
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync uint32_t const offQuantumEnd = g_offrtNtPbQuantumEnd;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync uint32_t const cbQuantumEnd = g_cbrtNtPbQuantumEnd;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync uint32_t const offDpcQueueDepth = g_offrtNtPbDpcQueueDepth;
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync if (!offQuantumEnd && !cbQuantumEnd && !offDpcQueueDepth)
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync return false;
f6cc81e94c29cc9b39b896cf32ecfe0501b4a1e5vboxsync Assert((offQuantumEnd && cbQuantumEnd) || (!offQuantumEnd && !cbQuantumEnd));
7bff28e0cedd8656acd24b420759649184d8cf00vboxsync * Disable interrupts so we won't be messed around.
bool fPending;
#ifdef RT_ARCH_X86
if ( !fPending
&& offDpcQueueDepth)
return fPending;
return g_offrtNtPbQuantumEnd != 0
&& g_cbrtNtPbQuantumEnd != 0
&& g_offrtNtPbDpcQueueDepth != 0;