summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/rtems/rtems-kernel-mutex.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-05-18 09:35:46 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-20 14:59:55 +0200
commit62c8ca0ead09ef289faf6517e177fd6f6d7a74a3 (patch)
tree8eeed454171864eb40485c13f004b39150704135 /rtemsbsd/rtems/rtems-kernel-mutex.c
parentAdd CPUINFO command to default network init (diff)
downloadrtems-libbsd-62c8ca0ead09ef289faf6517e177fd6f6d7a74a3.tar.bz2
Fix INVARIANTS support
Diffstat (limited to 'rtemsbsd/rtems/rtems-kernel-mutex.c')
-rw-r--r--rtemsbsd/rtems/rtems-kernel-mutex.c51
1 files changed, 24 insertions, 27 deletions
diff --git a/rtemsbsd/rtems/rtems-kernel-mutex.c b/rtemsbsd/rtems/rtems-kernel-mutex.c
index f403c70f..360536a5 100644
--- a/rtemsbsd/rtems/rtems-kernel-mutex.c
+++ b/rtemsbsd/rtems/rtems-kernel-mutex.c
@@ -164,33 +164,30 @@ _mtx_unlock_flags(struct mtx *m, int opts, const char *file, int line)
void
_mtx_assert(struct mtx *m, int what, const char *file, int line)
{
-
- if (panicstr != NULL || dumping)
- return;
- switch (what) {
- case MA_OWNED:
- case MA_OWNED | MA_RECURSED:
- case MA_OWNED | MA_NOTRECURSED:
- if (!mtx_owned(m))
- panic("mutex %s not owned at %s:%d",
- m->lock_object.lo_name, file, line);
- if (mtx_recursed(m)) {
- if ((what & MA_NOTRECURSED) != 0)
- panic("mutex %s recursed at %s:%d",
- m->lock_object.lo_name, file, line);
- } else if ((what & MA_RECURSED) != 0) {
- panic("mutex %s unrecursed at %s:%d",
- m->lock_object.lo_name, file, line);
- }
- break;
- case MA_NOTOWNED:
- if (mtx_owned(m))
- panic("mutex %s owned at %s:%d",
- m->lock_object.lo_name, file, line);
- break;
- default:
- panic("unknown mtx_assert at %s:%d", file, line);
- }
+ const char *name = rtems_bsd_mutex_name(&m->mutex);
+
+ switch (what) {
+ case MA_OWNED:
+ case MA_OWNED | MA_RECURSED:
+ case MA_OWNED | MA_NOTRECURSED:
+ if (!mtx_owned(m))
+ panic("mutex %s not owned at %s:%d", name, file, line);
+ if (mtx_recursed(m)) {
+ if ((what & MA_NOTRECURSED) != 0)
+ panic("mutex %s recursed at %s:%d", name, file,
+ line);
+ } else if ((what & MA_RECURSED) != 0) {
+ panic("mutex %s unrecursed at %s:%d", name, file,
+ line);
+ }
+ break;
+ case MA_NOTOWNED:
+ if (mtx_owned(m))
+ panic("mutex %s owned at %s:%d", name, file, line);
+ break;
+ default:
+ panic("unknown mtx_assert at %s:%d", file, line);
+ }
}
#endif