blob: b825cb201251654f7a085b0b612a0b574979fa2b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
H. Peter Anvin1965aae2008-10-22 22:26:29 -07002#ifndef _ASM_X86_DMI_H
3#define _ASM_X86_DMI_H
Thomas Gleixner327c21b2007-10-15 23:28:20 +02004
Jeremy Fitzhardingec8608d62009-03-22 14:48:44 -07005#include <linux/compiler.h>
6#include <linux/init.h>
Nicolai Stange447ae312018-07-29 12:15:33 +02007#include <linux/io.h>
Jeremy Fitzhardingec8608d62009-03-22 14:48:44 -07008
Jeremy Fitzhardinge6de6cb42009-02-27 13:35:45 -08009#include <asm/setup.h>
Thomas Gleixner327c21b2007-10-15 23:28:20 +020010
Jeremy Fitzhardingec8608d62009-03-22 14:48:44 -070011static __always_inline __init void *dmi_alloc(unsigned len)
Thomas Gleixner327c21b2007-10-15 23:28:20 +020012{
Jeremy Fitzhardinge6de6cb42009-02-27 13:35:45 -080013 return extend_brk(len, sizeof(int));
Thomas Gleixner327c21b2007-10-15 23:28:20 +020014}
15
Jean Delvareef3fb662008-05-01 04:35:01 -070016/* Use early IO mappings for DMI because it's initialized early */
Tom Lendackyf7750a72017-07-17 16:10:00 -050017#define dmi_early_remap early_memremap
18#define dmi_early_unmap early_memunmap
19#define dmi_remap(_x, _l) memremap(_x, _l, MEMREMAP_WB)
20#define dmi_unmap(_x) memunmap(_x)
Thomas Gleixner327c21b2007-10-15 23:28:20 +020021
H. Peter Anvin1965aae2008-10-22 22:26:29 -070022#endif /* _ASM_X86_DMI_H */