This source file includes following definitions.
- cpu_rmap_lookup_index
- cpu_rmap_lookup_obj
- alloc_irq_cpu_rmap
1
2 #ifndef __LINUX_CPU_RMAP_H
3 #define __LINUX_CPU_RMAP_H
4
5
6
7
8
9
10 #include <linux/cpumask.h>
11 #include <linux/gfp.h>
12 #include <linux/slab.h>
13 #include <linux/kref.h>
14
15
16
17
18
19
20
21
22
23
24 struct cpu_rmap {
25 struct kref refcount;
26 u16 size, used;
27 void **obj;
28 struct {
29 u16 index;
30 u16 dist;
31 } near[0];
32 };
33 #define CPU_RMAP_DIST_INF 0xffff
34
35 extern struct cpu_rmap *alloc_cpu_rmap(unsigned int size, gfp_t flags);
36 extern int cpu_rmap_put(struct cpu_rmap *rmap);
37
38 extern int cpu_rmap_add(struct cpu_rmap *rmap, void *obj);
39 extern int cpu_rmap_update(struct cpu_rmap *rmap, u16 index,
40 const struct cpumask *affinity);
41
42 static inline u16 cpu_rmap_lookup_index(struct cpu_rmap *rmap, unsigned int cpu)
43 {
44 return rmap->near[cpu].index;
45 }
46
47 static inline void *cpu_rmap_lookup_obj(struct cpu_rmap *rmap, unsigned int cpu)
48 {
49 return rmap->obj[rmap->near[cpu].index];
50 }
51
52
53
54
55
56
57
58 static inline struct cpu_rmap *alloc_irq_cpu_rmap(unsigned int size)
59 {
60 return alloc_cpu_rmap(size, GFP_KERNEL);
61 }
62 extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
63
64 extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
65
66 #endif