thread2-r0drv-linux.c revision 6473a6585394a0255de9936152f2fd35d068b347
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/* $Id$ */
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/** @file
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * IPRT - Threads (Part 2), Ring-0 Driver, Linux.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync */
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/*
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * available from http://www.virtualbox.org. This file is free software;
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * you can redistribute it and/or modify it under the terms of the GNU
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * General Public License (GPL) as published by the Free Software
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * The contents of this file may alternatively be used under the terms
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * of the Common Development and Distribution License Version 1.0
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * VirtualBox OSE distribution, in which case the provisions of the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * CDDL are applicable instead of those of the GPL.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * You may elect to license modified versions of this file under the
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * terms and conditions of either the GPL or the CDDL or both.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync * additional information or have any questions.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync */
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/*******************************************************************************
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync* Header Files *
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync*******************************************************************************/
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync#include "the-linux-kernel.h"
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync#include <iprt/assert.h>
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync#include <iprt/thread.h>
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync#include <iprt/err.h>
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync#include "internal/thread.h"
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync/** @todo Later.
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsyncRTDECL(RTTHREAD) RTThreadSelf(void)
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync{
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync return rtThreadGetByNative((RTNATIVETHREAD)current);
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync}
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync*/
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsyncRTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread)
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync{
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync Assert(hThread == NIL_RTTHREAD);
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync return !in_atomic() && !irqs_disabled();
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync}
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync
da34f66f1d7f32c00dcccd9164bc10435de15952vboxsync