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 ("$FreeBSD$")
 
 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

◆ KHELP_LIST_LOCK_ASSERT

#define KHELP_LIST_LOCK_ASSERT ( )    rw_assert(&khelp_list_lock, RA_LOCKED)

◆ KHELP_LIST_RLOCK

#define KHELP_LIST_RLOCK ( )    rw_rlock(&khelp_list_lock)

◆ KHELP_LIST_RUNLOCK

#define KHELP_LIST_RUNLOCK ( )    rw_runlock(&khelp_list_lock)

◆ KHELP_LIST_WLOCK

#define KHELP_LIST_WLOCK ( )    rw_wlock(&khelp_list_lock)

◆ KHELP_LIST_WUNLOCK

#define KHELP_LIST_WUNLOCK ( )    rw_wunlock(&khelp_list_lock)

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ khelp_add_hhook()

int khelp_add_hhook ( struct hookinfo *  hki,
uint32_t  flags 
)

Definition at line 259 of file kern_khelp.c.

References flags, and hhook_add_hook_lookup().

Here is the call graph for this function:

◆ khelp_deregister_helper()

int khelp_deregister_helper ( struct helper *  h)

Definition at line 121 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:

◆ khelp_destroy_osd()

int khelp_destroy_osd ( struct osd *  hosd)

Definition at line 188 of file kern_khelp.c.

References KHELP_LIST_RLOCK, KHELP_LIST_RUNLOCK, and khelp_remove_osd().

Referenced by sodealloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ khelp_get_id()

int32_t khelp_get_id ( char *  hname)

Definition at line 239 of file kern_khelp.c.

References KHELP_LIST_RLOCK, and KHELP_LIST_RUNLOCK.

◆ khelp_get_osd()

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

Definition at line 232 of file kern_khelp.c.

References osd_get().

Here is the call graph for this function:

◆ khelp_init_osd()

int khelp_init_osd ( uint32_t  classes,
struct osd *  hosd 
)

Definition at line 151 of file kern_khelp.c.

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

Referenced by soalloc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ khelp_modevent()

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

Definition at line 317 of file kern_khelp.c.

References data, khelp_deregister_helper(), and printf().

Here is the call graph for this function:

◆ khelp_new_hhook_registered()

void khelp_new_hhook_registered ( struct hhook_head *  hhh,
uint32_t  flags 
)

Definition at line 291 of file kern_khelp.c.

References flags, 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:

◆ khelp_remove_hhook()

int khelp_remove_hhook ( struct hookinfo *  hki)

Definition at line 273 of file kern_khelp.c.

References hhook_remove_hook_lookup().

Here is the call graph for this function:

◆ khelp_remove_osd()

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

Definition at line 212 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()

RW_SYSINIT ( khelplistlock  ,
khelp_list_lock,
"helper list lock"   
)

◆ TAILQ_HEAD()

static TAILQ_HEAD ( helper_head  ,
helper   
)
static

Definition at line 59 of file kern_khelp.c.

Variable Documentation

◆ khelp_list_lock

struct rwlock khelp_list_lock
static

Definition at line 56 of file kern_khelp.c.