4.115
Last change
on this file since cc3f87c0 was
65d1f35,
checked in by Daniel Hellstrom <daniel@…>, on 02/27/15 at 15:42:36
|
DRVMGR: updated copyright into one line only
|
-
Property mode set to
100644
|
File size:
739 bytes
|
Line | |
---|
1 | /* Driver Manager Internal locking implementation |
---|
2 | * |
---|
3 | * COPYRIGHT (c) 2009 Cobham Gaisler AB. |
---|
4 | * |
---|
5 | * The license and distribution terms for this file may be |
---|
6 | * found in the file LICENSE in this distribution or at |
---|
7 | * http://www.rtems.com/license/LICENSE. |
---|
8 | */ |
---|
9 | |
---|
10 | #include <rtems.h> |
---|
11 | #include <drvmgr/drvmgr.h> |
---|
12 | #include "drvmgr_internal.h" |
---|
13 | |
---|
14 | void _DRV_Manager_Lock(void) |
---|
15 | { |
---|
16 | rtems_semaphore_obtain(drv_mgr.lock, RTEMS_WAIT, RTEMS_NO_TIMEOUT); |
---|
17 | } |
---|
18 | |
---|
19 | void _DRV_Manager_Unlock(void) |
---|
20 | { |
---|
21 | rtems_semaphore_release(drv_mgr.lock); |
---|
22 | } |
---|
23 | |
---|
24 | int _DRV_Manager_Init_Lock(void) |
---|
25 | { |
---|
26 | int rc; |
---|
27 | |
---|
28 | rc = rtems_semaphore_create( |
---|
29 | rtems_build_name('D', 'R', 'V', 'M'), |
---|
30 | 1, |
---|
31 | RTEMS_DEFAULT_ATTRIBUTES, |
---|
32 | 0, |
---|
33 | &drv_mgr.lock); |
---|
34 | if (rc != RTEMS_SUCCESSFUL) |
---|
35 | return -1; |
---|
36 | return 0; |
---|
37 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.