This source file includes following definitions.
- sync_boot_mode
- is_hyp_mode_available
- is_hyp_mode_mismatched
- is_kernel_in_hyp_mode
- has_vhe
1
2
3
4
5
6 #ifndef VIRT_H
7 #define VIRT_H
8
9 #include <asm/ptrace.h>
10
11
12
13
14
15
16 #define BOOT_CPU_MODE_MISMATCH PSR_N_BIT
17
18 #ifndef __ASSEMBLY__
19 #include <asm/cacheflush.h>
20
21 #ifdef CONFIG_ARM_VIRT_EXT
22
23
24
25
26
27
28
29
30 extern int __boot_cpu_mode;
31
32 static inline void sync_boot_mode(void)
33 {
34
35
36
37
38
39 sync_cache_r(&__boot_cpu_mode);
40 }
41
42 void __hyp_set_vectors(unsigned long phys_vector_base);
43 void __hyp_reset_vectors(void);
44 #else
45 #define __boot_cpu_mode (SVC_MODE)
46 #define sync_boot_mode()
47 #endif
48
49 #ifndef ZIMAGE
50 void hyp_mode_check(void);
51
52
53 static inline bool is_hyp_mode_available(void)
54 {
55 return ((__boot_cpu_mode & MODE_MASK) == HYP_MODE &&
56 !(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH));
57 }
58
59
60 static inline bool is_hyp_mode_mismatched(void)
61 {
62 return !!(__boot_cpu_mode & BOOT_CPU_MODE_MISMATCH);
63 }
64
65 static inline bool is_kernel_in_hyp_mode(void)
66 {
67 return false;
68 }
69
70 static inline bool has_vhe(void)
71 {
72 return false;
73 }
74
75
76 extern char __hyp_idmap_text_start[];
77 extern char __hyp_idmap_text_end[];
78
79
80 extern char __hyp_text_start[];
81 extern char __hyp_text_end[];
82 #endif
83
84 #else
85
86
87
88 #define HVC_SET_VECTORS 0
89 #define HVC_SOFT_RESTART 1
90 #define HVC_RESET_VECTORS 2
91
92 #define HVC_STUB_HCALL_NR 3
93
94 #endif
95
96 #define HVC_STUB_ERR 0xbadca11
97
98 #endif