thread-r0drv-darwin.cpp revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/* $Id$ */
/** @file
* InnoTek Portable Runtime - Threads, Ring-0 Driver, Darwin.
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include "the-darwin-kernel.h"
#include "r0drv/thread-r0drv.h"
{
return (RTTHREAD)current_thread();
}
{
return VINF_SUCCESS;
}
RTDECL(bool) RTThreadYield(void)
{
return true; /* this is fishy */
}
{
/*
* Convert the priority type to scheduling policies.
*/
bool fSetExtended = false;
thread_extended_policy Extended = { true };
bool fSetTimeContstraint = false;
thread_time_constraint_policy TimeConstraint = { 0, 0, 0, true };
thread_precedence_policy Precedence = { 0 };
switch (enmType)
{
break;
case RTTHREADTYPE_EMULATION:
break;
case RTTHREADTYPE_DEFAULT:
break;
case RTTHREADTYPE_MSG_PUMP:
break;
case RTTHREADTYPE_IO:
break;
case RTTHREADTYPE_TIMER:
fSetExtended = true;
fSetTimeContstraint = true;
break;
default:
return VERR_INVALID_PARAMETER;
}
/*
* Do the actual modification.
*/
if (fSetExtended)
{
}
if (fSetTimeContstraint)
{
}
return VINF_SUCCESS; /* ignore any errors for now */
}
/**
* Native kernel thread wrapper function.
*
* This will forward to rtThreadMain and do termination upon return.
*
* @param pvArg Pointer to the argument package.
* @param Ignored Wait result, which we ignore.
*/
{
}
{
if (rc == KERN_SUCCESS)
{
return VINF_SUCCESS;
}
return RTErrConvertFromMachKernReturn(rc);
}