document splraiseipl and makeiplcookie.
This commit is contained in:
parent
1c3bb0caf9
commit
5d51c3ca27
@ -1,4 +1,4 @@
|
||||
# $NetBSD: mi,v 1.985 2006/12/15 00:28:53 he Exp $
|
||||
# $NetBSD: mi,v 1.986 2006/12/21 16:04:13 yamt Exp $
|
||||
./etc/mtree/set.comp comp-sys-root
|
||||
./usr/bin/addr2line comp-debug-bin bfd
|
||||
./usr/bin/ar comp-util-bin bfd
|
||||
@ -6953,6 +6953,7 @@
|
||||
./usr/share/man/cat9/m_tag_next.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/m_tag_prepend.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/m_tag_unlink.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/makeiplcookie.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/malloc.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/malloc_roundup.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/malloc_type_attach.0 comp-sys-catman .cat
|
||||
@ -7197,6 +7198,7 @@
|
||||
./usr/share/man/cat9/splimp.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/spllowersoftclock.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/splnet.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/splraiseipl.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/splsched.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/splserial.0 comp-sys-catman .cat
|
||||
./usr/share/man/cat9/splsoftclock.0 comp-sys-catman .cat
|
||||
@ -11209,6 +11211,7 @@
|
||||
./usr/share/man/man9/m_tag_next.9 comp-sys-man .man
|
||||
./usr/share/man/man9/m_tag_prepend.9 comp-sys-man .man
|
||||
./usr/share/man/man9/m_tag_unlink.9 comp-sys-man .man
|
||||
./usr/share/man/man9/makeiplcookie.9 comp-sys-man .man
|
||||
./usr/share/man/man9/malloc.9 comp-sys-man .man
|
||||
./usr/share/man/man9/malloc_roundup.9 comp-sys-man .man
|
||||
./usr/share/man/man9/malloc_type_attach.9 comp-sys-man .man
|
||||
@ -11453,6 +11456,7 @@
|
||||
./usr/share/man/man9/splimp.9 comp-sys-man .man
|
||||
./usr/share/man/man9/spllowersoftclock.9 comp-sys-man .man
|
||||
./usr/share/man/man9/splnet.9 comp-sys-man .man
|
||||
./usr/share/man/man9/splraiseipl.9 comp-sys-man .man
|
||||
./usr/share/man/man9/splsched.9 comp-sys-man .man
|
||||
./usr/share/man/man9/splserial.9 comp-sys-man .man
|
||||
./usr/share/man/man9/splsoftclock.9 comp-sys-man .man
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.221 2006/11/13 05:13:39 dyoung Exp $
|
||||
# $NetBSD: Makefile,v 1.222 2006/12/21 16:01:13 yamt Exp $
|
||||
|
||||
# Makefile for section 9 (kernel function and variable) manual pages.
|
||||
|
||||
@ -27,6 +27,7 @@ MAN= altq.9 arc4random.9 arp.9 audio.9 autoconf.9 \
|
||||
kmem_alloc.9 kmem_free.9 kmem_zalloc.9 \
|
||||
kfilter_register.9 knote.9 \
|
||||
kprintf.9 kthread.9 linedisc.9 lock.9 log.9 ltsleep.9 \
|
||||
makeiplcookie.9 \
|
||||
malloc.9 mbuf.9 mca.9 memcmp.9 memcpy.9 memmove.9 memset.9 \
|
||||
microtime.9 microuptime.9 mstohz.9 m_tag.9 namecache.9 namei.9 \
|
||||
need_resched.9 opencrypto.9 optstr.9 \
|
||||
@ -39,7 +40,7 @@ MAN= altq.9 arc4random.9 arp.9 audio.9 autoconf.9 \
|
||||
SCHED_LOCK.9 scheduler.9 scsipi.9 \
|
||||
secmodel.9 secmodel_bsd44.9 secmodel_overlay.9 \
|
||||
setjmp.9 setrunqueue.9 shutdownhook_establish.9 \
|
||||
signal.9 softintr.9 spl.9 store.9 suspendsched.9 \
|
||||
signal.9 softintr.9 spl.9 splraiseipl.9 store.9 suspendsched.9 \
|
||||
sysctl.9 tc.9 tcp_congctl.9 timecounter.9 time_second.9 \
|
||||
todr.9 uiomove.9 ucom.9 userret.9 \
|
||||
vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 vme.9 \
|
||||
|
58
share/man/man9/makeiplcookie.9
Normal file
58
share/man/man9/makeiplcookie.9
Normal file
@ -0,0 +1,58 @@
|
||||
.\" $NetBSD: makeiplcookie.9,v 1.1 2006/12/21 16:01:13 yamt Exp $
|
||||
.\"
|
||||
.\" Copyright (c)2006 YAMAMOTO Takashi,
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" ------------------------------------------------------------
|
||||
.Dd December 22, 2006
|
||||
.Dt MAKEIPLCOOKIE 9
|
||||
.Os
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh NAME
|
||||
.Nm makeiplcookie
|
||||
.Nd compose an ipl cookie.
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh SYNOPSIS
|
||||
.In sys/param.h
|
||||
.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
.Ft ipl_cookie_t
|
||||
.Fn makeiplcookie \
|
||||
"ipl_t ipl"
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh DESCRIPTION
|
||||
.Fn makeiplcookie
|
||||
composed a cookie which can be fed into
|
||||
.Fa splraiseipl .
|
||||
.Fa ipl
|
||||
should be one of
|
||||
.Dv IPL_
|
||||
constants.
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh RETURN VALUES
|
||||
.Fn makeiplcookie
|
||||
returns a composed cookie.
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh SEE ALSO
|
||||
.Xr spl 9 ,
|
||||
.Xr splraiseipl 9
|
88
share/man/man9/splraiseipl.9
Normal file
88
share/man/man9/splraiseipl.9
Normal file
@ -0,0 +1,88 @@
|
||||
.\" $NetBSD: splraiseipl.9,v 1.1 2006/12/21 16:01:13 yamt Exp $
|
||||
.\"
|
||||
.\" Copyright (c)2006 YAMAMOTO Takashi,
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" ------------------------------------------------------------
|
||||
.Dd December 22, 2006
|
||||
.Dt SPLRAISEIPL 9
|
||||
.Os
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh NAME
|
||||
.Nm splraiseipl
|
||||
.Nd raise the system priority level.
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh SYNOPSIS
|
||||
.In sys/param.h
|
||||
.\" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
.Ft int
|
||||
.Fn splraiseipl \
|
||||
"ipl_cookie_t icookie"
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh DESCRIPTION
|
||||
.Fn splraiseipl
|
||||
raises the system priority level to the level specified by
|
||||
.Fa icookie .
|
||||
.Fa icookie
|
||||
should be a value returned by
|
||||
.Fn makeiplcookie .
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh RETURN VALUES
|
||||
.Fn splraiseipl
|
||||
returns saved priority level which can be used for
|
||||
.Fn splx .
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh EXAMPLES
|
||||
The following two lines are functional equivalents.
|
||||
.Bd -literal
|
||||
s = splraiseipl(makeiplcookie(IPL_BIO));
|
||||
.Ed
|
||||
.Bd -literal
|
||||
s = splbio();
|
||||
.Ed
|
||||
.Pp
|
||||
Becuase
|
||||
.Fn makeiplcookie
|
||||
can be slow and is not expected to be used in a perfomance critical path,
|
||||
it's better to do it beforehand.
|
||||
.Bd -literal
|
||||
initialization_code(ipl_t ipl)
|
||||
{
|
||||
|
||||
ourcookie = makeiplcookie(ipl);
|
||||
}
|
||||
|
||||
performance_critical_code()
|
||||
{
|
||||
int s;
|
||||
|
||||
s = splraiseipl(ourcookie);
|
||||
do_something();
|
||||
splx(s);
|
||||
}
|
||||
.Ed
|
||||
.\" ------------------------------------------------------------
|
||||
.Sh SEE ALSO
|
||||
.Xr makeiplcookie 9 ,
|
||||
.Xr spl 9
|
Loading…
Reference in New Issue
Block a user