annotate libdha/sysdep/AsmMacros_powerpc.h @ 10409:4c9ca4819bed

Commands are read in a loop, but for some commands we need to break the loop to finish processing the command. Otherwise some commands may appears as skiped to the user.
author albeu
date Fri, 11 Jul 2003 07:54:52 +0000
parents 6d544beb655e
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 */
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
6
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
7 #ifndef __ASM_MACROS_POWERPC_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
8 #define __ASM_MACROS_POWERPC_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
9
6635
704c0fbb8e80 oops forgot to commit, part of Bj«Órn Sandells libdha obsd ppc fixes.
atmos4
parents: 4164
diff changeset
10 #if defined(Lynx) || defined(__OpenBSD__)
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
11
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
12 extern unsigned char *ioBase;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
13
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
14 static __inline__ volatile void eieio()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
15 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
16 __asm__ __volatile__ ("eieio");
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
17 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
18
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
19 static __inline__ void outb(short port, unsigned char value)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
20 {
6635
704c0fbb8e80 oops forgot to commit, part of Bj«Órn Sandells libdha obsd ppc fixes.
atmos4
parents: 4164
diff changeset
21 *(unsigned char *)(ioBase + port) = value; eieio();
4164
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
22 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
23
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
24 static __inline__ void outw(short port, unsigned short value)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
25 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
26 *(unsigned short *)(ioBase + port) = value; eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
27 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
28
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
29 static __inline__ void outl(short port, unsigned short value)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
30 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
31 *(unsigned long *)(ioBase + port) = value; eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
32 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
33
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
34 static __inline__ unsigned char inb(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
35 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
36 unsigned char val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
37 val = *((unsigned char *)(ioBase + port)); eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
38 return(val);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
39 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
40
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
41 static __inline__ unsigned short inw(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
42 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
43 unsigned short val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
44 val = *((unsigned short *)(ioBase + port)); eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
45 return(val);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
46 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
47
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
48 static __inline__ unsigned long inl(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
49 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
50 unsigned long val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
51 val = *((unsigned long *)(ioBase + port)); eieio();
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
52 return(val);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
53 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
54
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
55 #define intr_disable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
56 #define intr_enable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
57
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
58 #endif
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
59
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
60 #endif