/* SPDX-License-Identifier: GPL-2.0 */1#ifndef BOOT_IO_H2#define BOOT_IO_H34#include <asm/shared/io.h>56#undef inb7#undef inw8#undef inl9#undef outb10#undef outw11#undef outl1213struct port_io_ops {14u8 (*f_inb)(u16 port);15void (*f_outb)(u8 v, u16 port);16void (*f_outw)(u16 v, u16 port);17};1819extern struct port_io_ops pio_ops;2021/*22* Use the normal I/O instructions by default.23* TDX guests override these to use hypercalls.24*/25static inline void init_default_io_ops(void)26{27pio_ops.f_inb = __inb;28pio_ops.f_outb = __outb;29pio_ops.f_outw = __outw;30}3132/*33* Redirect port I/O operations via pio_ops callbacks.34* TDX guests override these callbacks with TDX-specific helpers.35*/36#define inb pio_ops.f_inb37#define outb pio_ops.f_outb38#define outw pio_ops.f_outw3940#endif414243