annotate libdha/sysdep/AsmMacros_arm32.h @ 8141:be9a2636b071

use the more stable NEWTYPE critsect code
author arpi
date Sun, 10 Nov 2002 21:04:10 +0000
parents 2e3262002acb
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_ARM32_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
8 #define __ASM_MACROS_ARM32_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
9 unsigned int IOPortBase; /* Memory mapped I/O port area */
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
10
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
11 static __inline__ void outb(short port,char val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
12 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
13 if ((unsigned short)port >= 0x400) return;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
14 *(volatile unsigned char*)(((unsigned short)(port))+IOPortBase) = val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
15 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
16
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
17 static __inline__ void outw(short port,short val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
18 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
19 if ((unsigned short)port >= 0x400) return;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
20 *(volatile unsigned short*)(((unsigned short)(port))+IOPortBase) = val;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
21 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
22
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
23 static __inline__ void outl(short port,int val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
24 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
25 if ((unsigned short)port >= 0x400) return;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
26 *(volatile unsigned long*)(((unsigned short)(port))+IOPortBase) = val;
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__ unsigned int inb(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
30 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
31 if ((unsigned short)port >= 0x400) return((unsigned int)-1);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
32 return(*(volatile unsigned char*)(((unsigned short)(port))+IOPortBase));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
33 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
34
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
35 static __inline__ unsigned int inw(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
36 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
37 if ((unsigned short)port >= 0x400) return((unsigned int)-1);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
38 return(*(volatile unsigned short*)(((unsigned short)(port))+IOPortBase));
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 int inl(short port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
42 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
43 if ((unsigned short)port >= 0x400) return((unsigned int)-1);
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
44 return(*(volatile unsigned long*)(((unsigned short)(port))+IOPortBase));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
45 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
46
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
47 #define intr_disable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
48 #define intr_enable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
49
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
50 #endif