1kstat_install(9F) Kernel Functions for Drivers kstat_install(9F)
2
3
4
6 kstat_install - add a fully initialized kstat to the system
7
9 #include <sys/types.h>
10 #include <sys/kstat.h>
11
12
13
14 void kstat_install(kstat_t *ksp);
15
16
18 Solaris DDI specific (Solaris DDI)
19
21 ksp Pointer to a fully initialized kstat(9S) structure.
22
23
25 kstat_install() is used in conjunction with kstat_create(9F) to allo‐
26 cate and initialize a kstat(9S) structure.
27
28
29 After a successful call to kstat_create() the driver must perform any
30 necessary initialization of the data section (such as setting the name
31 fields in a kstat of type KSTAT_TYPE_NAMED). Virtual kstats must have
32 the ks_data field set at this time. The provider may also set the
33 ks_update, ks_private, and ks_lock fields if necessary.
34
35
36 Once the kstat is completely initialized, kstat_install is used to make
37 the kstat accessible to the outside world.
38
40 None.
41
43 kstat_install() can be called from user or kernel context.
44
46 Example 1 Allocating and Initializing a kstat Structure
47
48
49 The method for allocating and initializing a kstat structure is gener‐
50 ally as follows:
51
52
53 kstat_t *ksp;
54 ksp = kstat_create(module, instance, name, class, type, ndata, flags);
55 if (ksp) {
56 /* ... provider initialization, if necessary */
57 kstat_install(ksp);
58 }
59
60
62 kstat_create(9F), kstat_delete(9F), kstat_named_init(9F), kstat(9S)
63
64
65 Writing Device Drivers
66
67
68
69SunOS 5.11 26 May 1994 kstat_install(9F)