diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-12-04 08:48:10 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-12-06 07:13:04 +0100 |
commit | 98b52e35174496b49c5d81c6ef31018819165c36 (patch) | |
tree | 4232b048a07868299a9e55ff6cc5c47ffb6043a0 /cpukit/libdrvmgr/drvmgr_internal.h | |
parent | bsp/gen5200: Avoid duplicate header installation (diff) | |
download | rtems-98b52e35174496b49c5d81c6ef31018819165c36.tar.bz2 |
drvmgr: Use API mutex
Diffstat (limited to 'cpukit/libdrvmgr/drvmgr_internal.h')
-rw-r--r-- | cpukit/libdrvmgr/drvmgr_internal.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/cpukit/libdrvmgr/drvmgr_internal.h b/cpukit/libdrvmgr/drvmgr_internal.h index 5061d926b5..78617e5a2b 100644 --- a/cpukit/libdrvmgr/drvmgr_internal.h +++ b/cpukit/libdrvmgr/drvmgr_internal.h @@ -7,6 +7,8 @@ * http://www.rtems.org/license/LICENSE. */ +#include <rtems/score/apimutex.h> + /* Structure hold all information the driver manager needs to know of. Used * internally by Driver Manager routines. */ @@ -15,7 +17,7 @@ struct drvmgr { int initializing_objs; /* Device tree Lock */ - rtems_id lock; + API_Mutex_Control lock; /* The first device - The root device and it's driver */ struct drvmgr_drv *root_drv; @@ -49,20 +51,17 @@ extern struct drvmgr drvmgr; extern void _DRV_Manager_Lock(void); extern void _DRV_Manager_Unlock(void); -extern int _DRV_Manager_Init_Lock(void); /* The best solution is to implement the locking with a RW lock, however there * is no such API available. Care must be taken so that dead-lock isn't created * for example in recursive functions. */ #if defined(DRVMGR_USE_LOCKS) && (DRVMGR_USE_LOCKS == 1) - #define DRVMGR_LOCK_INIT() _DRV_Manager_Init_Lock() #define DRVMGR_LOCK_WRITE() _DRV_Manager_Lock() #define DRVMGR_LOCK_READ() _DRV_Manager_Lock() #define DRVMGR_UNLOCK() _DRV_Manager_Unlock() #else /* no locking */ - #define DRVMGR_LOCK_INIT() #define DRVMGR_LOCK_WRITE() #define DRVMGR_LOCK_READ() #define DRVMGR_UNLOCK() |