Print this page
fixup .text where possible
7127  remove -Wno-missing-braces from Makefile.uts


  30 #include <sys/errno.h>
  31 #include <sys/kmem.h>
  32 #include <sys/mutex.h>
  33 #include <sys/condvar.h>
  34 #include <sys/modctl.h>
  35 #include <sys/hook_impl.h>
  36 #include <sys/sdt.h>
  37 #include <sys/cmn_err.h>
  38 
  39 /*
  40  * This file provides kernel hook framework.
  41  */
  42 
  43 static struct modldrv modlmisc = {
  44         &mod_miscops,                               /* drv_modops */
  45         "Hooks Interface v1.0",                 /* drv_linkinfo */
  46 };
  47 
  48 static struct modlinkage modlinkage = {
  49         MODREV_1,                               /* ml_rev */
  50         &modlmisc,                          /* ml_linkage */
  51         NULL
  52 };
  53 
  54 static const char *hook_hintvalue_none = "<none>";
  55 
  56 /*
  57  * How it works.
  58  * =============
  59  * Use of the hook framework here is tied up with zones - when a new zone
  60  * is created, we create a new hook_stack_t and are open to business for
  61  * allowing new hook families and their events.
  62  *
  63  * A consumer of these hooks is expected to operate in this fashion:
  64  * 1) call hook_family_add() to create a new family of hooks. It is a
  65  *    current requirement that this call must be made with the value
  66  *    returned from hook_stack_init, by way of infrastructure elsewhere.
  67  * 2) add events to the registered family with calls to hook_event_add.
  68  *
  69  * At this point, the structures in place should be open to others to
  70  * add hooks to the event or add notifiers for when the contents of the
  71  * hook stack changes.




  30 #include <sys/errno.h>
  31 #include <sys/kmem.h>
  32 #include <sys/mutex.h>
  33 #include <sys/condvar.h>
  34 #include <sys/modctl.h>
  35 #include <sys/hook_impl.h>
  36 #include <sys/sdt.h>
  37 #include <sys/cmn_err.h>
  38 
  39 /*
  40  * This file provides kernel hook framework.
  41  */
  42 
  43 static struct modldrv modlmisc = {
  44         &mod_miscops,                               /* drv_modops */
  45         "Hooks Interface v1.0",                 /* drv_linkinfo */
  46 };
  47 
  48 static struct modlinkage modlinkage = {
  49         MODREV_1,                               /* ml_rev */
  50         {   &modlmisc,                              /* ml_linkage */
  51             NULL }
  52 };
  53 
  54 static const char *hook_hintvalue_none = "<none>";
  55 
  56 /*
  57  * How it works.
  58  * =============
  59  * Use of the hook framework here is tied up with zones - when a new zone
  60  * is created, we create a new hook_stack_t and are open to business for
  61  * allowing new hook families and their events.
  62  *
  63  * A consumer of these hooks is expected to operate in this fashion:
  64  * 1) call hook_family_add() to create a new family of hooks. It is a
  65  *    current requirement that this call must be made with the value
  66  *    returned from hook_stack_init, by way of infrastructure elsewhere.
  67  * 2) add events to the registered family with calls to hook_event_add.
  68  *
  69  * At this point, the structures in place should be open to others to
  70  * add hooks to the event or add notifiers for when the contents of the
  71  * hook stack changes.