#pragma once #if !defined(BAD_APPLE_OS_PORT_HPP_INCLUDED) #define BAD_APPLE_OS_PORT_HPP_INCLUDED #include #define writePortByte(port, value) \ { \ __asm__ __volatile__( \ "outb %0, %1" \ : \ : "a"(static_cast(value)), \ "Nd"(static_cast(port)) \ ); \ } #define readPortByte(port) \ [&]() \ { \ std::uint8_t value = 0; \ __asm__ __volatile__( \ "inb %1, %0" \ : "=a"(value) \ : "Nd"(static_cast(port)) \ ); \ return value; \ }() inline void ioWait() noexcept { writePortByte(0x80, 0); } #endif // !defined(BAD_APPLE_OS_PORT_HPP_INCLUDED)