xref: /freebsd/share/man/man9/SYSCALL_MODULE.9 (revision 32eef9aeb1f39a1623cea55da147c89abbd5b9a5)
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.\"
3150c39ea7SAlexander Langer.Dd April 27, 2001
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
3832eef9aeSRuslan Ermilov.In sys/proc.h
3932eef9aeSRuslan Ermilov.In sys/module.h
4032eef9aeSRuslan Ermilov.In sys/sysent.h
4150c39ea7SAlexander Langer.Fn SYSCALL_MODULE name "int *offset" "struct sysent new_sysent" "modeventhand_t evh" "void *arg"
4250c39ea7SAlexander Langer.Sh DESCRIPTION
4350c39ea7SAlexander LangerThe
4450c39ea7SAlexander Langer.Fn SYSCALL_MODULE
4550c39ea7SAlexander Langermacro declares a new syscall.
4650c39ea7SAlexander Langer.Fn SYSCALL_MODULE
4750c39ea7SAlexander Langerexpands into a kernel module declaration named as
4850c39ea7SAlexander Langer.Fa name .
4950c39ea7SAlexander Langer.Pp
5050c39ea7SAlexander Langer.Fa offset
5150c39ea7SAlexander Langeris a pointer to an
5250c39ea7SAlexander Langer.Vt int
5350c39ea7SAlexander Langerwhich saves the offset in
5450c39ea7SAlexander Langer.Vt "struct sysent"
5550c39ea7SAlexander Langerwhere the
5650c39ea7SAlexander Langersyscall is allocated.
5750c39ea7SAlexander Langer.Pp
5850c39ea7SAlexander Langer.Fa new_sysent
5963060b7aSAlexander Langerspecifies the function implementing the syscall and the number of
6063060b7aSAlexander Langerarguments this function needs (see
6150c39ea7SAlexander Langer.Aq Pa sys/sysent.h ) .
6250c39ea7SAlexander Langer.Pp
6350c39ea7SAlexander Langer.Fa evh
6450c39ea7SAlexander Langeris a pointer to the kernel module event handler function with the argument
6550c39ea7SAlexander Langer.Fa arg .
6650c39ea7SAlexander LangerPlease refer to
6750c39ea7SAlexander Langer.Xr module 9
6850c39ea7SAlexander Langerfor more information.
6950c39ea7SAlexander Langer.Sh EXAMPLES
7050c39ea7SAlexander LangerA minimal example for a syscall module can be found in
7150c39ea7SAlexander Langer.Pa /usr/share/examples/kld/syscall/module/syscall.c .
7250c39ea7SAlexander Langer.Sh SEE ALSO
7350c39ea7SAlexander Langer.Xr module 9
7450c39ea7SAlexander Langer.Pp
7550c39ea7SAlexander Langer.Pa /usr/share/examples/kld/syscall/module/syscall.c
7650c39ea7SAlexander Langer.Sh AUTHORS
7750c39ea7SAlexander LangerThis manual page was written by
7850c39ea7SAlexander Langer.An Alexander Langer Aq alex@FreeBSD.org .
79