mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-14 09:25:17 +08:00
Implemented a version of rmlock using rwlock.
This commit is contained in:
1045
freebsd/kern/kern_ntptime.c
Normal file
1045
freebsd/kern/kern_ntptime.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -43,6 +43,7 @@
|
||||
|
||||
LIST_HEAD(rmpriolist,rm_priotracker);
|
||||
|
||||
#ifndef __rtems__
|
||||
struct rmlock {
|
||||
struct lock_object lock_object;
|
||||
volatile int rm_noreadtoken;
|
||||
@@ -50,6 +51,10 @@ struct rmlock {
|
||||
struct mtx rm_lock;
|
||||
|
||||
};
|
||||
#else /* __rtems__ */
|
||||
#include <freebsd/sys/rwlock.h>
|
||||
#define rmlock rwlock
|
||||
#endif /* __rtems__ */
|
||||
|
||||
struct rm_priotracker {
|
||||
struct rm_queue rmp_cpuQueue; /* Must be first */
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#define RM_NOWITNESS 0x00000001
|
||||
#define RM_RECURSE 0x00000002
|
||||
|
||||
#ifndef __rtems__
|
||||
void rm_init(struct rmlock *rm, const char *name);
|
||||
void rm_init_flags(struct rmlock *rm, const char *name, int opts);
|
||||
void rm_destroy(struct rmlock *rm);
|
||||
@@ -84,6 +85,22 @@ void _rm_runlock(struct rmlock *rm, struct rm_priotracker *tracker);
|
||||
#define rm_runlock(rm,tracker) _rm_runlock((rm), (tracker))
|
||||
#endif
|
||||
|
||||
#else /* __rtems__ */
|
||||
#define rm_init(rm, name) rw_init(rm, name)
|
||||
#define rm_init_flags(rm, name, opts) rw_init_flags(rm, name, opts)
|
||||
#define rm_destroy(rm) rw_destroy(rm)
|
||||
#define rm_wowned(rm) rw_wowned(rm)
|
||||
#define rm_sysinit(arg) rw_sysinit(arg)
|
||||
#define rm_sysinit_flags(arg) rw_sysinit_flags(arg)
|
||||
|
||||
#define rm_wlock(rm) rw_wlock((rm))
|
||||
#define rm_wunlock(rm) rw_wunlock((rm))
|
||||
#define rm_rlock(rm,tracker) rw_rlock((rm))
|
||||
#define rm_runlock(rm,tracker) rw_runlock((rm))
|
||||
#endif /* __rtems__ */
|
||||
|
||||
|
||||
|
||||
struct rm_args {
|
||||
struct rmlock *ra_rm;
|
||||
const char *ra_desc;
|
||||
|
Reference in New Issue
Block a user