annotate vidix/sysdep/AsmMacros_sparc.h @ 22987:4f439985c7ce

synced with r23003
author Gabrov
date Mon, 16 Apr 2007 11:13:12 +0000
parents a9e111b88c4a
children 88bed2131f19
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_SPARC_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
8 #define __ASM_MACROS_SPARC_H
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
9
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
10 #ifndef ASI_PL
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
11 #define ASI_PL 0x88
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
12 #endif
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
13
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
14 static __inline__ void outb(unsigned long port, char val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
15 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
16 __asm__ __volatile__("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
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 outw(unsigned long port, char val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
20 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
21 __asm__ __volatile__("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
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 outl(unsigned long port, char val)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
25 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
26 __asm__ __volatile__("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
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(unsigned long port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
30 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
31 unsigned char ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
32 __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
33 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
34 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
35
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
36 static __inline__ unsigned int inw(unsigned long port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
37 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
38 unsigned char ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
39 __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
40 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
41 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
42
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
43 static __inline__ unsigned int inl(unsigned long port)
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
44 {
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
45 unsigned char ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
46 __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
47 return ret;
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
48 }
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
49
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
50 #define intr_disable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
51 #define intr_enable()
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
52
2e3262002acb Improved readability and new stuffs
nick
parents:
diff changeset
53 #endif