summaryrefslogtreecommitdiffstats
path: root/include/device/uart.h
blob: 1724eb5ddd05a8d90c4c5fd36bcee2fa05f32b77 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef JOVE_KERNEL_ARCH_x86_64_UART_H
#define JOVE_KERNEL_ARCH_x86_64_UART_H 1

#include "jove.h"
#include <stdint.h>

ALWAYS_INLINE uint8_t pinb(uint16_t port)
{
    uint8_t v;
    __asm__ volatile("inb %1, %0": "=a"(v): "Nd"(port));
    return v;
}

ALWAYS_INLINE void poutb(uint16_t port, uint8_t b)
{
    __asm__ volatile("outb %0, %1":: "a"(b), "Nd"(port));
}

#endif