osdef.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:6k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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