Importing mkelfimage from
ftp://ftp.lnxi.com/pub/mkelfImage/mkelfImage-2.7.tar.gz Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3103 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
committed by
Stefan Reinauer
parent
46fc14dcc8
commit
b34eea348c
64
util/mkelfImage/arch/i386/include/arch/io.h
Normal file
64
util/mkelfImage/arch/i386/include/arch/io.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef ARCH_IO_H
|
||||
#define ARCH_IO_H
|
||||
|
||||
#include <stdint.h>
|
||||
/* Helper functions for directly doing I/O */
|
||||
|
||||
extern inline uint8_t inb(uint16_t port)
|
||||
{
|
||||
uint8_t result;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"inb %w1,%0"
|
||||
:"=a" (result)
|
||||
:"Nd" (port));
|
||||
return result;
|
||||
}
|
||||
|
||||
extern inline uint16_t inw(uint16_t port)
|
||||
{
|
||||
uint16_t result;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"inw %w1,%0"
|
||||
:"=a" (result)
|
||||
:"Nd" (port));
|
||||
return result;
|
||||
}
|
||||
|
||||
extern inline uint32_t inl(uint32_t port)
|
||||
{
|
||||
uint32_t result;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"inl %w1,%0"
|
||||
:"=a" (result)
|
||||
:"Nd" (port));
|
||||
return result;
|
||||
}
|
||||
|
||||
extern inline void outb (uint8_t value, uint16_t port)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"outb %b0,%w1"
|
||||
:
|
||||
:"a" (value), "Nd" (port));
|
||||
}
|
||||
|
||||
extern inline void outw (uint16_t value, uint16_t port)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"outw %w0,%w1"
|
||||
:
|
||||
:"a" (value), "Nd" (port));
|
||||
}
|
||||
|
||||
extern inline void outl (uint32_t value, uint16_t port)
|
||||
{
|
||||
__asm__ __volatile__ (
|
||||
"outl %0,%w1"
|
||||
:
|
||||
:"a" (value), "Nd" (port));
|
||||
}
|
||||
|
||||
#endif /* ARCH_IO_H */
|
Reference in New Issue
Block a user