Mercurial > mplayer.hg
annotate vidix/sysdep/AsmMacros_x86.h @ 30191:c2fc252b0d14
Avoid the error message "Unsupported PixelFormat -1" for ffh264 decoding
author | zuxy |
---|---|
date | Thu, 07 Jan 2010 04:59:50 +0000 |
parents | 0f1b5b68af32 |
children | 958431e2cde0 |
rev | line source |
---|---|
4164 | 1 /* |
2 This file is based on: | |
3 $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $ | |
4 Modified for readability by Nick Kurshev | |
5 */ | |
25132
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
6 /* |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
7 * (c) Copyright 1993,1994 by David Wexelblat <dwex@xfree86.org> |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
8 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
9 * Permission is hereby granted, free of charge, to any person obtaining a |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
10 * copy of this software and associated documentation files (the "Software"), |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
11 * to deal in the Software without restriction, including without limitation |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
13 * and/or sell copies of the Software, and to permit persons to whom the |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
14 * Software is furnished to do so, subject to the following conditions: |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
15 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
16 * The above copyright notice and this permission notice shall be included in |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
17 * all copies or substantial portions of the Software. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
18 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
22 * DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
25 * SOFTWARE. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
26 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
27 * Except as contained in this notice, the name of David Wexelblat shall not be |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
28 * used in advertising or otherwise to promote the sale, use or other dealings |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
29 * in this Software without prior written authorization from David Wexelblat. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
30 */ |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
31 /* |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
32 * Copyright 1997 |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
33 * Digital Equipment Corporation. All rights reserved. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
34 * This software is furnished under license and may be used and copied only in |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
35 * accordance with the following terms and conditions. Subject to these |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
36 * conditions, you may download, copy, install, use, modify and distribute |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
37 * this software in source and/or binary form. No title or ownership is |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
38 * transferred hereby. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
39 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
40 * 1) Any source code used, modified or distributed must reproduce and retain |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
41 * this copyright notice and list of conditions as they appear in the source |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
42 * file. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
43 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
44 * 2) No right is granted to use any trade name, trademark, or logo of Digital |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
45 * Equipment Corporation. Neither the "Digital Equipment Corporation" name |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
46 * nor any trademark or logo of Digital Equipment Corporation may be used |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
47 * to endorse or promote products derived from this software without the |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
48 * prior written permission of Digital Equipment Corporation. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
49 * |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
50 * 3) This software is provided "AS-IS" and any express or implied warranties, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
51 * including but not limited to, any implied warranties of merchantability, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
52 * fitness for a particular purpose, or non-infringement are disclaimed. In |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
53 * no event shall DIGITAL be liable for any damages whatsoever, and in |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
54 * particular, DIGITAL shall not be liable for special, indirect, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
55 * consequential, or incidental damages or damages for |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
56 * lost profits, loss of revenue or loss of use, whether such damages arise |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
57 * in contract, |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
58 * negligence, tort, under statute, in equity, at law or otherwise, even if |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
59 * advised of the possibility of such damage. |
9c4ad35fabc5
Restore copyright/license notices that were stripped off.
diego
parents:
23934
diff
changeset
|
60 */ |
4164 | 61 |
26030 | 62 #ifndef MPLAYER_ASMMACROS_X86_H |
63 #define MPLAYER_ASMMACROS_X86_H | |
4164 | 64 |
4474 | 65 #include "config.h" |
66 | |
67 #ifdef CONFIG_DHAHELPER | |
68 #include <sys/ioctl.h> | |
26994 | 69 #include "vidix/dhahelper/dhahelper.h" |
4474 | 70 |
71 extern int dhahelper_fd; | |
72 extern int dhahelper_initialized; | |
73 #endif | |
74 | |
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
|
75 #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
|
76 #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
|
77 #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
|
78 |
12078
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
79 #ifndef SVGALIB_HELPER_IOC_MAGIC |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
80 /* svgalib 1.9.18+ compatibility ::atmos */ |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
81 #define SVGALIB_HELPER_IOCSOUTB SVGAHELPER_OUTB |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
82 #define SVGALIB_HELPER_IOCSOUTW SVGAHELPER_OUTW |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
83 #define SVGALIB_HELPER_IOCSOUTL SVGAHELPER_OUTL |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
84 #define SVGALIB_HELPER_IOCGINB SVGAHELPER_INB |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
85 #define SVGALIB_HELPER_IOCGINW SVGAHELPER_INW |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
86 #define SVGALIB_HELPER_IOCGINL SVGAHELPER_INL |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
87 #endif |
62705b2298ff
svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents:
10980
diff
changeset
|
88 |
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
|
89 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
|
90 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
|
91 |
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 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
|
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 io_t iov; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
95 |
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
|
96 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
|
97 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
|
98 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
|
99 } |
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
|
100 |
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
|
101 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
|
102 { |
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
|
103 io_t iov; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
104 |
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
|
105 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
|
106 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
|
107 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
|
108 } |
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
|
109 |
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
|
110 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
|
111 { |
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
|
112 io_t iov; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
113 |
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
|
114 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
|
115 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
|
116 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
|
117 } |
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
|
118 |
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 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
|
120 { |
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 io_t iov; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
122 |
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
|
123 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
|
124 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINB, &iov); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
125 |
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
|
126 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
|
127 } |
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
|
128 |
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
|
129 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
|
130 { |
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
|
131 io_t iov; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
132 |
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
|
133 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
|
134 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINW, &iov); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
135 |
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
|
136 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
|
137 } |
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
|
138 |
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
|
139 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
|
140 { |
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
|
141 io_t iov; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
142 |
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
|
143 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
|
144 ioctl(svgahelper_fd, SVGALIB_HELPER_IOCGINL, &iov); |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
145 |
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
|
146 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
|
147 } |
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 #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
|
149 |
4164 | 150 static __inline__ void outb(short port,char val) |
151 { | |
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
|
152 #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
|
153 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
|
154 { |
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
|
155 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
|
156 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
|
157 } |
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
|
158 #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
|
159 |
4474 | 160 #ifdef CONFIG_DHAHELPER |
161 if (dhahelper_initialized == 1) | |
162 { | |
163 dhahelper_port_t _port; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
164 |
4474 | 165 _port.operation = PORT_OP_WRITE; |
166 _port.addr = port; | |
167 _port.size = 1; | |
168 _port.value = val; | |
169 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0) | |
170 return; | |
171 } | |
172 else | |
173 #endif | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
174 __asm__ volatile("outb %0,%1" : :"a" (val), "d" (port)); |
4474 | 175 return; |
4164 | 176 } |
177 | |
178 static __inline__ void outw(short port,short val) | |
179 { | |
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
|
180 #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
|
181 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
|
182 { |
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 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
|
184 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
|
185 } |
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
|
186 #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
|
187 |
4474 | 188 #ifdef CONFIG_DHAHELPER |
189 if (dhahelper_initialized == 1) | |
190 { | |
191 dhahelper_port_t _port; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
192 |
4474 | 193 _port.operation = PORT_OP_WRITE; |
194 _port.addr = port; | |
195 _port.size = 2; | |
196 _port.value = val; | |
197 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0) | |
198 return; | |
199 } | |
200 else | |
201 #endif | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
202 __asm__ volatile("outw %0,%1" : :"a" (val), "d" (port)); |
4474 | 203 return; |
4164 | 204 } |
205 | |
206 static __inline__ void outl(short port,unsigned int val) | |
207 { | |
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
|
208 #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
|
209 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
|
210 { |
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 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
|
212 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
|
213 } |
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
|
214 #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
|
215 |
4474 | 216 #ifdef CONFIG_DHAHELPER |
217 if (dhahelper_initialized == 1) | |
218 { | |
219 dhahelper_port_t _port; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
220 |
4474 | 221 _port.operation = PORT_OP_WRITE; |
222 _port.addr = port; | |
223 _port.size = 4; | |
224 _port.value = val; | |
225 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0) | |
226 return; | |
227 } | |
228 else | |
229 #endif | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
230 __asm__ volatile("outl %0,%1" : :"a" (val), "d" (port)); |
4474 | 231 return; |
4164 | 232 } |
233 | |
234 static __inline__ unsigned int inb(short port) | |
235 { | |
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
|
236 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
|
237 |
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 #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
|
239 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
|
240 { |
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 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
|
242 } |
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 #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
|
244 |
4474 | 245 #ifdef CONFIG_DHAHELPER |
246 if (dhahelper_initialized == 1) | |
247 { | |
248 dhahelper_port_t _port; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
249 |
4474 | 250 _port.operation = PORT_OP_READ; |
251 _port.addr = port; | |
252 _port.size = 1; | |
253 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0) | |
254 return _port.value; | |
255 } | |
256 else | |
257 #endif | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
258 __asm__ volatile("inb %1,%0" : |
4164 | 259 "=a" (ret) : |
260 "d" (port)); | |
261 return ret; | |
262 } | |
263 | |
264 static __inline__ unsigned int inw(short port) | |
265 { | |
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
|
266 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
|
267 |
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 #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
|
269 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
|
270 { |
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
|
271 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
|
272 } |
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
|
273 #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
|
274 |
4474 | 275 #ifdef CONFIG_DHAHELPER |
276 if (dhahelper_initialized == 1) | |
277 { | |
278 dhahelper_port_t _port; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
279 |
4474 | 280 _port.operation = PORT_OP_READ; |
281 _port.addr = port; | |
282 _port.size = 2; | |
283 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0) | |
284 return _port.value; | |
285 } | |
286 else | |
287 #endif | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
288 __asm__ volatile("inw %1,%0" : |
4164 | 289 "=a" (ret) : |
290 "d" (port)); | |
291 return ret; | |
292 } | |
293 | |
294 static __inline__ unsigned int inl(short port) | |
295 { | |
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
|
296 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
|
297 |
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
|
298 #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
|
299 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
|
300 { |
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
|
301 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
|
302 } |
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
|
303 #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
|
304 |
4474 | 305 #ifdef CONFIG_DHAHELPER |
306 if (dhahelper_initialized == 1) | |
307 { | |
308 dhahelper_port_t _port; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29212
diff
changeset
|
309 |
4474 | 310 _port.operation = PORT_OP_READ; |
311 _port.addr = port; | |
312 _port.size = 4; | |
313 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0) | |
314 return _port.value; | |
315 } | |
316 else | |
317 #endif | |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
318 __asm__ volatile("inl %1,%0" : |
4164 | 319 "=a" (ret) : |
320 "d" (port)); | |
321 return ret; | |
322 } | |
323 | |
29212
eda346733b8c
Add missing 'void' to parameterless function declarations.
diego
parents:
27757
diff
changeset
|
324 static __inline__ void intr_disable(void) |
4164 | 325 { |
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
|
326 #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
|
327 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
|
328 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
|
329 #endif |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
330 __asm__ volatile("cli"); |
4164 | 331 } |
332 | |
29212
eda346733b8c
Add missing 'void' to parameterless function declarations.
diego
parents:
27757
diff
changeset
|
333 static __inline__ void intr_enable(void) |
4164 | 334 { |
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
|
335 #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
|
336 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
|
337 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
|
338 #endif |
27757
b5a46071062a
Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents:
26996
diff
changeset
|
339 __asm__ volatile("sti"); |
4164 | 340 } |
341 | |
26030 | 342 #endif /* MPLAYER_ASMMACROS_X86_H */ |