1/* #define WINCE_HEADER */
2/* #define WIN2000 */
3/* #define TC */
4#define LINUX_KERNEL	   /* Kernel framebuffer */
5/* #define LINUX_XF86 */   /* XFree86 */
6
7/**********************************************************************/
8#ifdef LINUX_KERNEL
9	#include <linux/config.h>
10	#include <linux/version.h>
11	#ifdef CONFIG_FB_SIS_300
12 		#define SIS300
13	#endif
14
15	#ifdef CONFIG_FB_SIS_315
16		#define SIS315H
17	#endif
18	#if 1
19		#define SISFBACCEL	/* Include 2D acceleration */
20	#endif
21	#if 1
22		#define SISFB_PAN	/* Include Y-Panning code */
23	#endif
24#else
25/*	#define SIS300*/
26	#define SIS315H
27#endif
28#ifdef LINUX_XF86
29	#define SIS300
30	/* #define SIS315H */ /* TW: done above */
31#endif
32
33/**********************************************************************/
34#ifdef TC
35#endif
36#ifdef WIN2000
37#endif
38#ifdef WINCE_HEADER
39#endif
40#ifdef LINUX_XF86
41#endif
42#ifdef LINUX_KERNEL
43#endif
44/**********************************************************************/
45#ifdef TC
46#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
47#endif
48#ifdef WIN2000
49#define SiS_SetMemory(MemoryAddress,MemorySize,value) MemFill((PVOID) MemoryAddress,(ULONG) MemorySize,(UCHAR) value);
50#endif
51#ifdef WINCE_HEADER
52#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize);
53#endif
54#ifdef LINUX_XF86
55#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
56#endif
57#ifdef LINUX_KERNEL
58#define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
59#endif
60/**********************************************************************/
61
62/**********************************************************************/
63
64#ifdef TC
65#define SiS_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
66#endif
67#ifdef WIN2000
68#define SiS_MemoryCopy(Destination,Soruce,Length)  /*VideoPortMoveMemory((PUCHAR)Destination , Soruce,length);*/
69#endif
70#ifdef WINCE_HEADER
71#define SiS_MemoryCopy(Destination,Soruce,Length) memmove(Destination, Soruce, Length);
72#endif
73#ifdef LINUX_XF86
74#define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
75#endif
76#ifdef LINUX_KERNEL
77#define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
78#endif
79
80/**********************************************************************/
81
82#ifdef OutPortByte
83#undef OutPortByte
84#endif /* OutPortByte */
85
86#ifdef OutPortWord
87#undef OutPortWord
88#endif /* OutPortWord */
89
90#ifdef OutPortLong
91#undef OutPortLong
92#endif /* OutPortLong */
93
94#ifdef InPortByte
95#undef InPortByte
96#endif /* InPortByte */
97
98#ifdef InPortWord
99#undef InPortWord
100#endif /* InPortWord */
101
102#ifdef InPortLong
103#undef InPortLong
104#endif /* InPortLong */
105
106/**********************************************************************/
107/*  TC                                                                */
108/**********************************************************************/
109
110#ifdef TC
111#define OutPortByte(p,v) outp((unsigned short)(p),(unsigned char)(v))
112#define OutPortWord(p,v) outp((unsigned short)(p),(unsigned short)(v))
113#define OutPortLong(p,v) outp((unsigned short)(p),(unsigned long)(v))
114#define InPortByte(p)    inp((unsigned short)(p))
115#define InPortWord(p)    inp((unsigned short)(p))
116#define InPortLong(p)    ((inp((unsigned short)(p+2))<<16) | inp((unsigned short)(p)))
117#endif
118
119/**********************************************************************/
120/*  LINUX XF86                                                        */
121/**********************************************************************/
122
123#ifdef LINUX_XF86
124#define OutPortByte(p,v) outb((CARD16)(p),(CARD8)(v))
125#define OutPortWord(p,v) outw((CARD16)(p),(CARD16)(v))
126#define OutPortLong(p,v) outl((CARD16)(p),(CARD32)(v))
127#define InPortByte(p)    inb((CARD16)(p))
128#define InPortWord(p)    inw((CARD16)(p))
129#define InPortLong(p)    inl((CARD16)(p))
130#endif
131
132/**********************************************************************/
133/*  LINUX KERNEL                                                      */
134/**********************************************************************/
135
136#ifdef LINUX_KERNEL
137#define OutPortByte(p,v) outb((u8)(v),(u16)(p))
138#define OutPortWord(p,v) outw((u16)(v),(u16)(p))
139#define OutPortLong(p,v) outl((u32)(v),(u16)(p))
140#define InPortByte(p)    inb((u16)(p))
141#define InPortWord(p)    inw((u16)(p))
142#define InPortLong(p)    inl((u16)(p))
143#endif
144
145/**********************************************************************/
146/*  WIN 2000                                                          */
147/**********************************************************************/
148
149#ifdef WIN2000
150#define OutPortByte(p,v) VideoPortWritePortUchar ((PUCHAR) (p), (UCHAR) (v))
151#define OutPortWord(p,v) VideoPortWritePortUshort((PUSHORT) (p), (USHORT) (v))
152#define OutPortLong(p,v) VideoPortWritePortUlong ((PULONG) (p), (ULONG) (v))
153#define InPortByte(p)    VideoPortReadPortUchar  ((PUCHAR) (p))
154#define InPortWord(p)    VideoPortReadPortUshort ((PUSHORT) (p))
155#define InPortLong(p)    VideoPortReadPortUlong  ((PULONG) (p))
156#endif
157
158
159/**********************************************************************/
160/*  WIN CE                                                            */
161/**********************************************************************/
162
163#ifdef WINCE_HEADER
164#define OutPortByte(p,v) WRITE_PORT_UCHAR ((PUCHAR) (p), (UCHAR) (v))
165#define OutPortWord(p,v) WRITE_PORT_USHORT((PUSHORT) (p), (USHORT) (v))
166#define OutPortLong(p,v) WRITE_PORT_ULONG ((PULONG) (p), (ULONG) (v))
167#define InPortByte(p)    READ_PORT_UCHAR  ((PUCHAR) (p))
168#define InPortWord(p)    READ_PORT_USHORT ((PUSHORT) (p))
169#define InPortLong(p)    READ_PORT_ULONG  ((PULONG) (p))
170#endif
171