linux/arch/x86/kernel/io_delay.c

// SPDX-License-Identifier: GPL-2.0
/*
 * I/O delay strategies for inb_p/outb_p
 *
 * Allow for a DMI based override of port 0x80, needed for certain HP laptops
 * and possibly other systems. Also allow for the gradual elimination of
 * outb_p/inb_p API uses.
 */
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/dmi.h>
#include <linux/io.h>

#define IO_DELAY_TYPE_0X80
#define IO_DELAY_TYPE_0XED
#define IO_DELAY_TYPE_UDELAY
#define IO_DELAY_TYPE_NONE

#if defined(CONFIG_IO_DELAY_0X80)
#define DEFAULT_IO_DELAY_TYPE
#elif defined(CONFIG_IO_DELAY_0XED)
#define DEFAULT_IO_DELAY_TYPE
#elif defined(CONFIG_IO_DELAY_UDELAY)
#define DEFAULT_IO_DELAY_TYPE
#elif defined(CONFIG_IO_DELAY_NONE)
#define DEFAULT_IO_DELAY_TYPE
#endif

int io_delay_type __read_mostly =;

static int __initdata io_delay_override;

/*
 * Paravirt wants native_io_delay to be a constant.
 */
void native_io_delay(void)
{}
EXPORT_SYMBOL();

static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
{}

/*
 * Quirk table for systems that misbehave (lock up, etc.) if port
 * 0x80 is used:
 */
static const struct dmi_system_id io_delay_0xed_port_dmi_table[] __initconst =;

void __init io_delay_init(void)
{}

static int __init io_delay_param(char *s)
{}

early_param();