initterm.h revision 154e1d5579ca6c8bee571a8d1ced5d76a0234030
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/** @file
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * innotek Portable Runtime - Runtime Init/Term.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright (C) 2006-2007 innotek GmbH
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * available from http://www.virtualbox.org. This file is free software;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * you can redistribute it and/or modify it under the terms of the GNU
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * General Public License as published by the Free Software Foundation,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * distribution. VirtualBox OSE is distributed in the hope that it will
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * be useful, but WITHOUT ANY WARRANTY of any kind.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If you received this file as part of a commercial VirtualBox
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * distribution, then only the terms of your commercial VirtualBox
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * license agreement apply instead of the previous paragraph.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#ifndef ___iprt_initterm_h
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#define ___iprt_initterm_h
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#include <iprt/cdefs.h>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#include <iprt/types.h>
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync__BEGIN_DECLS
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/** @defgroup grp_rt innotek Portable Runtime APIs
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @{
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/** @defgroup grp_rt_initterm Init / Term
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @{
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#ifdef IN_RING3
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Initalizes the runtime library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @returns iprt status code.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @param fInitSUPLib Set if SUPInit() shall be called during init (default).
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Clear if not to call it.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @param cbReserve The number of bytes of contiguous memory that should be reserved by
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * the runtime / support library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Set this to 0 if no reservation is required. (default)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Set this to ~(size_t)0 if the maximum amount supported by the VM is to be
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * attempted reserved, or the maximum available.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * This argument only applies if fInitSUPLib is true and we're in ring-3 HC.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTR3DECL(int) RTR3Init(
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#ifdef __cplusplus
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync bool fInitSUPLib = true,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync size_t cbReserve = 0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#else
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync bool fInitSUPLib,
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync size_t cbReserve
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#endif
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync );
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Terminates the runtime library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTR3DECL(void) RTR3Term(void);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#endif
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#ifdef IN_RING0
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Initalizes the ring-0 driver runtime library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @returns iprt status code.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @param fReserved Flags reserved for the future.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTR0DECL(int) RTR0Init(unsigned fReserved);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Terminates the ring-0 driver runtime library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTR0DECL(void) RTR0Term(void);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#endif
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#ifdef IN_GC
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Initalizes the guest context runtime library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @returns iprt status code.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * @param u64ProgramStartNanoTS The startup timestamp.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTGCDECL(int) RTGCInit(uint64_t u64ProgramStartNanoTS);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/**
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Terminates the guest context runtime library.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncRTGCDECL(void) RTGCTerm(void);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#endif
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
/** @} */
/** @} */
__END_DECLS
#endif