1 | /* $Id: initterm-r0drv-darwin.cpp 4781 2007-09-13 19:07:42Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * innotek Portable Runtime - Initialization & Termination, R0 Driver, Darwin.
|
---|
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 as published by the Free Software Foundation,
|
---|
13 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*******************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *******************************************************************************/
|
---|
22 | #include "the-darwin-kernel.h"
|
---|
23 | #include <iprt/err.h>
|
---|
24 | #include <iprt/assert.h>
|
---|
25 | #include "internal/initterm.h"
|
---|
26 |
|
---|
27 |
|
---|
28 | /*******************************************************************************
|
---|
29 | * Global Variables *
|
---|
30 | *******************************************************************************/
|
---|
31 | /** Pointer to the lock group used by IPRT. */
|
---|
32 | lck_grp_t *g_pDarwinLockGroup = NULL;
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | int rtR0InitNative(void)
|
---|
37 | {
|
---|
38 | /*
|
---|
39 | * Create the lock group.
|
---|
40 | */
|
---|
41 | g_pDarwinLockGroup = lck_grp_alloc_init("IPRT", LCK_GRP_ATTR_NULL);
|
---|
42 | AssertReturn(g_pDarwinLockGroup, VERR_NO_MEMORY);
|
---|
43 |
|
---|
44 | return VINF_SUCCESS;
|
---|
45 | }
|
---|
46 |
|
---|
47 |
|
---|
48 | void rtR0TermNative(void)
|
---|
49 | {
|
---|
50 | /*
|
---|
51 | * Free the lock group.
|
---|
52 | */
|
---|
53 | if (g_pDarwinLockGroup)
|
---|
54 | {
|
---|
55 | lck_grp_free(g_pDarwinLockGroup);
|
---|
56 | g_pDarwinLockGroup = NULL;
|
---|
57 | }
|
---|
58 | }
|
---|
59 |
|
---|