// 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>
int io_delay_type __read_mostly = DEFAULT_IO_DELAY_TYPE;
staticint __initdata io_delay_override;
/* * Paravirt wants native_io_delay to be a constant.
*/ void native_io_delay(void)
{ switch (io_delay_type) { default: case IO_DELAY_TYPE_0X80: asmvolatile ("outb %al, $0x80"); break; case IO_DELAY_TYPE_0XED: asmvolatile ("outb %al, $0xed"); break; case IO_DELAY_TYPE_UDELAY: /* * 2 usecs is an upper-bound for the outb delay but * note that udelay doesn't have the bus-level * side-effects that outb does, nor does udelay() have * precise timings during very early bootup (the delays * are shorter until calibrated):
*/
udelay(2); break; case IO_DELAY_TYPE_NONE: break;
}
}
EXPORT_SYMBOL(native_io_delay);
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.0Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.