FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/kobj.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
Go to the source code of this file.
Macros | |
#define | KOBJ_LOCK() mtx_lock(&kobj_mtx) |
#define | KOBJ_UNLOCK() mtx_unlock(&kobj_mtx) |
#define | KOBJ_ASSERT(what) mtx_assert(&kobj_mtx, what); |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_KOBJ, "kobj", "Kernel object structures") |
SYSCTL_INT (_kern, OID_AUTO, kobj_methodcount, CTLFLAG_RD, &kobj_next_id, 0, "Number of kernel object methods registered") | |
static void | kobj_init_mutex (void *arg) |
SYSINIT (kobj, SI_SUB_LOCK, SI_ORDER_ANY, kobj_init_mutex, NULL) | |
int | kobj_error_method (void) |
static void | kobj_class_compile_common (kobj_class_t cls, kobj_ops_t ops) |
static int | kobj_class_compile1 (kobj_class_t cls, int mflags) |
void | kobj_class_compile (kobj_class_t cls) |
void | kobj_class_compile_static (kobj_class_t cls, kobj_ops_t ops) |
static kobj_method_t * | kobj_lookup_method_class (kobj_class_t cls, kobjop_desc_t desc) |
static kobj_method_t * | kobj_lookup_method_mi (kobj_class_t cls, kobjop_desc_t desc) |
kobj_method_t * | kobj_lookup_method (kobj_class_t cls, kobj_method_t **cep, kobjop_desc_t desc) |
void | kobj_class_free (kobj_class_t cls) |
static void | kobj_init_common (kobj_t obj, kobj_class_t cls) |
static int | kobj_init1 (kobj_t obj, kobj_class_t cls, int mflags) |
kobj_t | kobj_create (kobj_class_t cls, struct malloc_type *mtype, int mflags) |
void | kobj_init (kobj_t obj, kobj_class_t cls) |
void | kobj_init_static (kobj_t obj, kobj_class_t cls) |
void | kobj_delete (kobj_t obj, struct malloc_type *mtype) |
Variables | |
static struct mtx | kobj_mtx |
static int | kobj_mutex_inited |
static int | kobj_next_id = 1 |
static const struct kobj_method | null_method |
#define KOBJ_ASSERT | ( | what | ) | mtx_assert(&kobj_mtx, what); |
Definition at line 67 of file subr_kobj.c.
#define KOBJ_LOCK | ( | ) | mtx_lock(&kobj_mtx) |
Definition at line 65 of file subr_kobj.c.
#define KOBJ_UNLOCK | ( | ) | mtx_unlock(&kobj_mtx) |
Definition at line 66 of file subr_kobj.c.
__FBSDID | ( | "$FreeBSD$" | ) |
void kobj_class_compile | ( | kobj_class_t | cls | ) |
Definition at line 157 of file subr_kobj.c.
References kobj_class_compile1().
Referenced by devclass_add_driver(), linker_add_class(), and root_bus_module_handler().
|
static |
Definition at line 130 of file subr_kobj.c.
References free(), KOBJ_ASSERT, kobj_class_compile_common(), KOBJ_LOCK, KOBJ_UNLOCK, and malloc().
Referenced by kobj_class_compile(), and kobj_init1().
|
static |
Definition at line 101 of file subr_kobj.c.
References kobj_next_id, and null_method.
Referenced by kobj_class_compile1(), and kobj_class_compile_static().
void kobj_class_compile_static | ( | kobj_class_t | cls, |
kobj_ops_t | ops | ||
) |
Definition at line 166 of file subr_kobj.c.
References kobj_class_compile_common(), and kobj_mutex_inited.
void kobj_class_free | ( | kobj_class_t | cls | ) |
Definition at line 233 of file subr_kobj.c.
References free(), KOBJ_ASSERT, KOBJ_LOCK, and KOBJ_UNLOCK.
Referenced by devclass_delete_driver(), and kobj_delete().
kobj_t kobj_create | ( | kobj_class_t | cls, |
struct malloc_type * | mtype, | ||
int | mflags | ||
) |
Definition at line 295 of file subr_kobj.c.
References free(), kobj_init1(), and malloc().
Referenced by linker_make_file().
void kobj_delete | ( | kobj_t | obj, |
struct malloc_type * | mtype | ||
) |
Definition at line 330 of file subr_kobj.c.
References free(), KOBJ_ASSERT, kobj_class_free(), KOBJ_LOCK, and KOBJ_UNLOCK.
Referenced by device_delete_child(), device_set_driver(), linker_file_unload(), and make_device().
int kobj_error_method | ( | void | ) |
Definition at line 94 of file subr_kobj.c.
void kobj_init | ( | kobj_t | obj, |
kobj_class_t | cls | ||
) |
Definition at line 310 of file subr_kobj.c.
References kobj_init1(), and panic().
Referenced by device_set_driver(), make_device(), and root_bus_module_handler().
|
static |
Definition at line 272 of file subr_kobj.c.
References kobj_class_compile1(), kobj_init_common(), KOBJ_LOCK, and KOBJ_UNLOCK.
Referenced by kobj_create(), and kobj_init().
|
static |
Definition at line 264 of file subr_kobj.c.
Referenced by kobj_init1(), and kobj_init_static().
|
static |
Definition at line 74 of file subr_kobj.c.
References kobj_mtx, and kobj_mutex_inited.
void kobj_init_static | ( | kobj_t | obj, |
kobj_class_t | cls | ||
) |
Definition at line 320 of file subr_kobj.c.
References kobj_init_common(), and kobj_mutex_inited.
kobj_method_t * kobj_lookup_method | ( | kobj_class_t | cls, |
kobj_method_t ** | cep, | ||
kobjop_desc_t | desc | ||
) |
Definition at line 218 of file subr_kobj.c.
References kobj_lookup_method_mi().
|
static |
Definition at line 180 of file subr_kobj.c.
Referenced by kobj_lookup_method_mi().
|
static |
Definition at line 195 of file subr_kobj.c.
References kobj_lookup_method_class(), and kobj_lookup_method_mi().
Referenced by kobj_lookup_method(), and kobj_lookup_method_mi().
|
static |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
kobj_methodcount | , | ||
CTLFLAG_RD | , | ||
& | kobj_next_id, | ||
0 | , | ||
"Number of kernel object methods registered" | |||
) |
SYSINIT | ( | kobj | , |
SI_SUB_LOCK | , | ||
SI_ORDER_ANY | , | ||
kobj_init_mutex | , | ||
NULL | |||
) |
|
static |
Definition at line 61 of file subr_kobj.c.
Referenced by kobj_init_mutex().
|
static |
Definition at line 62 of file subr_kobj.c.
Referenced by kobj_class_compile_static(), kobj_init_mutex(), and kobj_init_static().
|
static |
Definition at line 63 of file subr_kobj.c.
Referenced by kobj_class_compile_common().
|
static |
Definition at line 89 of file subr_kobj.c.
Referenced by kobj_class_compile_common().