diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-20 21:07:27 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-12-20 21:07:27 +0000 |
commit | 6429f7e4fd55a230f471a4f1c12387db793a71dd (patch) | |
tree | 16ba159231ad1bae6e9c8583f94d8436354d65b2 /libdha/sysdep/AsmMacros_x86.h | |
parent | a75ffd19d6f674d0f05f8fc5e1763a47343c929f (diff) | |
download | mpv-6429f7e4fd55a230f471a4f1c12387db793a71dd.tar.bz2 mpv-6429f7e4fd55a230f471a4f1c12387db793a71dd.tar.xz |
svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@8504 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha/sysdep/AsmMacros_x86.h')
-rw-r--r-- | libdha/sysdep/AsmMacros_x86.h | 127 |
1 files changed, 124 insertions, 3 deletions
diff --git a/libdha/sysdep/AsmMacros_x86.h b/libdha/sysdep/AsmMacros_x86.h index c10f24f2dd..fd6591152c 100644 --- a/libdha/sysdep/AsmMacros_x86.h +++ b/libdha/sysdep/AsmMacros_x86.h @@ -21,8 +21,81 @@ extern int dhahelper_fd; extern int dhahelper_initialized; #endif +#ifdef CONFIG_SVGAHELPER +#include <sys/ioctl.h> +#include <svgalib_helper.h> + +extern int svgahelper_fd; +extern int svgahelper_initialized; + +static __inline__ void svga_outb(short port, char value) +{ + io_t iov; + + iov.val = value; + iov.port = port; + ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTB, &iov); +} + +static __inline__ void svga_outw(short port, char value) +{ + io_t iov; + + iov.val = value; + iov.port = port; + ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTW, &iov); +} + +static __inline__ void svga_outl(short port, unsigned int value) +{ + io_t iov; + + iov.val = value; + iov.port = port; + ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTL, &iov); +} + +static __inline__ unsigned int svga_inb(short port) +{ + io_t iov; + + iov.port = port; + ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINB, &iov); + + return iov.val; +} + +static __inline__ unsigned int svga_inw(short port) +{ + io_t iov; + + iov.port = port; + ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINW, &iov); + + return iov.val; +} + +static __inline__ unsigned int svga_inl(short port) +{ + io_t iov; + + iov.port = port; + ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINL, &iov); + + return iov.val; +} +#endif /* CONIFG_SVGAHELPER */ + static __inline__ void outb(short port,char val) { +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + { + svga_outb(port, val); + return; + } +#endif + #ifdef CONFIG_DHAHELPER if (dhahelper_initialized == 1) { @@ -43,6 +116,14 @@ static __inline__ void outb(short port,char val) static __inline__ void outw(short port,short val) { +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + { + svga_outw(port, val); + return; + } +#endif + #ifdef CONFIG_DHAHELPER if (dhahelper_initialized == 1) { @@ -63,6 +144,14 @@ static __inline__ void outw(short port,short val) static __inline__ void outl(short port,unsigned int val) { +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + { + svga_outl(port, val); + return; + } +#endif + #ifdef CONFIG_DHAHELPER if (dhahelper_initialized == 1) { @@ -83,7 +172,15 @@ static __inline__ void outl(short port,unsigned int val) static __inline__ unsigned int inb(short port) { - unsigned char ret; + unsigned char ret = 0; + +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + { + return svga_inb(port); + } +#endif + #ifdef CONFIG_DHAHELPER if (dhahelper_initialized == 1) { @@ -105,7 +202,15 @@ static __inline__ unsigned int inb(short port) static __inline__ unsigned int inw(short port) { - unsigned short ret; + unsigned short ret = 0; + +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + { + return svga_inw(port); + } +#endif + #ifdef CONFIG_DHAHELPER if (dhahelper_initialized == 1) { @@ -127,7 +232,15 @@ static __inline__ unsigned int inw(short port) static __inline__ unsigned int inl(short port) { - unsigned int ret; + unsigned int ret = 0; + +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + { + return svga_inl(port); + } +#endif + #ifdef CONFIG_DHAHELPER if (dhahelper_initialized == 1) { @@ -149,11 +262,19 @@ static __inline__ unsigned int inl(short port) static __inline__ void intr_disable() { +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + return; +#endif __asm__ __volatile__("cli"); } static __inline__ void intr_enable() { +#ifdef CONFIG_SVGAHELPER + if (svgahelper_initialized == 1) + return; +#endif __asm__ __volatile__("sti"); } |