summaryrefslogtreecommitdiffstats
path: root/share/man/man9
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile3
-rw-r--r--share/man/man9/kobj.916
2 files changed, 16 insertions, 3 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 3026ef8..0870355 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -724,7 +724,8 @@ MLINKS+=kobj.9 DEFINE_CLASS.9 \
kobj.9 kobj_class_free.9 \
kobj.9 kobj_create.9 \
kobj.9 kobj_delete.9 \
- kobj.9 kobj_init.9
+ kobj.9 kobj_init.9 \
+ kobj.9 kobj_init_static.9
MLINKS+=kproc.9 kproc_create.9 \
kproc.9 kproc_exit.9 \
kproc.9 kproc_resume.9 \
diff --git a/share/man/man9/kobj.9 b/share/man/man9/kobj.9
index aed1244..0e1745e 100644
--- a/share/man/man9/kobj.9
+++ b/share/man/man9/kobj.9
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 4, 2000
+.Dd November 14, 2011
.Dt KOBJ 9
.Os
.Sh NAME
@@ -48,6 +48,8 @@
.Ft void
.Fn kobj_init "kobj_t obj" "kobj_class_t cls"
.Ft void
+.Fn kobj_init_static "kobj_t obj" "kobj_class_t cls"
+.Ft void
.Fn kobj_delete "kobj_t obj" "struct malloc_type *mtype"
.Fn DEFINE_CLASS name "kobj_method_t *methods" "size_t size"
.Sh DESCRIPTION
@@ -88,10 +90,14 @@ Objects created in this way should be freed by calling
Clients which would like to manage the allocation of memory
themselves should call
.Fn kobj_init
+or
+.Fn kobj_init_static
with a pointer to the memory for the object and the class which
implements it.
It is also possible to use
.Fn kobj_init
+and
+.Fn kobj_init_static
to change the class for an object.
This should be done with care as the classes must agree on the layout
of the object.
@@ -109,13 +115,19 @@ A client should not normally need to call these since a class
will automatically be compiled the first time it is used.
If a class is to be used before
.Xr malloc 9
-is initialised,
+and
+.Xr mutex 9
+are initialised,
then
.Fn kobj_class_compile_static
should be called with the class and a pointer to a statically
allocated
.Vt kobj_ops
structure before the class is used to initialise any objects.
+In that case, also
+.Fn kobj_init_static
+should be used instead of
+.Fn kobj_init .
.Pp
To define a class, first define a simple array of
.Vt kobj_method_t .
OpenPOWER on IntegriCloud