5 * Copyright (C) 2001-2004 by Thomas Winischhofer, Vienna, Austria
7 * If distributed as part of the Linux kernel, the following license terms
10 * * This program is free software; you can redistribute it and/or modify
11 * * it under the terms of the GNU General Public License as published by
12 * * the Free Software Foundation; either version 2 of the named License,
13 * * or any later version.
15 * * This program is distributed in the hope that it will be useful,
16 * * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * * GNU General Public License for more details.
20 * * You should have received a copy of the GNU General Public License
21 * * along with this program; if not, write to the Free Software
22 * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24 * Otherwise, the following license terms apply:
26 * * Redistribution and use in source and binary forms, with or without
27 * * modification, are permitted provided that the following conditions
29 * * 1) Redistributions of source code must retain the above copyright
30 * * notice, this list of conditions and the following disclaimer.
31 * * 2) Redistributions in binary form must reproduce the above copyright
32 * * notice, this list of conditions and the following disclaimer in the
33 * * documentation and/or other materials provided with the distribution.
34 * * 3) All advertising materials mentioning features or use of this software
35 * * must display the following acknowledgement: "This product includes
36 * * software developed by Thomas Winischhofer, Vienna, Austria."
37 * * 4) The name of the author may not be used to endorse or promote products
38 * * derived from this software without specific prior written permission.
40 * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
41 * * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42 * * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
43 * * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
44 * * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
46 * * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
47 * * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
48 * * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
49 * * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 * Author: Thomas Winischhofer <thomas@winischhofer.net>
52 * Silicon Integrated Systems, Inc. (used by permission)
56 /* The choices are: */
58 #define LINUX_KERNEL /* Kernel framebuffer */
59 /* #define LINUX_XF86 */ /* XFree86 */
61 /**********************************************************************/
62 #ifdef LINUX_KERNEL /* -------------------------- */
63 #include <linux/config.h>
64 #include <linux/version.h>
66 #ifdef CONFIG_FB_SIS_300
70 #ifdef CONFIG_FB_SIS_315
75 #define SISFBACCEL /* Include 2D acceleration */
80 #ifdef LINUX_XF86 /* ----------------------------- */
85 /**********************************************************************/
87 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
88 #define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
92 #define SiS_SetMemory(MemoryAddress,MemorySize,value) memset(MemoryAddress, value, MemorySize)
93 #define SiS_MemoryCopy(Destination,Soruce,Length) memcpy(Destination,Soruce,Length)
96 /**********************************************************************/
100 #endif /* OutPortByte */
104 #endif /* OutPortWord */
108 #endif /* OutPortLong */
112 #endif /* InPortByte */
116 #endif /* InPortWord */
120 #endif /* InPortLong */
122 /**********************************************************************/
124 /**********************************************************************/
127 #define OutPortByte(p,v) outb((CARD16)(p),(CARD8)(v))
128 #define OutPortWord(p,v) outw((CARD16)(p),(CARD16)(v))
129 #define OutPortLong(p,v) outl((CARD16)(p),(CARD32)(v))
130 #define InPortByte(p) inb((CARD16)(p))
131 #define InPortWord(p) inw((CARD16)(p))
132 #define InPortLong(p) inl((CARD16)(p))
135 /**********************************************************************/
137 /**********************************************************************/
140 #define OutPortByte(p,v) outb((u8)(v),(u16)(p))
141 #define OutPortWord(p,v) outw((u16)(v),(u16)(p))
142 #define OutPortLong(p,v) outl((u32)(v),(u16)(p))
143 #define InPortByte(p) inb((u16)(p))
144 #define InPortWord(p) inw((u16)(p))
145 #define InPortLong(p) inl((u16)(p))