annotate vidix/sysdep/AsmMacros_x86.h @ 25481:b393dffbbcc7

Remove wrong and misleading comments.
author diego
date Sat, 22 Dec 2007 18:49:28 +0000
parents 9c4ad35fabc5
children d9999b74ce98
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
23934
88bed2131f19 Identifiers starting with underscores are reserved.
diego
parents: 22900
diff changeset
62 #ifndef ASMMACROS_X86_H
88bed2131f19 Identifiers starting with underscores are reserved.
diego
parents: 22900
diff changeset
63 #define ASMMACROS_X86_H
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
64
10980
e687fa1d55c6 port libdha to mingw
faust3
parents: 8503
diff changeset
65 //#if defined (WINNT)
e687fa1d55c6 port libdha to mingw
faust3
parents: 8503
diff changeset
66 //#error This stuff is not ported on your system
e687fa1d55c6 port libdha to mingw
faust3
parents: 8503
diff changeset
67 //#else
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
68
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
69 #include "config.h"
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
70
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
71 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
72 #include <sys/ioctl.h>
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
73 #include "../kernelhelper/dhahelper.h"
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
74
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
75 extern int dhahelper_fd;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
76 extern int dhahelper_initialized;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
77 #endif
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
78
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
79 #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
80 #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
81 #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
82
12078
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
83 #ifndef SVGALIB_HELPER_IOC_MAGIC
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
84 /* svgalib 1.9.18+ compatibility ::atmos */
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
85 #define SVGALIB_HELPER_IOCSOUTB SVGAHELPER_OUTB
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
86 #define SVGALIB_HELPER_IOCSOUTW SVGAHELPER_OUTW
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
87 #define SVGALIB_HELPER_IOCSOUTL SVGAHELPER_OUTL
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
88 #define SVGALIB_HELPER_IOCGINB SVGAHELPER_INB
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
89 #define SVGALIB_HELPER_IOCGINW SVGAHELPER_INW
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
90 #define SVGALIB_HELPER_IOCGINL SVGAHELPER_INL
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
91 #endif
62705b2298ff svgalib 1.9.18 compile fix, still wont work for me though...
atmos4
parents: 10980
diff changeset
92
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 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
94 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
95
9dbb9c710480 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 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
97 {
9dbb9c710480 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 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
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 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
101 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
102 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
103 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
104
9dbb9c710480 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 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
106 {
9dbb9c710480 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 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
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 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
110 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
111 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
112 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
113
9dbb9c710480 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 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
115 {
9dbb9c710480 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 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
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 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
119 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
120 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
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
9dbb9c710480 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 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
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 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
126
9dbb9c710480 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 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
128 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
129
9dbb9c710480 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 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
131 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
132
9dbb9c710480 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 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
134 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
135 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
136
9dbb9c710480 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 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
138 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
139
9dbb9c710480 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 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
141 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
142
9dbb9c710480 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 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
144 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
145 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
146
9dbb9c710480 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 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
148 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
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 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
151 }
9dbb9c710480 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 #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
153
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
154 static __inline__ void outb(short port,char val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
155 {
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
156 #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
157 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
158 {
9dbb9c710480 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 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
160 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
161 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
162 #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
163
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
164 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
165 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
166 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
167 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
168
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
169 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
170 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
171 _port.size = 1;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
172 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
173 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
174 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
175 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
176 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
177 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
178 __asm__ __volatile__("outb %0,%1" : :"a" (val), "d" (port));
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
179 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
180 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
181
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
182 static __inline__ void outw(short port,short val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
183 {
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
184 #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
185 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
186 {
9dbb9c710480 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 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
188 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
189 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
190 #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
191
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
192 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
193 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
194 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
195 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
196
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
197 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
198 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
199 _port.size = 2;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
200 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
201 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
202 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
203 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
204 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
205 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
206 __asm__ __volatile__("outw %0,%1" : :"a" (val), "d" (port));
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
207 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
208 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
209
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
210 static __inline__ void outl(short port,unsigned int val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
211 {
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
212 #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
213 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
214 {
9dbb9c710480 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 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
216 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
217 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
218 #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
219
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
220 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
221 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
222 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
223 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
224
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
225 _port.operation = PORT_OP_WRITE;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
226 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
227 _port.size = 4;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
228 _port.value = val;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
229 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
230 return;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
231 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
232 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
233 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
234 __asm__ __volatile__("outl %0,%1" : :"a" (val), "d" (port));
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
235 return;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
236 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
237
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
238 static __inline__ unsigned int inb(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
239 {
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
240 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
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 #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
243 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
244 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
245 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
246 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
247 #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
248
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
249 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
250 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
251 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
252 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
253
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
254 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
255 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
256 _port.size = 1;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
257 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
258 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
259 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
260 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
261 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
262 __asm__ __volatile__("inb %1,%0" :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
263 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
264 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
265 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
266 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
267
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
268 static __inline__ unsigned int inw(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
269 {
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
270 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
271
9dbb9c710480 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 #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
273 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
274 {
9dbb9c710480 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 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
276 }
9dbb9c710480 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
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
278
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
279 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
280 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
281 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
282 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
283
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
284 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
285 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
286 _port.size = 2;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
287 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
288 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
289 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
290 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
291 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
292 __asm__ __volatile__("inw %1,%0" :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
293 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
294 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
295 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
296 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
297
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
298 static __inline__ unsigned int inl(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
299 {
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
300 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
301
9dbb9c710480 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 #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
303 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
304 {
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
305 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
306 }
9dbb9c710480 svgalib kernelhelper support (based on patch by Matan Ziv-Av <matan@svgalib.org>) and some reordering/cleanup (part #1 ;)
alex
parents: 4474
diff changeset
307 #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
308
4474
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
309 #ifdef CONFIG_DHAHELPER
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
310 if (dhahelper_initialized == 1)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
311 {
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
312 dhahelper_port_t _port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
313
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
314 _port.operation = PORT_OP_READ;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
315 _port.addr = port;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
316 _port.size = 4;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
317 if (ioctl(dhahelper_fd, DHAHELPER_PORT, &_port) == 0)
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
318 return _port.value;
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
319 }
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
320 else
05ac3586db02 added support for dhahelper
alex
parents: 4164
diff changeset
321 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
322 __asm__ __volatile__("inl %1,%0" :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
323 "=a" (ret) :
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
324 "d" (port));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
325 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
326 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
327
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
328 static __inline__ void intr_disable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
329 {
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
330 #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
331 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
332 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
333 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
334 __asm__ __volatile__("cli");
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
335 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
336
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
337 static __inline__ void intr_enable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
338 {
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
339 #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
340 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
341 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
342 #endif
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
343 __asm__ __volatile__("sti");
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
344 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
345
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
346 #endif
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
347
23934
88bed2131f19 Identifiers starting with underscores are reserved.
diego
parents: 22900
diff changeset
348 //#endif /* ASMMACROS_X86_H */