4164
|
1 /*
|
|
2 This file is based on:
|
|
3 $XFree86: xc/programs/Xserver/hw/xfree86/drivers/chips/util/AsmMacros.h,v 1.1 2001/11/16 21:13:34 tsi Exp $
|
|
4 Modified for readability by Nick Kurshev
|
|
5 */
|
|
6
|
|
7 #ifndef __ASM_MACROS_SPARC_H
|
|
8 #define __ASM_MACROS_SPARC_H
|
|
9
|
|
10 #ifndef ASI_PL
|
|
11 #define ASI_PL 0x88
|
|
12 #endif
|
|
13
|
|
14 static __inline__ void outb(unsigned long port, char val)
|
|
15 {
|
|
16 __asm__ __volatile__("stba %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
|
|
17 }
|
|
18
|
|
19 static __inline__ void outw(unsigned long port, char val)
|
|
20 {
|
|
21 __asm__ __volatile__("stha %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
|
|
22 }
|
|
23
|
|
24 static __inline__ void outl(unsigned long port, char val)
|
|
25 {
|
|
26 __asm__ __volatile__("sta %0, [%1] %2" : : "r" (val), "r" (port), "i" (ASI_PL));
|
|
27 }
|
|
28
|
|
29 static __inline__ unsigned int inb(unsigned long port)
|
|
30 {
|
|
31 unsigned char ret;
|
|
32 __asm__ __volatile__("lduba [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
|
|
33 return ret;
|
|
34 }
|
|
35
|
|
36 static __inline__ unsigned int inw(unsigned long port)
|
|
37 {
|
|
38 unsigned char ret;
|
|
39 __asm__ __volatile__("lduha [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
|
|
40 return ret;
|
|
41 }
|
|
42
|
|
43 static __inline__ unsigned int inl(unsigned long port)
|
|
44 {
|
|
45 unsigned char ret;
|
|
46 __asm__ __volatile__("lda [%1] %2, %0" : "=r" (ret) : "r" (port), "i" (ASI_PL));
|
|
47 return ret;
|
|
48 }
|
|
49
|
|
50 #define intr_disable()
|
|
51 #define intr_enable()
|
|
52
|
|
53 #endif
|