initterm.h revision 5b281ba489ca18f0380d7efc7a5108b606cce449
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/** @file
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * IPRT - Runtime Init/Term.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * available from http://www.virtualbox.org. This file is free software;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * you can redistribute it and/or modify it under the terms of the GNU
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * General Public License (GPL) as published by the Free Software
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * The contents of this file may alternatively be used under the terms
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * of the Common Development and Distribution License Version 1.0
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * VirtualBox OSE distribution, in which case the provisions of the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * CDDL are applicable instead of those of the GPL.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * You may elect to license modified versions of this file under the
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * terms and conditions of either the GPL or the CDDL or both.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * additional information or have any questions.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef ___iprt_initterm_h
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define ___iprt_initterm_h
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <iprt/cdefs.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <iprt/types.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync__BEGIN_DECLS
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/** @defgroup grp_rt IPRT APIs
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * @{
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/** @defgroup grp_rt_initterm Init / Term
* @{
*/
#ifdef IN_RING3
/**
* Initalizes the runtime library.
*
* @returns iprt status code.
*
* @param fInitSUPLib Set if SUPInit() shall be called during init (default).
* Clear if not to call it.
* @param cbReserve The number of bytes of contiguous memory that should be reserved by
* the runtime / support library.
* Set this to 0 if no reservation is required. (default)
* Set this to ~(size_t)0 if the maximum amount supported by the VM is to be
* attempted reserved, or the maximum available.
* This argument only applies if fInitSUPLib is true and we're in ring-3 HC.
*/
RTR3DECL(int) RTR3Init(
#ifdef __cplusplus
bool fInitSUPLib = true,
size_t cbReserve = 0
#else
bool fInitSUPLib,
size_t cbReserve
#endif
);
/**
* Terminates the runtime library.
*/
RTR3DECL(void) RTR3Term(void);
#endif
#ifdef IN_RING0
/**
* Initalizes the ring-0 driver runtime library.
*
* @returns iprt status code.
* @param fReserved Flags reserved for the future.
*/
RTR0DECL(int) RTR0Init(unsigned fReserved);
/**
* Terminates the ring-0 driver runtime library.
*/
RTR0DECL(void) RTR0Term(void);
#endif
#ifdef IN_GC
/**
* Initalizes the guest context runtime library.
*
* @returns iprt status code.
*
* @param u64ProgramStartNanoTS The startup timestamp.
*/
RTGCDECL(int) RTGCInit(uint64_t u64ProgramStartNanoTS);
/**
* Terminates the guest context runtime library.
*/
RTGCDECL(void) RTGCTerm(void);
#endif
/** @} */
/** @} */
__END_DECLS
#endif