genode/repos/dde_linux/src/include/lx_emul/impl/io.h

41 lines
1.2 KiB
C

/*
* \brief Implementation of linux/io.h
* \author Norman Feske
* \date 2015-09-09
*/
/*
* Copyright (C) 2015 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#include <lx_emul/impl/internal/pci_dev_registry.h>
#include <lx_emul/impl/internal/mapped_io_mem_range.h>
void *ioremap(resource_size_t phys_addr, unsigned long size)
{
return Lx::ioremap(phys_addr, size, Genode::UNCACHED);
}
void *ioremap_wc(resource_size_t phys_addr, unsigned long size)
{
return Lx::ioremap(phys_addr, size, Genode::WRITE_COMBINED);
}
/**********************
** asm-generic/io.h **
**********************/
void outb(u8 value, u32 port) { Lx::pci_dev_registry()->io_write<u8> (port, value); }
void outw(u16 value, u32 port) { Lx::pci_dev_registry()->io_write<u16>(port, value); }
void outl(u32 value, u32 port) { Lx::pci_dev_registry()->io_write<u32>(port, value); }
u8 inb(u32 port) { return Lx::pci_dev_registry()->io_read<u8> (port); }
u16 inw(u32 port) { return Lx::pci_dev_registry()->io_read<u16>(port); }
u32 inl(u32 port) { return Lx::pci_dev_registry()->io_read<u32>(port); }