annotate libdha/sysdep/AsmMacros_x86.h @ 9370:88bd19564b64

Motion-JPEG RTP streams can now be played. Some MPEG-4 ES video RTP streams can also be played. patch by Ross Finlayson <finlayson@live.com>
author arpi
date Sun, 09 Feb 2003 17:06:38 +0000
parents 9dbb9c710480
children e687fa1d55c6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
1 /*
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
2 This file is based on:
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
3 $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
4 Modified for readability by Nick Kurshev
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
5 */
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
6
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
7 #ifndef __ASM_MACROS_X86_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
8 #define __ASM_MACROS_X86_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
9
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
10 #if defined (WINNT)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
11 #error This stuff is not ported on your system
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
12 #else
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
13
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
14 #include "config.h"
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
15
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
16 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
17 #include <sys/ioctl.h>
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
18 #include "../kernelhelper/dhahelper.h"
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
19
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
20 extern int dhahelper_fd;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
21 extern int dhahelper_initialized;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
22 #endif
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
23
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
24 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
25 #include <sys/ioctl.h>
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
26 #include <svgalib_helper.h>
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
27
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
28 extern int svgahelper_fd;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
29 extern int svgahelper_initialized;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
30
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
31 static __inline__ void svga_outb(short port, char value)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
32 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
33 io_t iov;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
34
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
35 iov.val = value;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
36 iov.port = port;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
37 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTB, &iov);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
38 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
39
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
40 static __inline__ void svga_outw(short port, char value)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
41 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
42 io_t iov;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
43
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
44 iov.val = value;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
45 iov.port = port;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
46 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTW, &iov);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
47 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
48
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
49 static __inline__ void svga_outl(short port, unsigned int value)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
50 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
51 io_t iov;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
52
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
53 iov.val = value;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
54 iov.port = port;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
55 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCSOUTL, &iov);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
56 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
57
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
58 static __inline__ unsigned int svga_inb(short port)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
59 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
60 io_t iov;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
61
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
62 iov.port = port;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
63 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINB, &iov);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
64
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
65 return iov.val;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
66 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
67
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
68 static __inline__ unsigned int svga_inw(short port)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
69 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
70 io_t iov;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
71
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
72 iov.port = port;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
73 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINW, &iov);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
74
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
75 return iov.val;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
76 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
77
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
78 static __inline__ unsigned int svga_inl(short port)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
79 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
80 io_t iov;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
81
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
82 iov.port = port;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
83 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINL, &iov);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
84
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
85 return iov.val;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
86 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
87 #endif /* CONIFG_SVGAHELPER */
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
88
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
89 static __inline__ void outb(short port,char val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
90 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
91 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
92 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
93 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
94 svga_outb(port, val);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
95 return;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
96 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
97 #endif
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
98
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
99 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
100 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
101 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
102 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
103
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
104 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
105 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
106 _port.size = 1;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
107 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
108 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
109 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
110 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
111 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
112 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
113 __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
114 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
115 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
116
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
117 static __inline__ void outw(short port,short val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
118 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
119 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
120 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
121 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
122 svga_outw(port, val);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
123 return;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
124 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
125 #endif
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
126
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
127 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
128 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
129 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
130 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
131
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
132 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
133 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
134 _port.size = 2;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
135 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
136 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
137 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
138 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
139 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
140 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
141 __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
142 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
143 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
144
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
145 static __inline__ void outl(short port,unsigned int val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
146 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
147 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
148 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
149 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
150 svga_outl(port, val);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
151 return;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
152 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
153 #endif
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
154
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
155 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
156 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
157 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
158 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
159
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
160 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
161 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
162 _port.size = 4;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
163 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
164 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
165 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
166 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
167 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
168 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
169 __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
170 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
171 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
172
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
173 static __inline__ unsigned int inb(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
174 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
175 unsigned char ret = 0;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
176
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
177 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
178 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
179 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
180 return svga_inb(port);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
181 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
182 #endif
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
183
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
184 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
185 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
186 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
187 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
188
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
189 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
190 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
191 _port.size = 1;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
192 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
193 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
194 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
195 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
196 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
197 __asm__ __volatile__("inb %1,%0" :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
198 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
199 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
200 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
201 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
202
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
203 static __inline__ unsigned int inw(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
204 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
205 unsigned short ret = 0;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
206
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
207 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
208 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
209 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
210 return svga_inw(port);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
211 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
212 #endif
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
213
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
214 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
215 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
216 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
217 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
218
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
219 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
220 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
221 _port.size = 2;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
222 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
223 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
224 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
225 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
226 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
227 __asm__ __volatile__("inw %1,%0" :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
228 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
229 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
230 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
231 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
232
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
233 static __inline__ unsigned int inl(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
234 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
235 unsigned int ret = 0;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
236
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
237 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
238 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
239 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
240 return svga_inl(port);
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
241 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
242 #endif
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
243
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
244 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
245 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
246 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
247 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
248
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
249 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
250 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
251 _port.size = 4;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
252 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
253 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
254 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
255 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
256 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
257 __asm__ __volatile__("inl %1,%0" :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
258 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
259 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
260 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
261 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
262
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
263 static __inline__ void intr_disable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
264 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
265 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
266 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
267 return;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
268 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
269 __asm__ __volatile__("cli");
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
270 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
271
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
272 static __inline__ void intr_enable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
273 {
8503
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
274 #ifdef CONFIG_SVGAHELPER
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
275 if (svgahelper_initialized == 1)
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
276 return;
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
277 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
278 __asm__ __volatile__("sti");
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
279 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
280
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
281 #endif
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
282
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
283 #endif