]> bbs.cooldavid.org Git - net-next-2.6.git/blob - drivers/staging/xgifb/osdef.h
staging: Add framebuffer driver for XGI chipsets
[net-next-2.6.git] / drivers / staging / xgifb / osdef.h
1 #ifndef _OSDEF_H_
2 #define _OSDEF_H_
3
4 /* #define WINCE_HEADER*/
5 /*#define WIN2000*/
6 /* #define TC */
7 #define LINUX_KERNEL
8 /* #define LINUX_XF86 */
9
10 /**********************************************************************/
11 #ifdef LINUX_KERNEL
12 //#include <linux/config.h>
13 #endif
14
15
16 /**********************************************************************/
17 #ifdef TC
18 #endif
19 #ifdef WIN2000
20 #endif
21 #ifdef WINCE_HEADER
22 #endif
23 #ifdef LINUX_XF86
24 #define LINUX
25 #endif
26 #ifdef LINUX_KERNEL
27 #define LINUX
28 #endif
29
30 /**********************************************************************/
31 #ifdef TC
32 #define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
33 #endif
34 #ifdef WIN2000
35 #define XGI_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value);
36 #endif
37 #ifdef WINCE_HEADER
38 #define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
39 #endif
40 #ifdef LINUX_XF86
41 #define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
42 #endif
43 #ifdef LINUX_KERNEL
44 #define XGI_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
45 #endif
46 /**********************************************************************/
47
48 /**********************************************************************/
49
50 #ifdef TC
51 #define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
52 #endif
53 #ifdef WIN2000
54 #define XGI_MemoryCopy(Destination,Soruce,Length)  /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/
55 #endif
56 #ifdef WINCE_HEADER
57 #define XGI_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
58 #endif
59 #ifdef LINUX_XF86
60 #define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
61 #endif
62 #ifdef LINUX_KERNEL
63 #define XGI_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
64 #endif
65
66 /**********************************************************************/
67
68 #ifdef OutPortByte
69 #undef OutPortByte
70 #endif /* OutPortByte */
71
72 #ifdef OutPortWord
73 #undef OutPortWord
74 #endif /* OutPortWord */
75
76 #ifdef OutPortLong
77 #undef OutPortLong
78 #endif /* OutPortLong */
79
80 #ifdef InPortByte
81 #undef InPortByte
82 #endif /* InPortByte */
83
84 #ifdef InPortWord
85 #undef InPortWord
86 #endif /* InPortWord */
87
88 #ifdef InPortLong
89 #undef InPortLong
90 #endif /* InPortLong */
91
92 /**********************************************************************/
93 /*  TC                                                                */
94 /**********************************************************************/
95
96 #ifdef TC
97 #define OutPortByte(p,v) outp((unsigned short)(p),(unsigned char)(v))
98 #define OutPortWord(p,v) outp((unsigned short)(p),(unsigned short)(v))
99 #define OutPortLong(p,v) outp((unsigned short)(p),(unsigned long)(v))
100 #define InPortByte(p)    inp((unsigned short)(p))
101 #define InPortWord(p)    inp((unsigned short)(p))
102 #define InPortLong(p)    ((inp((unsigned short)(p+2))<<16) | inp((unsigned short)(p)))
103 #endif
104
105 /**********************************************************************/
106 /*  LINUX XF86                                                        */
107 /**********************************************************************/
108
109 #ifdef LINUX_XF86
110 #define OutPortByte(p,v) outb((CARD16)(p),(CARD8)(v))
111 #define OutPortWord(p,v) outw((CARD16)(p),(CARD16)(v))
112 #define OutPortLong(p,v) outl((CARD16)(p),(CARD32)(v))
113 #define InPortByte(p)    inb((CARD16)(p))
114 #define InPortWord(p)    inw((CARD16)(p))
115 #define InPortLong(p)    inl((CARD16)(p))
116 #endif
117
118 #ifdef LINUX_KERNEL
119 #define OutPortByte(p,v) outb((u8)(v),(p))
120 #define OutPortWord(p,v) outw((u16)(v),(p))
121 #define OutPortLong(p,v) outl((u32)(v),(p))
122 #define InPortByte(p)    inb(p)
123 #define InPortWord(p)    inw(p)
124 #define InPortLong(p)    inl(p)
125 #endif
126
127 /**********************************************************************/
128 /*  WIN 2000                                                          */
129 /**********************************************************************/
130
131 #ifdef WIN2000
132 #define OutPortByte(p,v) VideoPortWritePortUchar ((PUCHAR) (p), (UCHAR) (v))
133 #define OutPortWord(p,v) VideoPortWritePortUshort((PUSHORT) (p), (USHORT) (v))
134 #define OutPortLong(p,v) VideoPortWritePortUlong ((PULONG) (p), (ULONG) (v))
135 #define InPortByte(p)    VideoPortReadPortUchar  ((PUCHAR) (p))
136 #define InPortWord(p)    VideoPortReadPortUshort ((PUSHORT) (p))
137 #define InPortLong(p)    VideoPortReadPortUlong  ((PULONG) (p))
138 #endif
139
140
141 /**********************************************************************/
142 /*  WIN CE                                                          */
143 /**********************************************************************/
144
145 #ifdef WINCE_HEADER
146 #define OutPortByte(p,v) WRITE_PORT_UCHAR ((PUCHAR) (p), (UCHAR) (v))
147 #define OutPortWord(p,v) WRITE_PORT_USHORT((PUSHORT) (p), (USHORT) (v))
148 #define OutPortLong(p,v) WRITE_PORT_ULONG ((PULONG) (p), (ULONG) (v))
149 #define InPortByte(p)    READ_PORT_UCHAR  ((PUCHAR) (p))
150 #define InPortWord(p)    READ_PORT_USHORT ((PUSHORT) (p))
151 #define InPortLong(p)    READ_PORT_ULONG  ((PULONG) (p))
152 #endif
153 #endif // _OSDEF_H_