annotate vidix/sysdep/AsmMacros_x86.h @ 35542:fdaab02e7118

Set volume in GUI_SET_MIXER. This in missing in r35631.
author ib
date Sun, 09 Dec 2012 14:41:24 +0000
parents 958431e2cde0
children
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 */
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
61
26030
a93e46adb54c Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25532
diff changeset
62 #ifndef MPLAYER_ASMMACROS_X86_H
a93e46adb54c Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25532
diff changeset
63 #define MPLAYER_ASMMACROS_X86_H
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
64
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
65 #include "config.h"
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
66
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
67 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
68 #include <sys/ioctl.h>
26994
4eb30f58ea41 Fix dhahelper.h #include paths.
diego
parents: 26901
diff changeset
69 #include "vidix/dhahelper/dhahelper.h"
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
70
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
71 extern int dhahelper_fd;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
72 extern int dhahelper_initialized;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
73 #endif
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
92 static inline void svga_outb(short port, char value)
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
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
101 static inline void svga_outw(short port, char value)
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
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
110 static inline void svga_outl(short port, unsigned int value)
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
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
119 static inline unsigned int svga_inb(short port)
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
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
129 static inline unsigned int svga_inw(short port)
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
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
139 static inline unsigned int svga_inl(short port)
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
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
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
150 static inline void outb(short port, char val)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
160 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
161 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
162 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
163 dhahelper_port_t _port;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29212
diff changeset
164
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
165 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
166 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
167 _port.size = 1;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
168 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
169 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
170 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
171 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
172 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
175 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
176 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
177
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
178 static inline void outw(short port, short val)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
188 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
189 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
190 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
191 dhahelper_port_t _port;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29212
diff changeset
192
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
193 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
194 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
195 _port.size = 2;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
196 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
197 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
198 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
199 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
200 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
203 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
204 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
205
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
206 static inline void outl(short port, unsigned int val)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
216 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
217 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
218 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
219 dhahelper_port_t _port;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29212
diff changeset
220
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
221 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
222 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
223 _port.size = 4;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
224 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
225 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
226 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
227 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
228 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
231 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
232 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
233
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
234 static inline unsigned int inb(short port)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
245 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
246 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
247 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
248 dhahelper_port_t _port;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29212
diff changeset
249
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
250 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
251 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
252 _port.size = 1;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
253 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
254 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
255 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
256 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
259 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
260 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
261 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
262 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
263
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
264 static inline unsigned int inw(short port)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
275 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
276 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
277 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
278 dhahelper_port_t _port;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29212
diff changeset
279
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
280 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
281 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
282 _port.size = 2;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
283 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
284 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
285 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
286 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
289 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
290 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
291 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
292 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
293
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
294 static inline unsigned int inl(short port)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
305 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
306 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
307 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
308 dhahelper_port_t _port;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 29212
diff changeset
309
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
310 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
311 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
312 _port.size = 4;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
313 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
314 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
315 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
316 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
319 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
320 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
321 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
322 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
323
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
324 static inline void intr_disable(void)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
331 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
332
34653
958431e2cde0 Make inline keyword handling consistent.
diego
parents: 29263
diff changeset
333 static inline void intr_enable(void)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
340 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
341
26030
a93e46adb54c Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25532
diff changeset
342 #endif /* MPLAYER_ASMMACROS_X86_H */