annotate vidix/sysdep/AsmMacros_powerpc.h @ 33983:2218c589f9ab

Cosmetic: Rename parameters bf img in bitmap.c.
author ib
date Tue, 06 Sep 2011 14:59:04 +0000
parents eda346733b8c
children 958431e2cde0
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: 25132
diff changeset
62 #ifndef MPLAYER_ASMMACROS_POWERPC_H
a93e46adb54c Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25132
diff changeset
63 #define MPLAYER_ASMMACROS_POWERPC_H
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
64
6635
704c0fbb8e80 oops forgot to commit, part of Bj«Órn Sandells libdha obsd ppc fixes.
atmos4
parents: 4164
diff changeset
65 #if defined(Lynx) || defined(__OpenBSD__)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
66
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
67 extern unsigned char *ioBase;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
68
29212
eda346733b8c Add missing 'void' to parameterless function declarations.
diego
parents: 27757
diff changeset
69 static __inline__ volatile void eieio(void)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
70 {
27757
b5a46071062a Replace all occurrences of '__volatile__' and '__volatile' by plain 'volatile'.
diego
parents: 26753
diff changeset
71 __asm__ volatile ("eieio");
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
72 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
73
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
74 static __inline__ void outb(short port, unsigned char value)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
75 {
6635
704c0fbb8e80 oops forgot to commit, part of Bj«Órn Sandells libdha obsd ppc fixes.
atmos4
parents: 4164
diff changeset
76 *(unsigned char *)(ioBase + port) = value; eieio();
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
77 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
78
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
79 static __inline__ void outw(short port, unsigned short value)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
80 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
81 *(unsigned short *)(ioBase + port) = value; eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
82 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
83
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
84 static __inline__ void outl(short port, unsigned short value)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
85 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
86 *(unsigned long *)(ioBase + port) = value; eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
87 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
88
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
89 static __inline__ unsigned char inb(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
90 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
91 unsigned char val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
92 val = *((unsigned char *)(ioBase + port)); eieio();
26753
502f04b67653 cosmetics: Remove useless parentheses from return statements.
diego
parents: 26030
diff changeset
93 return val;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
94 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
95
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
96 static __inline__ unsigned short inw(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
97 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
98 unsigned short val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
99 val = *((unsigned short *)(ioBase + port)); eieio();
26753
502f04b67653 cosmetics: Remove useless parentheses from return statements.
diego
parents: 26030
diff changeset
100 return val;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
101 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
102
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
103 static __inline__ unsigned long inl(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
104 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
105 unsigned long val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
106 val = *((unsigned long *)(ioBase + port)); eieio();
26753
502f04b67653 cosmetics: Remove useless parentheses from return statements.
diego
parents: 26030
diff changeset
107 return val;
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
108 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
109
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
110 #define intr_disable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
111 #define intr_enable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
112
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
113 #endif
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
114
26030
a93e46adb54c Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25132
diff changeset
115 #endif /* MPLAYER_ASMMACROS_POWERPC_H */