summaryrefslogtreecommitdiffstats
path: root/include/linux/acpi.h
diff options
context:
space:
mode:
authorHanjun Guo <hanjun.guo@linaro.org>2014-02-19 00:23:57 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-19 00:56:07 +0100
commit328281b1cda4dfef5b86c255b0aba8a8a96e0dad (patch)
tree7fdc61c829c944729e3a7660051a55f3cd1c853c /include/linux/acpi.h
parentdf86f5df79d8c2035a88fb985925e49475c0cdca (diff)
downloadop-kernel-dev-328281b1cda4dfef5b86c255b0aba8a8a96e0dad.zip
op-kernel-dev-328281b1cda4dfef5b86c255b0aba8a8a96e0dad.tar.gz
ACPI: Move BAD_MADT_ENTRY() to linux/acpi.h
BAD_MADT_ENTRY() is arch independent and will be used for all architectures which parse MADT, so move it to linux/acpi.h to reduce code duplication. Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/acpi.h')
-rw-r--r--include/linux/acpi.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 1151a1d..6a15ddd 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -108,6 +108,10 @@ static inline void acpi_initrd_override(void *data, size_t size)
}
#endif
+#define BAD_MADT_ENTRY(entry, end) ( \
+ (!entry) || (unsigned long)entry + sizeof(*entry) > end || \
+ ((struct acpi_subtable_header *)entry)->length < sizeof(*entry))
+
char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
void __acpi_unmap_table(char *map, unsigned long size);
int early_acpi_boot_init(void);
OpenPOWER on IntegriCloud