- add additional inport and outport functions (wl)

git-svn-id: http://svn.lfbs.rwth-aachen.de/svn/scc/trunk/MetalSVM@41 315a16e6-25f9-4109-90ae-ca3045a26c18
This commit is contained in:
stefan 2010-08-05 07:11:38 +00:00
parent 6a45b433ea
commit 5d139a1519

View file

@ -26,12 +26,33 @@ extern "C" {
inline static unsigned char inportb(unsigned short _port) {
unsigned char rv;
__asm__ __volatile__("inb %1, %0":"=a"(rv):"dN"(_port));
return rv;
asm volatile("inb %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
inline static unsigned short inportw(unsigned short _port) {
unsigned short rv;
asm volatile("inw %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
inline static unsigned int inportl(unsigned short _port) {
unsigned int rv;
asm volatile("inl %1, %0":"=a"(rv):"dN"(_port));
return rv;
}
inline static void outportb(unsigned short _port, unsigned char _data) {
__asm__ __volatile__("outb %1, %0"::"dN"(_port), "a"(_data));
asm volatile("outb %1, %0"::"dN"(_port), "a"(_data));
}
inline static void outportw(unsigned short _port, unsigned short _data) {
asm volatile("outw %1, %0"::"dN"(_port), "a"(_data));
}
inline static void outportl(unsigned short _port, unsigned int _data)
{
asm volatile("outl %1, %0"::"dN"(_port), "a"(_data));
}
#ifdef __cplusplus