xref: /freebsd/share/man/man9/SYSCALL_MODULE.9 (revision be9365a9f296c439577ac6a314bf7343c8636703)
150c39ea7SAlexander Langer.\" -*- nroff -*-
250c39ea7SAlexander Langer.\"
350c39ea7SAlexander Langer.\" Copyright (c) 2001 Alexander Langer
450c39ea7SAlexander Langer.\"
550c39ea7SAlexander Langer.\" All rights reserved.
650c39ea7SAlexander Langer.\"
750c39ea7SAlexander Langer.\" This program is free software.
850c39ea7SAlexander Langer.\"
950c39ea7SAlexander Langer.\" Redistribution and use in source and binary forms, with or without
1050c39ea7SAlexander Langer.\" modification, are permitted provided that the following conditions
1150c39ea7SAlexander Langer.\" are met:
1250c39ea7SAlexander Langer.\" 1. Redistributions of source code must retain the above copyright
1350c39ea7SAlexander Langer.\"    notice, this list of conditions and the following disclaimer.
1450c39ea7SAlexander Langer.\" 2. Redistributions in binary form must reproduce the above copyright
1550c39ea7SAlexander Langer.\"    notice, this list of conditions and the following disclaimer in the
1650c39ea7SAlexander Langer.\"    documentation and/or other materials provided with the distribution.
1750c39ea7SAlexander Langer.\"
1850c39ea7SAlexander Langer.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
1950c39ea7SAlexander Langer.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2050c39ea7SAlexander Langer.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2150c39ea7SAlexander Langer.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
2250c39ea7SAlexander Langer.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2350c39ea7SAlexander Langer.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2450c39ea7SAlexander Langer.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2550c39ea7SAlexander Langer.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2650c39ea7SAlexander Langer.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2750c39ea7SAlexander Langer.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2850c39ea7SAlexander Langer.\"
2950c39ea7SAlexander Langer.\" $FreeBSD$
3050c39ea7SAlexander Langer.\"
3166700df0SGiorgos Keramidas.Dd January 7, 2005
3250c39ea7SAlexander Langer.Dt SYSCALL_MODULE 9
3350c39ea7SAlexander Langer.Os
3450c39ea7SAlexander Langer.Sh NAME
3550c39ea7SAlexander Langer.Nm SYSCALL_MODULE
3650c39ea7SAlexander Langer.Nd syscall kernel module declaration macro
3750c39ea7SAlexander Langer.Sh SYNOPSIS
38f16b3c0dSChad David.In sys/param.h
39f16b3c0dSChad David.In sys/kernel.h
4032eef9aeSRuslan Ermilov.In sys/proc.h
4132eef9aeSRuslan Ermilov.In sys/module.h
4232eef9aeSRuslan Ermilov.In sys/sysent.h
43be9365a9SMaxim Konovalov.Fn SYSCALL_MODULE name "int *offset" "struct sysent *new_sysent" "modeventhand_t evh" "void *arg"
4450c39ea7SAlexander Langer.Sh DESCRIPTION
4550c39ea7SAlexander LangerThe
4650c39ea7SAlexander Langer.Fn SYSCALL_MODULE
4750c39ea7SAlexander Langermacro declares a new syscall.
4850c39ea7SAlexander Langer.Fn SYSCALL_MODULE
4950c39ea7SAlexander Langerexpands into a kernel module declaration named as
5050c39ea7SAlexander Langer.Fa name .
5150c39ea7SAlexander Langer.Pp
5266700df0SGiorgos KeramidasThe rest of the arguments expected by this macro are:
5366700df0SGiorgos Keramidas.Bl -tag -width ".Fa new_sysent"
5466700df0SGiorgos Keramidas.It Fa offset
5566700df0SGiorgos KeramidasA pointer to an
5650c39ea7SAlexander Langer.Vt int
5750c39ea7SAlexander Langerwhich saves the offset in
5850c39ea7SAlexander Langer.Vt "struct sysent"
5966700df0SGiorgos Keramidaswhere the syscall is allocated.
6066700df0SGiorgos Keramidas.It Fa new_sysent
61be9365a9SMaxim Konovalovis a pointer to a structure that specifies the function implementing
62be9365a9SMaxim Konovalovthe syscall and the number of arguments this function needs (see
63fe08efe6SRuslan Ermilov.In sys/sysent.h ) .
6466700df0SGiorgos Keramidas.It Fa evh
6566700df0SGiorgos KeramidasA pointer to the kernel module event handler function with the argument
6650c39ea7SAlexander Langer.Fa arg .
6750c39ea7SAlexander LangerPlease refer to
6850c39ea7SAlexander Langer.Xr module 9
6950c39ea7SAlexander Langerfor more information.
7066700df0SGiorgos Keramidas.It Fa arg
7166700df0SGiorgos KeramidasThe argument passed to the callback functions of the
7266700df0SGiorgos Keramidas.Fa evh
7366700df0SGiorgos Keramidasevent handler when it is called.
7466700df0SGiorgos Keramidas.El
7550c39ea7SAlexander Langer.Sh EXAMPLES
7650c39ea7SAlexander LangerA minimal example for a syscall module can be found in
7750c39ea7SAlexander Langer.Pa /usr/share/examples/kld/syscall/module/syscall.c .
7850c39ea7SAlexander Langer.Sh SEE ALSO
7950c39ea7SAlexander Langer.Xr module 9
8050c39ea7SAlexander Langer.Pp
8150c39ea7SAlexander Langer.Pa /usr/share/examples/kld/syscall/module/syscall.c
8250c39ea7SAlexander Langer.Sh AUTHORS
8350c39ea7SAlexander LangerThis manual page was written by
8450c39ea7SAlexander Langer.An Alexander Langer Aq alex@FreeBSD.org .
85