Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Allow machine dependent code to specify a hook to b...
details: https://anonhg.NetBSD.org/src/rev/92425159e086
branches: trunk
changeset: 499464:92425159e086
user: thorpej <thorpej%NetBSD.org@localhost>
date: Mon Nov 20 20:04:49 2000 +0000
description:
Allow machine dependent code to specify a hook to be run when a
spinlock's interlock is released.
Idea from Bill Sommerfeld.
diffstat:
sys/kern/kern_lock.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (32 lines):
diff -r c29a1ac42f04 -r 92425159e086 sys/kern/kern_lock.c
--- a/sys/kern/kern_lock.c Mon Nov 20 19:53:43 2000 +0000
+++ b/sys/kern/kern_lock.c Mon Nov 20 20:04:49 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_lock.c,v 1.48 2000/08/28 21:07:52 sommerfeld Exp $ */
+/* $NetBSD: kern_lock.c,v 1.49 2000/11/20 20:04:49 thorpej Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -130,6 +130,10 @@
#define COUNT_CPU(cpu_id, x)
#endif /* LOCKDEBUG || DIAGNOSTIC */ /* } */
+#ifndef SPINLOCK_INTERLOCK_RELEASE_HOOK /* from <machine/lock.h> */
+#define SPINLOCK_INTERLOCK_RELEASE_HOOK /* nothing */
+#endif
+
#define INTERLOCK_ACQUIRE(lkp, flags, s) \
do { \
if ((flags) & LK_SPIN) \
@@ -140,8 +144,10 @@
#define INTERLOCK_RELEASE(lkp, flags, s) \
do { \
simple_unlock(&(lkp)->lk_interlock); \
- if ((flags) & LK_SPIN) \
+ if ((flags) & LK_SPIN) { \
splx(s); \
+ SPINLOCK_INTERLOCK_RELEASE_HOOK; \
+ } \
} while (0)
/*
Home |
Main Index |
Thread Index |
Old Index