Lines Matching refs:this_leaf
35 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
38 return sib_leaf->fw_token == this_leaf->fw_token;
74 static void cache_size(struct cacheinfo *this_leaf, struct device_node *np)
79 ct_idx = get_cacheinfo_idx(this_leaf->type);
82 of_property_read_u32(np, propname, &this_leaf->size);
86 static void cache_get_line_size(struct cacheinfo *this_leaf,
91 ct_idx = get_cacheinfo_idx(this_leaf->type);
102 this_leaf->coherency_line_size = line_size;
108 static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np)
113 ct_idx = get_cacheinfo_idx(this_leaf->type);
116 of_property_read_u32(np, propname, &this_leaf->number_of_sets);
119 static void cache_associativity(struct cacheinfo *this_leaf)
121 unsigned int line_size = this_leaf->coherency_line_size;
122 unsigned int nr_sets = this_leaf->number_of_sets;
123 unsigned int size = this_leaf->size;
130 this_leaf->ways_of_associativity = (size / nr_sets) / line_size;
133 static bool cache_node_is_unified(struct cacheinfo *this_leaf,
139 static void cache_of_set_props(struct cacheinfo *this_leaf,
147 if (this_leaf->type == CACHE_TYPE_NOCACHE &&
148 cache_node_is_unified(this_leaf, np))
149 this_leaf->type = CACHE_TYPE_UNIFIED;
150 cache_size(this_leaf, np);
151 cache_get_line_size(this_leaf, np);
152 cache_nr_sets(this_leaf, np);
153 cache_associativity(this_leaf);
159 struct cacheinfo *this_leaf;
180 this_leaf = this_cpu_ci->info_list + index;
181 if (this_leaf->level != 1)
187 cache_of_set_props(this_leaf, np);
188 this_leaf->fw_token = np;
199 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
207 return !(this_leaf->level == 1);
221 struct cacheinfo *this_leaf, *sib_leaf;
239 this_leaf = this_cpu_ci->info_list + index;
241 if (!cpumask_empty(&this_leaf->shared_cpu_map))
244 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map);
251 if (cache_leaves_are_shared(this_leaf, sib_leaf)) {
253 cpumask_set_cpu(i, &this_leaf->shared_cpu_map);
257 if (this_leaf->coherency_line_size > coherency_max_size)
258 coherency_max_size = this_leaf->coherency_line_size;
267 struct cacheinfo *this_leaf, *sib_leaf;
271 this_leaf = this_cpu_ci->info_list + index;
272 for_each_cpu(sibling, &this_leaf->shared_cpu_map) {
284 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
287 of_node_put(this_leaf->fw_token);
364 struct cacheinfo *this_leaf = dev_get_drvdata(dev); \
365 return sysfs_emit(buf, "%u\n", this_leaf->object); \
378 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
380 return sysfs_emit(buf, "%uK\n", this_leaf->size >> 10);
386 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
387 const struct cpumask *mask = &this_leaf->shared_cpu_map;
395 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
396 const struct cpumask *mask = &this_leaf->shared_cpu_map;
404 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
407 switch (this_leaf->type) {
427 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
428 unsigned int ci_attr = this_leaf->attributes;
446 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
447 unsigned int ci_attr = this_leaf->attributes;
491 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
492 const struct cpumask *mask = &this_leaf->shared_cpu_map;
495 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID))
497 if ((attr == &dev_attr_type.attr) && this_leaf->type)
499 if ((attr == &dev_attr_level.attr) && this_leaf->level)
506 this_leaf->coherency_line_size)
509 this_leaf->size) /* allow 0 = full associativity */
512 this_leaf->number_of_sets)
514 if ((attr == &dev_attr_size.attr) && this_leaf->size)
517 (this_leaf->attributes & CACHE_WRITE_POLICY_MASK))
520 (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK))
523 this_leaf->physical_line_partition)
546 __weak cache_get_priv_group(struct cacheinfo *this_leaf)
552 cache_get_attribute_groups(struct cacheinfo *this_leaf)
555 cache_get_priv_group(this_leaf);
615 struct cacheinfo *this_leaf;
625 this_leaf = this_cpu_ci->info_list + i;
626 if (this_leaf->disable_sysfs)
628 if (this_leaf->type == CACHE_TYPE_NOCACHE)
630 cache_groups = cache_get_attribute_groups(this_leaf);
631 ci_dev = cpu_device_create(parent, this_leaf, cache_groups,