summaryrefslogtreecommitdiff
path: root/kern/lock.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2025-02-12 02:09:44 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2025-02-12 02:11:11 +0100
commit00e36dabb4cdef51095aece46e451f2fab4c13c1 (patch)
tree20b24b481b496abc40bd901a5a69b0c3ed4efefd /kern/lock.h
parentc72c74b8544763f536566d3004a2cc957f1b1937 (diff)
Use MACRO_BEGIN/END
This notably fixes at least a SAVE_HINT call.
Diffstat (limited to 'kern/lock.h')
-rw-r--r--kern/lock.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/kern/lock.h b/kern/lock.h
index 6c976eab..704118f0 100644
--- a/kern/lock.h
+++ b/kern/lock.h
@@ -267,18 +267,20 @@ extern unsigned long in_interrupt[NCPUS];
/* These are defined elsewhere with lock monitoring */
#if MACH_LOCK_MON == 0
-#define simple_lock(l) do { \
+#define simple_lock(l) \
+MACRO_BEGIN \
lock_check_no_interrupts(); \
simple_lock_nocheck(l); \
-} while (0)
+MACRO_END
#define simple_lock_try(l) ({ \
lock_check_no_interrupts(); \
simple_lock_try_nocheck(l); \
})
-#define simple_unlock(l) do { \
+#define simple_unlock(l) \
+MACRO_BEGIN \
lock_check_no_interrupts(); \
simple_unlock_nocheck(l); \
-} while (0)
+MACRO_END
#endif
/* _irq variants */
@@ -302,10 +304,11 @@ class simple_lock_irq_data_t name;
simple_lock_nocheck(&(l)->slock); \
__s; \
})
-#define simple_unlock_irq(s, l) do { \
+#define simple_unlock_irq(s, l) \
+MACRO_BEGIN \
simple_unlock_nocheck(&(l)->slock); \
splx(s); \
-} while (0)
+MACRO_END
#if MACH_KDB
extern void db_show_all_slocks(void);