Module Name:    src
Committed By:   matt
Date:           Fri Jan  7 02:18:07 UTC 2011

Modified Files:
        src/sys/kern [matt-nb5-pq3]: kern_subr.c

Log Message:
Add critpoll hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.192.4.1 -r1.192.4.1.8.1 src/sys/kern/kern_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_subr.c
diff -u src/sys/kern/kern_subr.c:1.192.4.1 src/sys/kern/kern_subr.c:1.192.4.1.8.1
--- src/sys/kern/kern_subr.c:1.192.4.1	Mon Nov 17 18:56:05 2008
+++ src/sys/kern/kern_subr.c	Fri Jan  7 02:18:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_subr.c,v 1.192.4.1 2008/11/17 18:56:05 snj Exp $	*/
+/*	$NetBSD: kern_subr.c,v 1.192.4.1.8.1 2011/01/07 02:18:07 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.192.4.1 2008/11/17 18:56:05 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.192.4.1.8.1 2011/01/07 02:18:07 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_md.h"
@@ -603,6 +603,33 @@
 	}
 }
 
+static hook_list_t critpollhook_list = LIST_HEAD_INITIALIZER(critpollhook_list);
+
+void *
+critpollhook_establish(void (*fn)(void *), void *arg)
+{
+	return hook_establish(&critpollhook_list, fn, arg);
+}
+
+void
+critpollhook_disestablish(void *vhook)
+{
+	hook_disestablish(&critpollhook_list, vhook);
+}
+
+/*
+ * Run critical polling hooks.
+ */
+void
+docritpollhooks(void)
+{
+	struct hook_desc *hd;
+
+	LIST_FOREACH(hd, &critpollhook_list, hk_list) {
+		(*hd->hk_fn)(hd->hk_arg);
+	}
+}
+
 /*
  * "Power hook" types, functions, and variables.
  * The list of power hooks is kept ordered with the last registered hook

Reply via email to