Coverage Report

Created: 2017-10-25 09:10

/root/src/xen/xen/include/asm/percpu.h
Line
Count
Source
1
#ifndef __X86_PERCPU_H__
2
#define __X86_PERCPU_H__
3
4
#ifndef __ASSEMBLY__
5
extern char __per_cpu_start[], __per_cpu_data_end[];
6
extern unsigned long __per_cpu_offset[NR_CPUS];
7
void percpu_init_areas(void);
8
#endif
9
10
/* Separate out the type, so (int[3], foo) works. */
11
#define __DEFINE_PER_CPU(type, name, suffix)                    \
12
    __section(".bss.percpu" #suffix)                            \
13
    __typeof__(type) per_cpu_##name
14
15
/* var is in discarded region: offset to particular copy we want */
16
#define per_cpu(var, cpu)  \
17
85.5M
    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
18
#define __get_cpu_var(var) \
19
290M
    (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
20
21
#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
22
23
#define __get_cpu_ptr(var) \
24
3.93M
    (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset))
25
26
#define per_cpu_ptr(var, cpu)  \
27
6.13M
    (*RELOC_HIDE(var, __per_cpu_offset[cpu]))
28
29
#endif /* __X86_PERCPU_H__ */