From owner-svn-src-head@FreeBSD.ORG Thu Oct 21 20:31:51 2010 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50D561065695; Thu, 21 Oct 2010 20:31:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4057A8FC12; Thu, 21 Oct 2010 20:31:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9LKVpUS003458; Thu, 21 Oct 2010 20:31:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9LKVpFP003456; Thu, 21 Oct 2010 20:31:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201010212031.o9LKVpFP003456@svn.freebsd.org> From: Xin LI Date: Thu, 21 Oct 2010 20:31:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214181 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2010 20:31:51 -0000 Author: delphij Date: Thu Oct 21 20:31:50 2010 New Revision: 214181 URL: http://svn.freebsd.org/changeset/base/214181 Log: Call chainevh callback when we are invoked with neither MOD_LOAD nor MOD_UNLOAD. This makes it possible to add custom hooks for other module events. Return EOPNOTSUPP when there is no callback available. Pointed out by: jhb Reviewed by: jhb MFC after: 1 month Modified: head/sys/kern/kern_syscalls.c Modified: head/sys/kern/kern_syscalls.c ============================================================================== --- head/sys/kern/kern_syscalls.c Thu Oct 21 20:30:35 2010 (r214180) +++ head/sys/kern/kern_syscalls.c Thu Oct 21 20:31:50 2010 (r214181) @@ -181,7 +181,9 @@ syscall_module_handler(struct module *mo error = syscall_deregister(data->offset, &data->old_sysent); return (error); default: - return EOPNOTSUPP; + if (data->chainevh) + return (data->chainevh(mod, what, data->chainarg)); + return (EOPNOTSUPP); } /* NOTREACHED */