Lines Matching refs:this_leaf

39 static inline bool cache_leaves_are_shared(struct cacheinfo *this_leaf,
48 return (this_leaf->level != 1) && (sib_leaf->level != 1);
51 (this_leaf->attributes & CACHE_ID))
52 return sib_leaf->id == this_leaf->id;
54 return sib_leaf->fw_token == this_leaf->fw_token;
121 static void cache_size(struct cacheinfo *this_leaf, struct device_node *np)
126 ct_idx = get_cacheinfo_idx(this_leaf->type);
129 of_property_read_u32(np, propname, &this_leaf->size);
133 static void cache_get_line_size(struct cacheinfo *this_leaf,
138 ct_idx = get_cacheinfo_idx(this_leaf->type);
149 this_leaf->coherency_line_size = line_size;
155 static void cache_nr_sets(struct cacheinfo *this_leaf, struct device_node *np)
160 ct_idx = get_cacheinfo_idx(this_leaf->type);
163 of_property_read_u32(np, propname, &this_leaf->number_of_sets);
166 static void cache_associativity(struct cacheinfo *this_leaf)
168 unsigned int line_size = this_leaf->coherency_line_size;
169 unsigned int nr_sets = this_leaf->number_of_sets;
170 unsigned int size = this_leaf->size;
177 this_leaf->ways_of_associativity = (size / nr_sets) / line_size;
180 static bool cache_node_is_unified(struct cacheinfo *this_leaf,
186 static void cache_of_set_props(struct cacheinfo *this_leaf,
194 if (this_leaf->type == CACHE_TYPE_NOCACHE &&
195 cache_node_is_unified(this_leaf, np))
196 this_leaf->type = CACHE_TYPE_UNIFIED;
197 cache_size(this_leaf, np);
198 cache_get_line_size(this_leaf, np);
199 cache_nr_sets(this_leaf, np);
200 cache_associativity(this_leaf);
206 struct cacheinfo *this_leaf;
223 this_leaf = per_cpu_cacheinfo_idx(cpu, index);
224 if (this_leaf->level != 1) {
231 cache_of_set_props(this_leaf, np);
232 this_leaf->fw_token = np;
360 struct cacheinfo *this_leaf, *sib_leaf;
381 this_leaf = per_cpu_cacheinfo_idx(cpu, index);
383 cpumask_set_cpu(cpu, &this_leaf->shared_cpu_map);
397 if (sib_leaf->level != this_leaf->level ||
398 sib_leaf->type != this_leaf->type)
401 if (cache_leaves_are_shared(this_leaf, sib_leaf)) {
403 cpumask_set_cpu(i, &this_leaf->shared_cpu_map);
409 if (this_leaf->coherency_line_size > coherency_max_size)
410 coherency_max_size = this_leaf->coherency_line_size;
421 struct cacheinfo *this_leaf, *sib_leaf;
425 this_leaf = per_cpu_cacheinfo_idx(cpu, index);
426 for_each_cpu(sibling, &this_leaf->shared_cpu_map) {
441 if (sib_leaf->level != this_leaf->level ||
442 sib_leaf->type != this_leaf->type)
445 if (cache_leaves_are_shared(this_leaf, sib_leaf)) {
447 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
619 struct cacheinfo *this_leaf = dev_get_drvdata(dev); \
620 return sysfs_emit(buf, "%u\n", this_leaf->object); \
633 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
635 return sysfs_emit(buf, "%uK\n", this_leaf->size >> 10);
641 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
642 const struct cpumask *mask = &this_leaf->shared_cpu_map;
650 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
651 const struct cpumask *mask = &this_leaf->shared_cpu_map;
659 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
662 switch (this_leaf->type) {
682 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
683 unsigned int ci_attr = this_leaf->attributes;
701 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
702 unsigned int ci_attr = this_leaf->attributes;
746 struct cacheinfo *this_leaf = dev_get_drvdata(dev);
747 const struct cpumask *mask = &this_leaf->shared_cpu_map;
750 if ((attr == &dev_attr_id.attr) && (this_leaf->attributes & CACHE_ID))
752 if ((attr == &dev_attr_type.attr) && this_leaf->type)
754 if ((attr == &dev_attr_level.attr) && this_leaf->level)
761 this_leaf->coherency_line_size)
764 this_leaf->size) /* allow 0 = full associativity */
767 this_leaf->number_of_sets)
769 if ((attr == &dev_attr_size.attr) && this_leaf->size)
772 (this_leaf->attributes & CACHE_WRITE_POLICY_MASK))
775 (this_leaf->attributes & CACHE_ALLOCATE_POLICY_MASK))
778 this_leaf->physical_line_partition)
801 __weak cache_get_priv_group(struct cacheinfo *this_leaf)
807 cache_get_attribute_groups(struct cacheinfo *this_leaf)
810 cache_get_priv_group(this_leaf);
870 struct cacheinfo *this_leaf;
879 this_leaf = per_cpu_cacheinfo_idx(cpu, i);
880 if (this_leaf->disable_sysfs)
882 if (this_leaf->type == CACHE_TYPE_NOCACHE)
884 cache_groups = cache_get_attribute_groups(this_leaf);
885 ci_dev = cpu_device_create(parent, this_leaf, cache_groups,