1 | /* $Id: initterm-r0drv.cpp 5999 2007-12-07 15:05:06Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * innotek Portable Runtime - Initialization & Termination, R0 Driver, Common.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | *
|
---|
17 | * The contents of this file may alternatively be used under the terms
|
---|
18 | * of the Common Development and Distribution License Version 1.0
|
---|
19 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | * CDDL are applicable instead of those of the GPL.
|
---|
22 | *
|
---|
23 | * You may elect to license modified versions of this file under the
|
---|
24 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | /*******************************************************************************
|
---|
29 | * Header Files *
|
---|
30 | *******************************************************************************/
|
---|
31 | #include <iprt/initterm.h>
|
---|
32 | #include <iprt/assert.h>
|
---|
33 | #include <iprt/err.h>
|
---|
34 |
|
---|
35 | #include "internal/initterm.h"
|
---|
36 | #include "internal/thread.h"
|
---|
37 |
|
---|
38 |
|
---|
39 | /**
|
---|
40 | * Initalizes the ring-0 driver runtime library.
|
---|
41 | *
|
---|
42 | * @returns iprt status code.
|
---|
43 | * @param fReserved Flags reserved for the future.
|
---|
44 | */
|
---|
45 | RTR0DECL(int) RTR0Init(unsigned fReserved)
|
---|
46 | {
|
---|
47 | int rc;
|
---|
48 | Assert(fReserved == 0);
|
---|
49 | rc = rtR0InitNative();
|
---|
50 | if (RT_SUCCESS(rc))
|
---|
51 | {
|
---|
52 | #if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS)
|
---|
53 | rc = rtThreadInit();
|
---|
54 | #endif
|
---|
55 | if (RT_SUCCESS(rc))
|
---|
56 | return rc;
|
---|
57 |
|
---|
58 | rtR0TermNative();
|
---|
59 | }
|
---|
60 | return rc;
|
---|
61 | }
|
---|
62 |
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * Terminates the ring-0 driver runtime library.
|
---|
66 | */
|
---|
67 | RTR0DECL(void) RTR0Term(void)
|
---|
68 | {
|
---|
69 | #if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS)
|
---|
70 | rtThreadTerm();
|
---|
71 | #endif
|
---|
72 | rtR0TermNative();
|
---|
73 | }
|
---|
74 |
|
---|