summaryrefslogtreecommitdiffstats
path: root/libdha/sysdep/AsmMacros_x86.h
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-02 07:05:52 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-02 07:05:52 +0000
commit7129693a264e033c78077b74392f1692f79b6514 (patch)
treec544b8a574459f5f107928aba58a56eec9af2b65 /libdha/sysdep/AsmMacros_x86.h
parent127e0ba19184e5746fa4941dc6987dba98c2af94 (diff)
downloadmpv-7129693a264e033c78077b74392f1692f79b6514.tar.bz2
mpv-7129693a264e033c78077b74392f1692f79b6514.tar.xz
added support for dhahelper
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4475 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/sysdep/AsmMacros_x86.h')
-rw-r--r--libdha/sysdep/AsmMacros_x86.h94
1 files changed, 94 insertions, 0 deletions
diff --git a/libdha/sysdep/AsmMacros_x86.h b/libdha/sysdep/AsmMacros_x86.h
index 9b9719c17a..c10f24f2dd 100644
--- a/libdha/sysdep/AsmMacros_x86.h
+++ b/libdha/sysdep/AsmMacros_x86.h
@@ -11,24 +11,92 @@
#error This stuff is not ported on your system
#else
+#include "config.h"
+
+#ifdef CONFIG_DHAHELPER
+#include <sys/ioctl.h>
+#include "../kernelhelper/dhahelper.h"
+
+extern int dhahelper_fd;
+extern int dhahelper_initialized;
+#endif
+
static __inline__ void outb(short port,char val)
{
+#ifdef CONFIG_DHAHELPER
+ if (dhahelper_initialized == 1)
+ {
+ dhahelper_port_t _port;
+
+ _port.operation = PORT_OP_WRITE;
+ _port.addr = port;
+ _port.size = 1;
+ _port.value = val;
+ if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
+ return;
+ }
+ else
+#endif
__asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
+ return;
}
static __inline__ void outw(short port,short val)
{
+#ifdef CONFIG_DHAHELPER
+ if (dhahelper_initialized == 1)
+ {
+ dhahelper_port_t _port;
+
+ _port.operation = PORT_OP_WRITE;
+ _port.addr = port;
+ _port.size = 2;
+ _port.value = val;
+ if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
+ return;
+ }
+ else
+#endif
__asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
+ return;
}
static __inline__ void outl(short port,unsigned int val)
{
+#ifdef CONFIG_DHAHELPER
+ if (dhahelper_initialized == 1)
+ {
+ dhahelper_port_t _port;
+
+ _port.operation = PORT_OP_WRITE;
+ _port.addr = port;
+ _port.size = 4;
+ _port.value = val;
+ if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
+ return;
+ }
+ else
+#endif
__asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
+ return;
}
static __inline__ unsigned int inb(short port)
{
unsigned char ret;
+#ifdef CONFIG_DHAHELPER
+ if (dhahelper_initialized == 1)
+ {
+ dhahelper_port_t _port;
+
+ _port.operation = PORT_OP_READ;
+ _port.addr = port;
+ _port.size = 1;
+ if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
+ return _port.value;
+ }
+ else
+#endif
__asm__ __volatile__("inb %1,%0" :
"=a" (ret) :
"d" (port));
@@ -38,6 +106,19 @@ static __inline__ unsigned int inb(short port)
static __inline__ unsigned int inw(short port)
{
unsigned short ret;
+#ifdef CONFIG_DHAHELPER
+ if (dhahelper_initialized == 1)
+ {
+ dhahelper_port_t _port;
+
+ _port.operation = PORT_OP_READ;
+ _port.addr = port;
+ _port.size = 2;
+ if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
+ return _port.value;
+ }
+ else
+#endif
__asm__ __volatile__("inw %1,%0" :
"=a" (ret) :
"d" (port));
@@ -47,6 +128,19 @@ static __inline__ unsigned int inw(short port)
static __inline__ unsigned int inl(short port)
{
unsigned int ret;
+#ifdef CONFIG_DHAHELPER
+ if (dhahelper_initialized == 1)
+ {
+ dhahelper_port_t _port;
+
+ _port.operation = PORT_OP_READ;
+ _port.addr = port;
+ _port.size = 4;
+ if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
+ return _port.value;
+ }
+ else
+#endif
__asm__ __volatile__("inl %1,%0" :
"=a" (ret) :
"d" (port));