sti-bmode.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:5k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. #define STI_REGION_MAX 8
  2. #define STI_DEV_NAME_LENGTH 32
  3. typedef struct {
  4.  u8 res[3];
  5.  u8 data;
  6. } __attribute__((packed)) sti_u8;
  7. typedef struct {
  8. sti_u8 data[2];
  9. } __attribute__((packed)) sti_u16;
  10. typedef struct {
  11. sti_u8 data[4];
  12. } __attribute__((packed)) sti_u32;
  13. #define  STI_U8( u8) ((u8).data)
  14. #define STI_U16(u16) ((STI_U8((u16).data[0])<<8) | STI_U8((u16).data[1]))
  15. #define STI_U32(u32) ((STI_U8((u32).data[0])<<24) | 
  16.       (STI_U8((u32).data[1])<<16) | 
  17.       (STI_U8((u32).data[2])<< 8) | 
  18.       (STI_U8((u32).data[3])<< 0))
  19. struct sti_rom_region {
  20. sti_u32 region;
  21. };
  22. struct sti_rom_font {
  23. sti_u16 first_char;
  24. sti_u16 last_char;
  25.  sti_u8 width;
  26.  sti_u8 height;
  27.  sti_u8 font_type;
  28.  sti_u8 bytes_per_char;
  29. sti_u32 next_font;
  30.  sti_u8 underline_height;
  31.  sti_u8 underline_pos;
  32.  sti_u8 res008[2];
  33. };
  34. struct sti_rom {
  35.  sti_u8 type;
  36.  sti_u8 num_mons;
  37.  sti_u8 revno[2];
  38.  sti_u8 graphics_id[8]; /* 0x010 */
  39. sti_u32 font_start; /* 0x030 */
  40. sti_u32 statesize;
  41. sti_u32 last_addr;
  42. sti_u32 region_list;
  43. sti_u16 reentsize; /* 0x070 */
  44. sti_u16 maxtime;
  45. sti_u32 mon_tbl_addr;
  46. sti_u32 user_data_addr;
  47. sti_u32 sti_mem_req;
  48. sti_u32 user_data_size; /* 0x0b0 */
  49. sti_u16 power; /* 0x0c0 */
  50.  sti_u8 bus_support;
  51.  sti_u8 ext_bus_support;
  52.  sti_u8 alt_code_type; /* 0x0d0 */
  53.  sti_u8 ext_dd_struct[3];
  54. sti_u32 cfb_addr; /* 0x0e0 */
  55.  sti_u8 res0f0[4];
  56. sti_u32 init_graph; /* 0x0e0 */
  57. sti_u32 state_mgmt;
  58. sti_u32 font_unpmv;
  59. sti_u32 block_move;
  60. sti_u32 self_test;
  61. sti_u32 excep_hdlr;
  62. sti_u32 inq_conf;
  63. sti_u32 set_cm_entry;
  64. sti_u32 dma_ctrl;
  65. sti_u32 flow_ctrl;
  66. sti_u32 user_timing;
  67. sti_u32 process_mgr;
  68. sti_u32 sti_util;
  69. sti_u32 end_addr;
  70. sti_u32 res0b8;
  71. sti_u32 res0bc;
  72. sti_u32 init_graph_m68k; /* 0x0e0 */
  73. sti_u32 state_mgmt_m68k;
  74. sti_u32 font_unpmv_m68k;
  75. sti_u32 block_move_m68k;
  76. sti_u32 self_test_m68k;
  77. sti_u32 excep_hdlr_m68k;
  78. sti_u32 inq_conf_m68k;
  79. sti_u32 set_cm_entry_m68k;
  80. sti_u32 dma_ctrl_m68k;
  81. sti_u32 flow_ctrl_m68k;
  82. sti_u32 user_timing_m68k;
  83. sti_u32 process_mgr_m68k;
  84. sti_u32 sti_util_m68k;
  85. sti_u32 end_addr_m68k;
  86. sti_u32 res0b8_m68k;
  87. sti_u32 res0bc_m68k;
  88.  sti_u8 res040[7 * 4];
  89. };
  90. struct sti_cooked_font {
  91. struct sti_rom_font *raw;
  92. struct sti_cooked_font *next_font;
  93. };
  94. struct sti_cooked_rom {
  95. struct sti_rom *raw;
  96. struct sti_cooked_font *font_start;
  97. u32 *region_list;
  98. };
  99. struct sti_glob_cfg_ext {
  100.  u8 curr_mon;
  101.  u8 friendly_boot;
  102. s16 power;
  103. s32 freq_ref;
  104. s32 *sti_mem_addr;
  105. s32 *future_ptr;
  106. };
  107. struct sti_glob_cfg {
  108. s32 text_planes;
  109. s16 onscreen_x;
  110. s16 onscreen_y;
  111. s16 offscreen_x;
  112. s16 offscreen_y;
  113. s16 total_x;
  114. s16 total_y;
  115. u32 region_ptrs[STI_REGION_MAX];
  116. s32 reent_lvl;
  117. s32 *save_addr;
  118. struct sti_glob_cfg_ext *ext_ptr;
  119. };
  120. struct sti_init_flags {
  121. u32 wait : 1;
  122. u32 reset : 1;
  123. u32 text : 1;
  124. u32 nontext : 1;
  125. u32 clear : 1;
  126. u32 cmap_blk : 1;
  127. u32 enable_be_timer : 1;
  128. u32 enable_be_int : 1;
  129. u32 no_chg_tx : 1;
  130. u32 no_chg_ntx : 1;
  131. u32 no_chg_bet : 1;
  132. u32 no_chg_bei : 1;
  133. u32 init_cmap_tx : 1;
  134. u32 cmt_chg : 1;
  135. u32 retain_ie : 1;
  136. u32 pad : 17;
  137. s32 *future_ptr;
  138. };
  139. struct sti_init_inptr_ext {
  140. u8  config_mon_type;
  141. u8  pad[1];
  142. u16 inflight_data;
  143. s32 *future_ptr;
  144. };
  145. struct sti_init_inptr {
  146. s32 text_planes;
  147. struct sti_init_inptr_ext *ext_ptr;
  148. };
  149. struct sti_init_outptr {
  150. s32 errno;
  151. s32 text_planes;
  152. s32 *future_ptr;
  153. };
  154. struct sti_conf_flags {
  155. u32 wait : 1;
  156. u32 pad : 31;
  157. s32 *future_ptr;
  158. };
  159. struct sti_conf_inptr {
  160. s32 *future_ptr;
  161. };
  162. struct sti_conf_outptr_ext {
  163. u32 crt_config[3];
  164. u32 crt_hdw[3];
  165. s32 *future_ptr;
  166. };
  167. struct sti_conf_outptr {
  168. s32 errno;
  169. s16 onscreen_x;
  170. s16 onscreen_y;
  171. s16 offscreen_x;
  172. s16 offscreen_y;
  173. s16 total_x;
  174. s16 total_y;
  175. s32 bits_per_pixel;
  176. s32 bits_used;
  177. s32 planes;
  178.  u8 dev_name[STI_DEV_NAME_LENGTH];
  179. u32 attributes;
  180. struct sti_conf_outptr_ext *ext_ptr;
  181. };
  182. struct sti_font_inptr {
  183. u32 font_start_addr;
  184. s16 index;
  185. u8 fg_color;
  186. u8 bg_color;
  187. s16 dest_x;
  188. s16 dest_y;
  189. s32 *future_ptr;
  190. };
  191. struct sti_font_flags {
  192. u32 wait : 1;
  193. u32 non_text : 1;
  194. u32 pad : 30;
  195. s32 *future_ptr;
  196. };
  197. struct sti_font_outptr {
  198. s32 errno;
  199. s32 *future_ptr;
  200. };
  201. struct sti_blkmv_flags {
  202. u32 wait : 1;
  203. u32 color : 1;
  204. u32 clear : 1;
  205. u32 non_text : 1;
  206. u32 pad : 28;
  207. s32 *future_ptr;
  208. };
  209. struct sti_blkmv_inptr {
  210. u8 fg_color;
  211. u8 bg_color;
  212. s16 src_x;
  213. s16 src_y;
  214. s16 dest_x;
  215. s16 dest_y;
  216. s16 width;
  217. s16 height;
  218. s32 *future_ptr;
  219. };
  220. struct sti_blkmv_outptr {
  221. s32 errno;
  222. s32 *future_ptr;
  223. };
  224. struct sti_struct {
  225. spinlock_t lock;
  226. struct sti_cooked_rom *rom;
  227. unsigned long font_unpmv;
  228. unsigned long block_move;
  229. unsigned long init_graph;
  230. unsigned long inq_conf;
  231. struct sti_glob_cfg *glob_cfg;
  232. struct sti_rom_font *font;
  233. s32 text_planes;
  234. char **mon_strings;
  235. u32 *regions;
  236.  u8 *pci_regions;
  237. };
  238. #define STI_CALL(func, flags, inptr, outptr, glob_cfg) 
  239. ({  
  240. real32_call( func, (unsigned long)STI_PTR(flags), 
  241.     STI_PTR(inptr), STI_PTR(outptr), 
  242.     glob_cfg); 
  243. })