Lines Matching refs:NAME
42 #define DECLARE_ATTR_CAP_CLASS_HELPERS(NAME) \ argument
43 enum { NAME##_BITMAP_BITS = NAME##_COUNT * AMDGPU_CAP_ATTR_BITS }; \
44 struct NAME##_caps { \
45 DECLARE_BITMAP(bmap, NAME##_BITMAP_BITS); \
47 static inline unsigned int NAME##_ATTR_START(enum NAME##_cap_id cap) \
49 static inline void NAME##_attr_init(struct NAME##_caps *c) \
50 { if (c) bitmap_zero(c->bmap, NAME##_BITMAP_BITS); } \
51 static inline int NAME##_attr_set(struct NAME##_caps *c, \
52 enum NAME##_cap_id cap, enum amdgpu_cap_attr attr) \
56 if (cap >= NAME##_COUNT) \
61 NAME##_ATTR_START(cap), AMDGPU_CAP_ATTR_BITS); \
64 static inline int NAME##_attr_get(const struct NAME##_caps *c, \
65 enum NAME##_cap_id cap, enum amdgpu_cap_attr *out) \
70 if (cap >= NAME##_COUNT) \
72 v = bitmap_read(c->bmap, NAME##_ATTR_START(cap), AMDGPU_CAP_ATTR_BITS); \
76 static inline bool NAME##_cap_is_ro(const struct NAME##_caps *c, enum NAME##_cap_id id) \
77 { enum amdgpu_cap_attr a; return !NAME##_attr_get(c, id, &a) && a == AMDGPU_CAP_ATTR_RO; } \
78 static inline bool NAME##_cap_is_wo(const struct NAME##_caps *c, enum NAME##_cap_id id) \
79 { enum amdgpu_cap_attr a; return !NAME##_attr_get(c, id, &a) && a == AMDGPU_CAP_ATTR_WO; } \
80 static inline bool NAME##_cap_is_rw(const struct NAME##_caps *c, enum NAME##_cap_id id) \
81 { enum amdgpu_cap_attr a; return !NAME##_attr_get(c, id, &a) && a == AMDGPU_CAP_ATTR_RW; }
87 #define DECLARE_ATTR_CAP_CLASS(NAME, LIST_MACRO) \ argument
88 enum NAME##_cap_id { LIST_MACRO(_CAP_ENUM_ELEM) NAME##_COUNT }; \
89 DECLARE_ATTR_CAP_CLASS_HELPERS(NAME)