From c0caeeb2e7d5e41aea820dbdd5b1251b32702d47 Mon Sep 17 00:00:00 2001 From: Dor Laor <dor.laor@gmail.com> Date: Mon, 24 Dec 2012 17:03:11 +0200 Subject: [PATCH] Add PCI header file with in/out functions --- arch/x64/pci.hh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 arch/x64/pci.hh diff --git a/arch/x64/pci.hh b/arch/x64/pci.hh new file mode 100644 index 000000000..02cac2ebd --- /dev/null +++ b/arch/x64/pci.hh @@ -0,0 +1,43 @@ +#ifndef ARCH_X86_PCI_H +#define ARCH_X86_PCI_H + +#include <stdint.h> +#include "arch/x64/processor.hh" + +namespace pci { + + typedef unsigned long ulong; + typedef uint8_t u8; + typedef uint16_t u16; + typedef uint32_t u32; + typedef uint64_t u64; + + inline u8 inb(u16 port) { + return processor::x86::inb(port); + } + + inline u16 inw(u16 port) { + return processor::x86::inw(port); + } + + inline u32 inl(u16 port) { + return processor::x86::inl(port); + } + + inline void outb(u8 val, u16 port) { + processor::x86::outb(val, port); + + } + + inline void outw(u16 val, u16 port) { + processor::x86::outw(val, port); + + } + + inline void outl(u32 val, u16 port) { + processor::x86::outl(val, port); + + } +}; + +#endif -- GitLab