This source file includes following definitions.
- acpi_os_ioremap
- disable_acpi
- enable_acpi
- acpi_has_cpu_in_madt
- get_acpi_id_for_cpu
- arch_fix_phys_package_id
- acpi_init_cpus
- apei_claim_sea
- acpi_parking_protocol_valid
- acpi_set_mailbox_entry
- acpi_get_enable_method
- arch_apei_get_mem_attribute
- arm64_acpi_numa_init
- acpi_numa_get_nid
- acpi_map_cpus_to_nodes
1
2
3
4
5
6
7
8
9 #ifndef _ASM_ACPI_H
10 #define _ASM_ACPI_H
11
12 #include <linux/efi.h>
13 #include <linux/memblock.h>
14 #include <linux/psci.h>
15 #include <linux/stddef.h>
16
17 #include <asm/cputype.h>
18 #include <asm/io.h>
19 #include <asm/ptrace.h>
20 #include <asm/smp_plat.h>
21 #include <asm/tlbflush.h>
22
23
24
25
26
27
28
29
30
31
32
33
34
35 #define ACPI_MADT_GICC_MIN_LENGTH offsetof( \
36 struct acpi_madt_generic_interrupt, efficiency_class)
37
38 #define BAD_MADT_GICC_ENTRY(entry, end) \
39 (!(entry) || (entry)->header.length < ACPI_MADT_GICC_MIN_LENGTH || \
40 (unsigned long)(entry) + (entry)->header.length > (end))
41
42 #define ACPI_MADT_GICC_SPE (offsetof(struct acpi_madt_generic_interrupt, \
43 spe_interrupt) + sizeof(u16))
44
45
46 #ifdef CONFIG_ACPI
47 pgprot_t __acpi_get_mem_attribute(phys_addr_t addr);
48
49
50 static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
51 acpi_size size)
52 {
53
54 if (memblock_is_map_memory(phys))
55 return (void __iomem *)__phys_to_virt(phys);
56
57
58
59
60
61
62 return __ioremap(phys, size, __acpi_get_mem_attribute(phys));
63 }
64 #define acpi_os_ioremap acpi_os_ioremap
65
66 typedef u64 phys_cpuid_t;
67 #define PHYS_CPUID_INVALID INVALID_HWID
68
69 #define acpi_strict 1
70 extern int acpi_disabled;
71 extern int acpi_noirq;
72 extern int acpi_pci_disabled;
73
74 static inline void disable_acpi(void)
75 {
76 acpi_disabled = 1;
77 acpi_pci_disabled = 1;
78 acpi_noirq = 1;
79 }
80
81 static inline void enable_acpi(void)
82 {
83 acpi_disabled = 0;
84 acpi_pci_disabled = 0;
85 acpi_noirq = 0;
86 }
87
88
89
90
91
92
93 #define cpu_physical_id(cpu) cpu_logical_map(cpu)
94
95
96
97
98
99
100
101
102 static inline bool acpi_has_cpu_in_madt(void)
103 {
104 return true;
105 }
106
107 struct acpi_madt_generic_interrupt *acpi_cpu_get_madt_gicc(int cpu);
108 static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
109 {
110 return acpi_cpu_get_madt_gicc(cpu)->uid;
111 }
112
113 static inline void arch_fix_phys_package_id(int num, u32 slot) { }
114 void __init acpi_init_cpus(void);
115 int apei_claim_sea(struct pt_regs *regs);
116 #else
117 static inline void acpi_init_cpus(void) { }
118 static inline int apei_claim_sea(struct pt_regs *regs) { return -ENOENT; }
119 #endif
120
121 #ifdef CONFIG_ARM64_ACPI_PARKING_PROTOCOL
122 bool acpi_parking_protocol_valid(int cpu);
123 void __init
124 acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor);
125 #else
126 static inline bool acpi_parking_protocol_valid(int cpu) { return false; }
127 static inline void
128 acpi_set_mailbox_entry(int cpu, struct acpi_madt_generic_interrupt *processor)
129 {}
130 #endif
131
132 static inline const char *acpi_get_enable_method(int cpu)
133 {
134 if (acpi_psci_present())
135 return "psci";
136
137 if (acpi_parking_protocol_valid(cpu))
138 return "parking-protocol";
139
140 return NULL;
141 }
142
143 #ifdef CONFIG_ACPI_APEI
144
145
146
147
148
149
150
151 #define acpi_disable_cmcff 1
152 static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
153 {
154 return __acpi_get_mem_attribute(addr);
155 }
156 #endif
157
158 #ifdef CONFIG_ACPI_NUMA
159 int arm64_acpi_numa_init(void);
160 int acpi_numa_get_nid(unsigned int cpu);
161 void acpi_map_cpus_to_nodes(void);
162 #else
163 static inline int arm64_acpi_numa_init(void) { return -ENOSYS; }
164 static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
165 static inline void acpi_map_cpus_to_nodes(void) { }
166 #endif
167
168 #define ACPI_TABLE_UPGRADE_MAX_PHYS MEMBLOCK_ALLOC_ACCESSIBLE
169
170 #endif