From owner-svn-src-head@FreeBSD.ORG Fri Mar 19 11:11:35 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 45D7D106564A; Fri, 19 Mar 2010 11:11:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34C228FC12; Fri, 19 Mar 2010 11:11:35 +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 o2JBBZk5030036; Fri, 19 Mar 2010 11:11:35 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o2JBBZe5030034; Fri, 19 Mar 2010 11:11:35 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201003191111.o2JBBZe5030034@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 19 Mar 2010 11:11:35 +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: r205326 - 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: Fri, 19 Mar 2010 11:11:35 -0000 Author: kib Date: Fri Mar 19 11:11:34 2010 New Revision: 205326 URL: http://svn.freebsd.org/changeset/base/205326 Log: Convert aio syscall registration to SYSCALL_INIT_HELPER. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Fri Mar 19 11:10:24 2010 (r205325) +++ head/sys/kern/vfs_aio.c Fri Mar 19 11:11:34 2010 (r205326) @@ -334,7 +334,7 @@ static TAILQ_HEAD(,aiocblist) aio_jobs; static struct unrhdr *aiod_unr; void aio_init_aioinfo(struct proc *p); -static void aio_onceonly(void); +static int aio_onceonly(void); static int aio_free_entry(struct aiocblist *aiocbe); static void aio_process(struct aiocblist *aiocbe); static int aio_newproc(int *); @@ -419,18 +419,47 @@ static moduledata_t aio_mod = { NULL }; -SYSCALL_MODULE_HELPER(aio_cancel); -SYSCALL_MODULE_HELPER(aio_error); -SYSCALL_MODULE_HELPER(aio_fsync); -SYSCALL_MODULE_HELPER(aio_read); -SYSCALL_MODULE_HELPER(aio_return); -SYSCALL_MODULE_HELPER(aio_suspend); -SYSCALL_MODULE_HELPER(aio_waitcomplete); -SYSCALL_MODULE_HELPER(aio_write); -SYSCALL_MODULE_HELPER(lio_listio); -SYSCALL_MODULE_HELPER(oaio_read); -SYSCALL_MODULE_HELPER(oaio_write); -SYSCALL_MODULE_HELPER(olio_listio); +static struct syscall_helper_data aio_syscalls[] = { + SYSCALL_INIT_HELPER(aio_cancel), + SYSCALL_INIT_HELPER(aio_error), + SYSCALL_INIT_HELPER(aio_fsync), + SYSCALL_INIT_HELPER(aio_read), + SYSCALL_INIT_HELPER(aio_return), + SYSCALL_INIT_HELPER(aio_suspend), + SYSCALL_INIT_HELPER(aio_waitcomplete), + SYSCALL_INIT_HELPER(aio_write), + SYSCALL_INIT_HELPER(lio_listio), + SYSCALL_INIT_HELPER(oaio_read), + SYSCALL_INIT_HELPER(oaio_write), + SYSCALL_INIT_HELPER(olio_listio), + SYSCALL_INIT_LAST +}; + +#ifdef COMPAT_FREEBSD32 +#include +#include +#include +#include +#include +#include +#include + +static struct syscall_helper_data aio32_syscalls[] = { + SYSCALL32_INIT_HELPER(freebsd32_aio_return), + SYSCALL32_INIT_HELPER(freebsd32_aio_suspend), + SYSCALL32_INIT_HELPER(freebsd32_aio_cancel), + SYSCALL32_INIT_HELPER(freebsd32_aio_error), + SYSCALL32_INIT_HELPER(freebsd32_aio_fsync), + SYSCALL32_INIT_HELPER(freebsd32_aio_read), + SYSCALL32_INIT_HELPER(freebsd32_aio_write), + SYSCALL32_INIT_HELPER(freebsd32_aio_waitcomplete), + SYSCALL32_INIT_HELPER(freebsd32_lio_listio), + SYSCALL32_INIT_HELPER(freebsd32_oaio_read), + SYSCALL32_INIT_HELPER(freebsd32_oaio_write), + SYSCALL32_INIT_HELPER(freebsd32_olio_listio), + SYSCALL_INIT_LAST +}; +#endif DECLARE_MODULE(aio, aio_mod, SI_SUB_VFS, SI_ORDER_ANY); @@ -439,9 +468,10 @@ MODULE_VERSION(aio, 1); /* * Startup initialization */ -static void +static int aio_onceonly(void) { + int error; /* XXX: should probably just use so->callback */ aio_swake = &aio_swake_cb; @@ -474,6 +504,16 @@ aio_onceonly(void) p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, AIO_LISTIO_MAX); p31b_setcfg(CTL_P1003_1B_AIO_MAX, MAX_AIO_QUEUE); p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, 0); + + error = syscall_helper_register(aio_syscalls); + if (error) + return (error); +#ifdef COMPAT_FREEBSD32 + error = syscall32_helper_register(aio32_syscalls); + if (error) + return (error); +#endif + return (0); } /* @@ -495,6 +535,11 @@ aio_unload(void) if (!unloadable) return (EOPNOTSUPP); +#ifdef COMPAT_FREEBSD32 + syscall32_helper_unregister(aio32_syscalls); +#endif + syscall_helper_unregister(aio_syscalls); + error = kqueue_del_filteropts(EVFILT_AIO); if (error) return error; @@ -2533,13 +2578,6 @@ filt_lio(struct knote *kn, long hint) } #ifdef COMPAT_FREEBSD32 -#include -#include -#include -#include -#include -#include -#include struct __aiocb_private32 { int32_t status; @@ -2948,16 +2986,4 @@ freebsd32_lio_listio(struct thread *td, return (error); } -SYSCALL32_MODULE_HELPER(freebsd32_aio_return); -SYSCALL32_MODULE_HELPER(freebsd32_aio_suspend); -SYSCALL32_MODULE_HELPER(freebsd32_aio_cancel); -SYSCALL32_MODULE_HELPER(freebsd32_aio_error); -SYSCALL32_MODULE_HELPER(freebsd32_aio_fsync); -SYSCALL32_MODULE_HELPER(freebsd32_aio_read); -SYSCALL32_MODULE_HELPER(freebsd32_aio_write); -SYSCALL32_MODULE_HELPER(freebsd32_aio_waitcomplete); -SYSCALL32_MODULE_HELPER(freebsd32_lio_listio); -SYSCALL32_MODULE_HELPER(freebsd32_oaio_read); -SYSCALL32_MODULE_HELPER(freebsd32_oaio_write); -SYSCALL32_MODULE_HELPER(freebsd32_olio_listio); #endif