summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/rtems/rtems-kernel-sx.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-14 13:06:39 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-16 08:11:42 +0100
commit9c1490aac3d76c815dbbe1be54214fddc0c45373 (patch)
tree3caa073558f0e62e0df8fe077f880dd4079c4936 /rtemsbsd/rtems/rtems-kernel-sx.c
parentFix file descriptor reference counting in accept() (diff)
downloadrtems-libbsd-9c1490aac3d76c815dbbe1be54214fddc0c45373.tar.bz2
LOCKING(9): Update to current FreeBSD version
Diffstat (limited to 'rtemsbsd/rtems/rtems-kernel-sx.c')
-rw-r--r--rtemsbsd/rtems/rtems-kernel-sx.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/rtemsbsd/rtems/rtems-kernel-sx.c b/rtemsbsd/rtems/rtems-kernel-sx.c
index a8f8bfb4..57087eef 100644
--- a/rtemsbsd/rtems/rtems-kernel-sx.c
+++ b/rtemsbsd/rtems/rtems-kernel-sx.c
@@ -47,24 +47,24 @@
#include <sys/lock.h>
#include <sys/sx.h>
-static void assert_sx(struct lock_object *lock, int what);
-static void lock_sx(struct lock_object *lock, int how);
+static void assert_sx(const struct lock_object *lock, int what);
+static void lock_sx(struct lock_object *lock, uintptr_t how);
#ifdef KDTRACE_HOOKS
-static int owner_sx(struct lock_object *lock, struct thread **owner);
+static int owner_sx(const struct lock_object *lock, struct thread **owner);
#endif
-static int unlock_sx(struct lock_object *lock);
+static uintptr_t unlock_sx(struct lock_object *lock);
struct lock_class lock_class_sx = {
- .lc_name = "sx",
- .lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
- .lc_assert = assert_sx,
+ .lc_name = "sx",
+ .lc_flags = LC_SLEEPLOCK | LC_SLEEPABLE | LC_RECURSABLE | LC_UPGRADABLE,
+ .lc_assert = assert_sx,
#ifdef DDB
- .lc_ddb_show = db_show_sx,
+ .lc_ddb_show = db_show_sx,
#endif
- .lc_lock = lock_sx,
- .lc_unlock = unlock_sx,
+ .lc_lock = lock_sx,
+ .lc_unlock = unlock_sx,
#ifdef KDTRACE_HOOKS
- .lc_owner = owner_sx,
+ .lc_owner = owner_sx,
#endif
};
@@ -73,22 +73,24 @@ struct lock_class lock_class_sx = {
#define sx_recursed(sx) rtems_bsd_mutex_recursed(&(sx)->mutex)
void
-assert_sx(struct lock_object *lock, int what)
+assert_sx(const struct lock_object *lock, int what)
{
- sx_assert((struct sx *)lock, what);
+
+ sx_assert((const struct sx *)lock, what);
}
void
-lock_sx(struct lock_object *lock, int how)
+lock_sx(struct lock_object *lock, uintptr_t how)
{
+
sx_xlock((struct sx *)lock);
}
-int
+uintptr_t
unlock_sx(struct lock_object *lock)
{
- sx_xunlock((struct sx *)lock);
+ sx_xunlock((struct sx *)lock);
return (0);
}