2 * \file apidoc/arch_x86.h
3 * \brief x86(-64) Specific Functions
4 * \author John Hodge (thePowersGang)
6 * \section toc Table of Contents
7 * - \ref portio "Port IO"
8 * - \ref dma "DMA - Direct Memory Access"
10 * \section portio Port IO
11 * The x86 architecture has two memory spaces, the first is the system
12 * memory accessable using standard loads and stores. The second is the
13 * 16-bit IO Bus. This bus is accessed using the \a in and \a out opcodes
14 * and is used to configure devices attached to the system.
15 * A driver should not use \a in and \a out directly, but instead use
16 * the provided \a in* and \a out* functions to access the IO Bus.
17 * This allows the kernel to run a driver in userspace if requested without
18 * the binary needing to be altered.
20 * \section dma DMA - Direct Memory Access
27 extern Uint8 inb(Uint16 Port); //!< Read 1 byte from the IO Bus
28 extern Uint16 inw(Uint16 Port); //!< Read 2 bytes from the IO Bus
29 extern Uint32 inl(Uint16 Port); //!< Read 4 bytes from the IO Bus
30 extern Uint64 inq(Uint16 Port); //!< Read 8 bytes from the IO Bus
32 extern void outb(Uint16 Port, Uint8 Value); //!< Write 1 byte to the IO Bus
33 extern void outw(Uint16 Port, Uint16 Value); //!< Write 2 bytes to the IO Bus
34 extern void outl(Uint16 Port, Uint32 Value); //!< Write 4 bytes to the IO Bus
35 extern void outq(Uint16 Port, Uint64 Value); //!< Write 8 bytes to the IO Bus