FreeBSD kernel kern code
kern_khelp.c File Reference
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/hhook.h>
#include <sys/khelp.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/module_khelp.h>
#include <sys/osd.h>
#include <sys/queue.h>
#include <sys/refcount.h>
#include <sys/rwlock.h>
#include <sys/systm.h>
Include dependency graph for kern_khelp.c:

Go to the source code of this file.

Macros

#define KHELP_LIST_WLOCK()   rw_wlock(&khelp_list_lock)
 
#define KHELP_LIST_WUNLOCK()   rw_wunlock(&khelp_list_lock)
 
#define KHELP_LIST_RLOCK()   rw_rlock(&khelp_list_lock)
 
#define KHELP_LIST_RUNLOCK()   rw_runlock(&khelp_list_lock)
 
#define KHELP_LIST_LOCK_ASSERT()   rw_assert(&khelp_list_lock, RA_LOCKED)
 

Functions

 __FBSDID ("$BSDSUniX$")
 
 RW_SYSINIT (khelplistlock,&khelp_list_lock,"helper list lock")
 
static TAILQ_HEAD (helper_head, helper)
 
int khelp_deregister_helper (struct helper *h)
 
int khelp_init_osd (uint32_t classes, struct osd *hosd)
 
int khelp_destroy_osd (struct osd *hosd)
 
static void khelp_remove_osd (struct helper *h, struct osd *hosd)
 
void * khelp_get_osd (struct osd *hosd, int32_t id)
 
int32_t khelp_get_id (char *hname)
 
int khelp_add_hhook (struct hookinfo *hki, uint32_t flags)
 
int khelp_remove_hhook (struct hookinfo *hki)
 
void khelp_new_hhook_registered (struct hhook_head *hhh, uint32_t flags)
 
int khelp_modevent (module_t mod, int event_type, void *data)
 

Variables

static struct rwlock khelp_list_lock
 

Macro Definition Documentation

#define KHELP_LIST_LOCK_ASSERT ( )    rw_assert(&khelp_list_lock, RA_LOCKED)
#define KHELP_LIST_RLOCK ( )    rw_rlock(&khelp_list_lock)
#define KHELP_LIST_RUNLOCK ( )    rw_runlock(&khelp_list_lock)
#define KHELP_LIST_WLOCK ( )    rw_wlock(&khelp_list_lock)
#define KHELP_LIST_WUNLOCK ( )    rw_wunlock(&khelp_list_lock)

Function Documentation

__FBSDID ( "$BSDSUniX$"  )
int khelp_add_hhook ( struct hookinfo *  hki,
uint32_t  flags 
)

Definition at line 257 of file kern_khelp.c.

References hhook_add_hook_lookup().

Here is the call graph for this function:

int khelp_deregister_helper ( struct helper *  h)

Definition at line 119 of file kern_khelp.c.

References hhook_remove_hook_lookup(), KHELP_LIST_WLOCK, KHELP_LIST_WUNLOCK, and osd_deregister().

Referenced by khelp_modevent().

Here is the call graph for this function:

Here is the caller graph for this function:

int khelp_destroy_osd ( struct osd *  hosd)

Definition at line 186 of file kern_khelp.c.

References KHELP_LIST_RLOCK, KHELP_LIST_RUNLOCK, and khelp_remove_osd().

Here is the call graph for this function:

int32_t khelp_get_id ( char *  hname)

Definition at line 237 of file kern_khelp.c.

References KHELP_LIST_RLOCK, and KHELP_LIST_RUNLOCK.

void* khelp_get_osd ( struct osd *  hosd,
int32_t  id 
)

Definition at line 230 of file kern_khelp.c.

References osd_get().

Here is the call graph for this function:

int khelp_init_osd ( uint32_t  classes,
struct osd *  hosd 
)

Definition at line 149 of file kern_khelp.c.

References KHELP_LIST_RLOCK, KHELP_LIST_RUNLOCK, khelp_remove_osd(), and osd_set().

Here is the call graph for this function:

int khelp_modevent ( module_t  mod,
int  event_type,
void *  data 
)

Definition at line 315 of file kern_khelp.c.

References khelp_deregister_helper(), and printf().

Here is the call graph for this function:

void khelp_new_hhook_registered ( struct hhook_head *  hhh,
uint32_t  flags 
)

Definition at line 289 of file kern_khelp.c.

References hhook_add_hook(), KHELP_LIST_RLOCK, KHELP_LIST_RUNLOCK, and printf().

Referenced by hhook_head_register().

Here is the call graph for this function:

Here is the caller graph for this function:

int khelp_remove_hhook ( struct hookinfo *  hki)

Definition at line 271 of file kern_khelp.c.

References hhook_remove_hook_lookup().

Here is the call graph for this function:

static void khelp_remove_osd ( struct helper *  h,
struct osd *  hosd 
)
inlinestatic

Definition at line 210 of file kern_khelp.c.

References osd_del(), and osd_get().

Referenced by khelp_destroy_osd(), and khelp_init_osd().

Here is the call graph for this function:

Here is the caller graph for this function:

RW_SYSINIT ( khelplistlock  ,
khelp_list_lock,
"helper list lock"   
)
static TAILQ_HEAD ( helper_head  ,
helper   
)
static

Definition at line 57 of file kern_khelp.c.

References hhook_add_hook_lookup(), hhook_remove_hook_lookup(), KHELP_LIST_WLOCK, KHELP_LIST_WUNLOCK, osd_deregister(), osd_register(), and printf().

Here is the call graph for this function:

Variable Documentation

struct rwlock khelp_list_lock
static

Definition at line 54 of file kern_khelp.c.