These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / arch / x86 / include / bits / uart.h
1 #ifndef _BITS_UART_H
2 #define _BITS_UART_H
3
4 /** @file
5  *
6  * 16550-compatible UART
7  *
8  */
9
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12 #include <stdint.h>
13 #include <ipxe/io.h>
14
15 /**
16  * Write to UART register
17  *
18  * @v uart              UART
19  * @v addr              Register address
20  * @v data              Data
21  */
22 static inline __attribute__ (( always_inline )) void
23 uart_write ( struct uart *uart, unsigned int addr, uint8_t data ) {
24         outb ( data, ( uart->base + addr ) );
25 }
26
27 /**
28  * Read from UART register
29  *
30  * @v uart              UART
31  * @v addr              Register address
32  * @ret data            Data
33  */
34 static inline __attribute__ (( always_inline )) uint8_t
35 uart_read ( struct uart *uart, unsigned int addr ) {
36         return inb ( uart->base + addr );
37 }
38
39 extern int uart_select ( struct uart *uart, unsigned int port );
40
41 #endif /* _BITS_UART_H */