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

TOMOYO Linux Cross Reference
Linux/arch/sparc/include/asm/mdesc.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 #ifndef _SPARC64_MDESC_H
  3 #define _SPARC64_MDESC_H
  4 
  5 #include <linux/types.h>
  6 #include <linux/cpumask.h>
  7 #include <asm/prom.h>
  8 
  9 struct mdesc_handle;
 10 
 11 /* Machine description operations are to be surrounded by grab and
 12  * release calls.  The mdesc_handle returned from the grab is
 13  * the first argument to all of the operational calls that work
 14  * on mdescs.
 15  */
 16 struct mdesc_handle *mdesc_grab(void);
 17 void mdesc_release(struct mdesc_handle *);
 18 
 19 #define MDESC_NODE_NULL         (~(u64)0)
 20 #define MDESC_MAX_STR_LEN       256
 21 
 22 u64 mdesc_node_by_name(struct mdesc_handle *handle,
 23                        u64 from_node, const char *name);
 24 #define mdesc_for_each_node_by_name(__hdl, __node, __name) \
 25         for (__node = mdesc_node_by_name(__hdl, MDESC_NODE_NULL, __name); \
 26              (__node) != MDESC_NODE_NULL; \
 27              __node = mdesc_node_by_name(__hdl, __node, __name))
 28 
 29 /* Access to property values returned from mdesc_get_property() are
 30  * only valid inside of a mdesc_grab()/mdesc_release() sequence.
 31  * Once mdesc_release() is called, the memory backed up by these
 32  * pointers may reference freed up memory.
 33  *
 34  * Therefore callers must make copies of any property values
 35  * they need.
 36  *
 37  * These same rules apply to mdesc_node_name().
 38  */
 39 const void *mdesc_get_property(struct mdesc_handle *handle,
 40                                u64 node, const char *name, int *lenp);
 41 const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);
 42 
 43 /* MD arc iteration, the standard sequence is:
 44  *
 45  *      unsigned long arc;
 46  *      mdesc_for_each_arc(arc, handle, node, MDESC_ARC_TYPE_{FWD,BACK}) {
 47  *              unsigned long target = mdesc_arc_target(handle, arc);
 48  *              ...
 49  *      }
 50  */
 51 
 52 #define MDESC_ARC_TYPE_FWD      "fwd"
 53 #define MDESC_ARC_TYPE_BACK     "back"
 54 
 55 u64 mdesc_next_arc(struct mdesc_handle *handle, u64 from,
 56                    const char *arc_type);
 57 #define mdesc_for_each_arc(__arc, __hdl, __node, __type) \
 58         for (__arc = mdesc_next_arc(__hdl, __node, __type); \
 59              (__arc) != MDESC_NODE_NULL; \
 60              __arc = mdesc_next_arc(__hdl, __arc, __type))
 61 
 62 u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc);
 63 
 64 void mdesc_update(void);
 65 
 66 struct mdesc_notifier_client {
 67         void (*add)(struct mdesc_handle *handle, u64 node,
 68                     const char *node_name);
 69         void (*remove)(struct mdesc_handle *handle, u64 node,
 70                        const char *node_name);
 71         const char                      *node_name;
 72         struct mdesc_notifier_client    *next;
 73 };
 74 
 75 void mdesc_register_notifier(struct mdesc_notifier_client *client);
 76 
 77 union md_node_info {
 78         struct vdev_port {
 79                 u64 id;                         /* id */
 80                 u64 parent_cfg_hdl;             /* parent config handle */
 81                 const char *name;               /* name (property) */
 82         } vdev_port;
 83         struct ds_port {
 84                 u64 id;                         /* id */
 85         } ds_port;
 86 };
 87 
 88 u64 mdesc_get_node(struct mdesc_handle *hp, const char *node_name,
 89                    union md_node_info *node_info);
 90 int mdesc_get_node_info(struct mdesc_handle *hp, u64 node,
 91                         const char *node_name, union md_node_info *node_info);
 92 
 93 void mdesc_fill_in_cpu_data(cpumask_t *mask);
 94 void mdesc_populate_present_mask(cpumask_t *mask);
 95 void mdesc_get_page_sizes(cpumask_t *mask, unsigned long *pgsz_mask);
 96 
 97 void sun4v_mdesc_init(void);
 98 
 99 #endif
100 

~ [ 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