annotate libdha/sysdep/AsmMacros_powerpc.h @ 4506:84e45c414ae9

vidix equalizer can be used with 1-8 keys also
author gabucino
date Sun, 03 Feb 2002 11:19:12 +0000
parents 2e3262002acb
children 704c0fbb8e80
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
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
10 #if defined(Lynx)
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 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
21 *(uchar *)(ioBase + port) = value; eieio();
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 #else
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
59 #error This stuff is not ported on your system
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
60 #endif
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
61
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
62 #endif