annotate vidix/AsmMacros.h @ 24970:938e685a263c

ack, can't believe i wrote this crap with void pointer arithmetic gimme some cola!!! since the code was disabled and tests had shown it was slower, i'm just removing it rather than fixing it.
author rfelker
date Fri, 09 Nov 2007 12:51:43 +0000
parents a9e111b88c4a
children 6ac1ece1f9fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
1 /* $XConsortium: AsmMacros.h /main/13 1996/10/25 11:33:12 kaleb $ */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
2 /*
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
3 * (c) Copyright 1993,1994 by David Wexelblat <dwex@xfree86.org>
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
4 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
5 * Permission is hereby granted, free of charge, to any person obtaining a
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
6 * copy of this software and associated documentation files (the "Software"),
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
7 * to deal in the Software without restriction, including without limitation
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
9 * and/or sell copies of the Software, and to permit persons to whom the
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
10 * Software is furnished to do so, subject to the following conditions:
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
11 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
12 * The above copyright notice and this permission notice shall be included in
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
13 * all copies or substantial portions of the Software.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
14 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
18 * DAVID WEXELBLAT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
21 * SOFTWARE.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
22 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
23 * Except as contained in this notice, the name of David Wexelblat shall not be
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
24 * used in advertising or otherwise to promote the sale, use or other dealings
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
25 * in this Software without prior written authorization from David Wexelblat.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
26 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
27 */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
28 /*
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
29 * Copyright 1997
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
30 * Digital Equipment Corporation. All rights reserved.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
31 * This software is furnished under license and may be used and copied only in
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
32 * accordance with the following terms and conditions. Subject to these
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
33 * conditions, you may download, copy, install, use, modify and distribute
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
34 * this software in source and/or binary form. No title or ownership is
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
35 * transferred hereby.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
36 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
37 * 1) Any source code used, modified or distributed must reproduce and retain
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
38 * this copyright notice and list of conditions as they appear in the source
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
39 * file.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
40 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
41 * 2) No right is granted to use any trade name, trademark, or logo of Digital
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
42 * Equipment Corporation. Neither the "Digital Equipment Corporation" name
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
43 * nor any trademark or logo of Digital Equipment Corporation may be used
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
44 * to endorse or promote products derived from this software without the
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
45 * prior written permission of Digital Equipment Corporation.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
46 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
47 * 3) This software is provided "AS-IS" and any express or implied warranties,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
48 * including but not limited to, any implied warranties of merchantability,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
49 * fitness for a particular purpose, or non-infringement are disclaimed. In
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
50 * no event shall DIGITAL be liable for any damages whatsoever, and in
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
51 * particular, DIGITAL shall not be liable for special, indirect,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
52 * consequential, or incidental damages or damages for
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
53 * lost profits, loss of revenue or loss of use, whether such damages arise
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
54 * in contract,
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
55 * negligence, tort, under statute, in equity, at law or otherwise, even if
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
56 * advised of the possibility of such damage.
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
57 *
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
58 */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
59
4102
7b85e545cfb9 Sync with XFree86-4.1.99.5+
nick
parents: 3973
diff changeset
60 /* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $ */
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
61
4164
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
62 /*
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
63 * Modified for readability by Nick Kurshev
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
64 */
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
65
4164
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
66 #if defined(__GNUC__)
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
67 #if defined(__alpha__)
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
68 #include "sysdep/AsmMacros_alpha.h"
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
69 #elif defined(__ia64__)
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
70 #include "sysdep/AsmMacros_ia64.h"
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
71 #elif defined(__sparc__)
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
72 #include "sysdep/AsmMacros_sparc.h"
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
73 #elif defined( __arm32__ )
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
74 #include "sysdep/AsmMacros_arm32.h"
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
75 #elif defined(__powerpc__)
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
76 #include "sysdep/AsmMacros_powerpc.h"
4102
7b85e545cfb9 Sync with XFree86-4.1.99.5+
nick
parents: 3973
diff changeset
77 #else
4164
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
78 #include "sysdep/AsmMacros_x86.h"
2e3262002acb Improved readability and new stuffs
nick
parents: 4112
diff changeset
79 #endif
3973
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
80
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
81 #else /* __GNUC__ */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
82
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
83 #if defined(_MINIX) && defined(_ACK)
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
84
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
85 /* inb, outb, inw and outw are defined in the library */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
86 /* ... but I've no idea if the same is true for inl & outl */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
87
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
88 u8_t inb(U16_t);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
89 void outb(U16_t, U8_t);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
90 u16_t inw(U16_t);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
91 void outw(U16_t, U16_t);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
92 u32_t inl(U16_t);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
93 void outl(U16_t, U32_t);
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
94
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
95 #else /* not _MINIX and _ACK */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
96
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
97 # if defined(__STDC__) && (__STDC__ == 1)
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
98 # ifndef NCR
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
99 # define asm __asm
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
100 # endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
101 # endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
102 # ifdef SVR4
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
103 # include <sys/types.h>
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
104 # ifndef __USLC__
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
105 # define __USLC__
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
106 # endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
107 # endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
108 #ifndef SCO325
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
109 # include <sys/inline.h>
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
110 #else
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
111 # include "../common/scoasm.h"
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
112 #endif
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
113 #define intr_disable() asm("cli")
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
114 #define intr_enable() asm("sti")
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
115
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
116 #endif /* _MINIX and _ACK */
138800dfbe22 preliminary support of direct hardware access
nick
parents:
diff changeset
117 #endif /* __GNUC__ */