aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h123
1 files changed, 6 insertions, 117 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index fac7a7b1f5f9..815f1fb4ce21 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -53,11 +53,6 @@ enum acpi_irq_model_id {
53 53
54extern enum acpi_irq_model_id acpi_irq_model; 54extern enum acpi_irq_model_id acpi_irq_model;
55 55
56typedef struct {
57 u8 type;
58 u8 length;
59} __attribute__ ((packed)) acpi_table_entry_header;
60
61enum acpi_interrupt_id { 56enum acpi_interrupt_id {
62 ACPI_INTERRUPT_PMI = 1, 57 ACPI_INTERRUPT_PMI = 1,
63 ACPI_INTERRUPT_INIT, 58 ACPI_INTERRUPT_INIT,
@@ -67,74 +62,6 @@ enum acpi_interrupt_id {
67 62
68#define ACPI_SPACE_MEM 0 63#define ACPI_SPACE_MEM 0
69 64
70struct acpi_gen_regaddr {
71 u8 space_id;
72 u8 bit_width;
73 u8 bit_offset;
74 u8 resv;
75 u32 addrl;
76 u32 addrh;
77} __attribute__ ((packed));
78
79/*
80 * Simple Boot Flags
81 * http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx
82 */
83struct acpi_table_sbf
84{
85 u8 sbf_signature[4];
86 u32 sbf_len;
87 u8 sbf_revision;
88 u8 sbf_csum;
89 u8 sbf_oemid[6];
90 u8 sbf_oemtable[8];
91 u8 sbf_revdata[4];
92 u8 sbf_creator[4];
93 u8 sbf_crearev[4];
94 u8 sbf_cmos;
95 u8 sbf_spare[3];
96} __attribute__ ((packed));
97
98/*
99 * System Resource Affinity Table (SRAT)
100 * http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx
101 */
102
103enum acpi_srat_entry_id {
104 ACPI_SRAT_PROCESSOR_AFFINITY = 0,
105 ACPI_SRAT_MEMORY_AFFINITY,
106 ACPI_SRAT_ENTRY_COUNT
107};
108
109struct acpi_table_processor_affinity {
110 acpi_table_entry_header header;
111 u8 proximity_domain;
112 u8 apic_id;
113 struct {
114 u32 enabled:1;
115 u32 reserved:31;
116 } flags;
117 u8 lsapic_eid;
118 u8 reserved[7];
119} __attribute__ ((packed));
120
121struct acpi_table_memory_affinity {
122 acpi_table_entry_header header;
123 u8 proximity_domain;
124 u8 reserved1[5];
125 u32 base_addr_lo;
126 u32 base_addr_hi;
127 u32 length_lo;
128 u32 length_hi;
129 u32 memory_type; /* See acpi_address_range_id */
130 struct {
131 u32 enabled:1;
132 u32 hot_pluggable:1;
133 u32 reserved:30;
134 } flags;
135 u64 reserved2;
136} __attribute__ ((packed));
137
138enum acpi_address_range_id { 65enum acpi_address_range_id {
139 ACPI_ADDRESS_RANGE_MEMORY = 1, 66 ACPI_ADDRESS_RANGE_MEMORY = 1,
140 ACPI_ADDRESS_RANGE_RESERVED = 2, 67 ACPI_ADDRESS_RANGE_RESERVED = 2,
@@ -144,46 +71,9 @@ enum acpi_address_range_id {
144}; 71};
145 72
146 73
147/* PCI MMCONFIG */
148
149/* Defined in PCI Firmware Specification 3.0 */
150struct acpi_table_mcfg_config {
151 u32 base_address;
152 u32 base_reserved;
153 u16 pci_segment_group_number;
154 u8 start_bus_number;
155 u8 end_bus_number;
156 u8 reserved[4];
157} __attribute__ ((packed));
158
159/* Table Handlers */ 74/* Table Handlers */
160 75
161enum acpi_table_id { 76typedef int (*acpi_table_handler) (struct acpi_table_header *table);
162 ACPI_TABLE_UNKNOWN = 0,
163 ACPI_APIC,
164 ACPI_BOOT,
165 ACPI_DBGP,
166 ACPI_DSDT,
167 ACPI_ECDT,
168 ACPI_ETDT,
169 ACPI_FADT,
170 ACPI_FACS,
171 ACPI_OEMX,
172 ACPI_PSDT,
173 ACPI_SBST,
174 ACPI_SLIT,
175 ACPI_SPCR,
176 ACPI_SRAT,
177 ACPI_SSDT,
178 ACPI_SPMI,
179 ACPI_HPET,
180 ACPI_MCFG,
181 ACPI_TABLE_COUNT
182};
183
184typedef int (*acpi_table_handler) (struct acpi_table_header *header);
185
186extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
187 77
188typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 78typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
189 79
@@ -196,11 +86,10 @@ int acpi_numa_init (void);
196int acpi_table_init (void); 86int acpi_table_init (void);
197int acpi_table_parse (char *id, acpi_table_handler handler); 87int acpi_table_parse (char *id, acpi_table_handler handler);
198int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries); 88int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
199int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 89int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
200int acpi_parse_mcfg (struct acpi_table_header *header); 90int acpi_parse_mcfg (struct acpi_table_header *header);
201void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr);
202void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); 91void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
203void acpi_table_print_srat_entry (acpi_table_entry_header *srat); 92void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
204 93
205/* the following four functions are architecture-dependent */ 94/* the following four functions are architecture-dependent */
206#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 95#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -211,8 +100,8 @@ void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
211#define acpi_numa_arch_fixup() do {} while (0) 100#define acpi_numa_arch_fixup() do {} while (0)
212#else 101#else
213void acpi_numa_slit_init (struct acpi_table_slit *slit); 102void acpi_numa_slit_init (struct acpi_table_slit *slit);
214void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); 103void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
215void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); 104void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
216void acpi_numa_arch_fixup(void); 105void acpi_numa_arch_fixup(void);
217#endif 106#endif
218 107
@@ -227,7 +116,7 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
227 116
228extern int acpi_mp_config; 117extern int acpi_mp_config;
229 118
230extern struct acpi_table_mcfg_config *pci_mmcfg_config; 119extern struct acpi_mcfg_allocation *pci_mmcfg_config;
231extern int pci_mmcfg_config_num; 120extern int pci_mmcfg_config_num;
232 121
233extern int sbf_port; 122extern int sbf_port;