This source file includes following definitions.
- acpi_find_last_cache_level
1
2 #ifndef _LINUX_CACHEINFO_H
3 #define _LINUX_CACHEINFO_H
4
5 #include <linux/bitops.h>
6 #include <linux/cpumask.h>
7 #include <linux/smp.h>
8
9 struct device_node;
10 struct attribute;
11
12 enum cache_type {
13 CACHE_TYPE_NOCACHE = 0,
14 CACHE_TYPE_INST = BIT(0),
15 CACHE_TYPE_DATA = BIT(1),
16 CACHE_TYPE_SEPARATE = CACHE_TYPE_INST | CACHE_TYPE_DATA,
17 CACHE_TYPE_UNIFIED = BIT(2),
18 };
19
20 extern unsigned int coherency_max_size;
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49 struct cacheinfo {
50 unsigned int id;
51 enum cache_type type;
52 unsigned int level;
53 unsigned int coherency_line_size;
54 unsigned int number_of_sets;
55 unsigned int ways_of_associativity;
56 unsigned int physical_line_partition;
57 unsigned int size;
58 cpumask_t shared_cpu_map;
59 unsigned int attributes;
60 #define CACHE_WRITE_THROUGH BIT(0)
61 #define CACHE_WRITE_BACK BIT(1)
62 #define CACHE_WRITE_POLICY_MASK \
63 (CACHE_WRITE_THROUGH | CACHE_WRITE_BACK)
64 #define CACHE_READ_ALLOCATE BIT(2)
65 #define CACHE_WRITE_ALLOCATE BIT(3)
66 #define CACHE_ALLOCATE_POLICY_MASK \
67 (CACHE_READ_ALLOCATE | CACHE_WRITE_ALLOCATE)
68 #define CACHE_ID BIT(4)
69 void *fw_token;
70 bool disable_sysfs;
71 void *priv;
72 };
73
74 struct cpu_cacheinfo {
75 struct cacheinfo *info_list;
76 unsigned int num_levels;
77 unsigned int num_leaves;
78 bool cpu_map_populated;
79 };
80
81
82
83
84
85 #define DEFINE_SMP_CALL_CACHE_FUNCTION(func) \
86 static inline void _##func(void *ret) \
87 { \
88 int cpu = smp_processor_id(); \
89 *(int *)ret = __##func(cpu); \
90 } \
91 \
92 int func(unsigned int cpu) \
93 { \
94 int ret; \
95 smp_call_function_single(cpu, _##func, &ret, true); \
96 return ret; \
97 }
98
99 struct cpu_cacheinfo *get_cpu_cacheinfo(unsigned int cpu);
100 int init_cache_level(unsigned int cpu);
101 int populate_cache_leaves(unsigned int cpu);
102 int cache_setup_acpi(unsigned int cpu);
103 #ifndef CONFIG_ACPI_PPTT
104
105
106
107
108
109
110
111
112 static inline int acpi_find_last_cache_level(unsigned int cpu)
113 {
114 return 0;
115 }
116 #else
117 int acpi_find_last_cache_level(unsigned int cpu);
118 #endif
119
120 const struct attribute_group *cache_get_priv_group(struct cacheinfo *this_leaf);
121
122 #endif