aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2017-10-13 20:31:56 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2017-10-13 20:31:56 +0000
commit30a33cefae59195f655dfdc40781ff7a8ca8e046 (patch)
treea491b48bb82b991f588c47a0ef12ce319a4123cc
parent96842052d3426f18063073c446259193bda7adab (diff)
downloadsrc-30a33cefae59195f655dfdc40781ff7a8ca8e046.tar.gz
src-30a33cefae59195f655dfdc40781ff7a8ca8e046.zip
mtx: change MTX_UNOWNED from 4 to 0
The value is spread all over the kernel and zeroing a register is cheaper/shorter than setting it up to an arbitrary value. Reduces amd64 GENERIC-NODEBUG .text size by 0.4%. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=324609
-rw-r--r--sys/sys/mutex.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h
index 6f73e1fd52c0..359b1199714c 100644
--- a/sys/sys/mutex.h
+++ b/sys/sys/mutex.h
@@ -65,15 +65,11 @@
* State bits kept in mutex->mtx_lock, for the DEFAULT lock type. None of this,
* with the exception of MTX_UNOWNED, applies to spin locks.
*/
+#define MTX_UNOWNED 0x00000000 /* Cookie for free mutex */
#define MTX_RECURSED 0x00000001 /* lock recursed (for MTX_DEF only) */
#define MTX_CONTESTED 0x00000002 /* lock contested (for MTX_DEF only) */
-#define MTX_UNOWNED 0x00000004 /* Cookie for free mutex */
-#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_UNOWNED)
-
-/*
- * Value stored in mutex->mtx_lock to denote a destroyed mutex.
- */
-#define MTX_DESTROYED (MTX_CONTESTED | MTX_UNOWNED)
+#define MTX_DESTROYED 0x00000004 /* lock destroyed */
+#define MTX_FLAGMASK (MTX_RECURSED | MTX_CONTESTED | MTX_DESTROYED)
/*
* Prototypes