the-darwin-kernel.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/* $Id$ */
/** @file
* InnoTek Portable Runtime - Include all necessary headers for the Darwing kernel.
*/
/*
* 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.
*/
#ifndef __the_darwin_kernel_h__
#define __the_darwin_kernel_h__
/* Problematic header(s) containing conflicts with IPRT first. */
#define __STDC_CONSTANT_MACROS
#define __STDC_LIMIT_MACROS
#include <mach/vm_param.h>
/* Include the IPRT definitions of the conflicting #defines & typedefs. */
/* After including cdefs, we can check that this really is Darwin. */
#ifndef __DARWIN__
# error "__DARWIN__ must be defined!"
#endif
/* now we're ready for including the rest of the Darwin headers. */
#include <kern/sched_prim.h>
#include <mach/thread_act.h>
/*
* Internals of the Darwin Ring-0 IPRT.
*/
extern lck_grp_t *g_pDarwinLockGroup;
/**
* Converts from nanoseconds to Darwin absolute time units.
* @returns Darwin absolute time.
* @param u64Nano Time interval in nanoseconds
*/
{
return u64AbsTime;
}
/**
* Convert from mach kernel return code to IPRT status code.
*/
{
switch (rc)
{
case KERN_SUCCESS: return VINF_SUCCESS;
default: return VERR_GENERAL_FAILURE;
}
}
#endif