VirtualBox

source: vbox/trunk/src/VBox/Runtime/r0drv/initterm-r0drv.cpp@ 9598

Last change on this file since 9598 was 9588, checked in by vboxsync, 17 years ago

Initialize the MP event notifications from initterm-r0drv.cpp after all.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/* $Id: initterm-r0drv.cpp 9588 2008-06-11 00:52:02Z vboxsync $ */
2/** @file
3 * IPRT - Initialization & Termination, R0 Driver, Common.
4 */
5
6/*
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
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 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
27 * Clara, CA 95054 USA or visit http://www.sun.com if you need
28 * additional information or have any questions.
29 */
30
31
32/*******************************************************************************
33* Header Files *
34*******************************************************************************/
35#include <iprt/initterm.h>
36#include <iprt/assert.h>
37#include <iprt/err.h>
38#include <iprt/mp.h>
39
40#include "internal/initterm.h"
41#include "internal/thread.h"
42
43
44/**
45 * Initalizes the ring-0 driver runtime library.
46 *
47 * @returns iprt status code.
48 * @param fReserved Flags reserved for the future.
49 */
50RTR0DECL(int) RTR0Init(unsigned fReserved)
51{
52 int rc;
53 Assert(fReserved == 0);
54 rc = rtR0InitNative();
55 if (RT_SUCCESS(rc))
56 {
57#if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS)
58 rc = rtThreadInit();
59#endif
60 if (RT_SUCCESS(rc))
61 {
62#ifndef IN_GUEST /* play safe for now */
63 rc = RTR0MpNotificationInit(NULL); /** @todo drop the arg and rename to rtR0* */
64#endif
65 if (RT_SUCCESS(rc))
66 return rc;
67 }
68
69 rtR0TermNative();
70 }
71 return rc;
72}
73
74
75/**
76 * Terminates the ring-0 driver runtime library.
77 */
78RTR0DECL(void) RTR0Term(void)
79{
80#if !defined(RT_OS_LINUX) && !defined(RT_OS_WINDOWS)
81 rtThreadTerm();
82#endif
83#ifndef IN_GUEST /* play safe for now */
84 RTR0MpNotificationTerm(NULL); /** @todo drop the arg and rename to rtR0* */
85#endif
86 rtR0TermNative();
87}
88
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette