~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/intel_th.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Intel(R) Trace Hub data structures for implementing buffer sinks.
  4  *
  5  * Copyright (C) 2019 Intel Corporation.
  6  */
  7 
  8 #ifndef _INTEL_TH_H_
  9 #define _INTEL_TH_H_
 10 
 11 #include <linux/scatterlist.h>
 12 
 13 /* MSC operating modes (MSC_MODE) */
 14 enum {
 15         MSC_MODE_SINGLE = 0,
 16         MSC_MODE_MULTI,
 17         MSC_MODE_EXI,
 18         MSC_MODE_DEBUG,
 19 };
 20 
 21 struct msu_buffer {
 22         const char      *name;
 23         /*
 24          * ->assign() called when buffer 'mode' is set to this driver
 25          *   (aka mode_store())
 26          * @device:     struct device * of the msc
 27          * @mode:       allows the driver to set HW mode (see the enum above)
 28          * Returns:     a pointer to a private structure associated with this
 29          *              msc or NULL in case of error. This private structure
 30          *              will then be passed into all other callbacks.
 31          */
 32         void    *(*assign)(struct device *dev, int *mode);
 33         /* ->unassign():        some other mode is selected, clean up */
 34         void    (*unassign)(void *priv);
 35         /*
 36          * ->alloc_window(): allocate memory for the window of a given
 37          *              size
 38          * @sgt:        pointer to sg_table, can be overridden by the buffer
 39          *              driver, or kept intact
 40          * Returns:     number of sg table entries <= number of pages;
 41          *              0 is treated as an allocation failure.
 42          */
 43         int     (*alloc_window)(void *priv, struct sg_table **sgt,
 44                                 size_t size);
 45         void    (*free_window)(void *priv, struct sg_table *sgt);
 46         /* ->activate():        trace has started */
 47         void    (*activate)(void *priv);
 48         /* ->deactivate():      trace is about to stop */
 49         void    (*deactivate)(void *priv);
 50         /*
 51          * ->ready():   window @sgt is filled up to the last block OR
 52          *              tracing is stopped by the user; this window contains
 53          *              @bytes data. The window in question transitions into
 54          *              the "LOCKED" state, indicating that it can't be used
 55          *              by hardware. To clear this state and make the window
 56          *              available to the hardware again, call
 57          *              intel_th_msc_window_unlock().
 58          */
 59         int     (*ready)(void *priv, struct sg_table *sgt, size_t bytes);
 60 };
 61 
 62 int intel_th_msu_buffer_register(const struct msu_buffer *mbuf,
 63                                  struct module *owner);
 64 void intel_th_msu_buffer_unregister(const struct msu_buffer *mbuf);
 65 void intel_th_msc_window_unlock(struct device *dev, struct sg_table *sgt);
 66 
 67 #define module_intel_th_msu_buffer(__buffer) \
 68 static int __init __buffer##_init(void) \
 69 { \
 70         return intel_th_msu_buffer_register(&(__buffer), THIS_MODULE); \
 71 } \
 72 module_init(__buffer##_init); \
 73 static void __exit __buffer##_exit(void) \
 74 { \
 75         intel_th_msu_buffer_unregister(&(__buffer)); \
 76 } \
 77 module_exit(__buffer##_exit);
 78 
 79 #endif /* _INTEL_TH_H_ */
 80 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php