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

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/include/asm-arm/arch-arc/uncompress.h
  3.  *
  4.  *  Copyright (C) 1996 Russell King
  5.  *
  6.  * This program is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License version 2 as
  8.  * published by the Free Software Foundation.
  9.  */
  10. #define VIDMEM ((char *)0x02000000)
  11.  
  12. int video_num_columns, video_num_lines, video_size_row;
  13. int white, bytes_per_char_h;
  14. extern unsigned long con_charconvtable[256];
  15. struct param_struct {
  16. unsigned long page_size;
  17. unsigned long nr_pages;
  18. unsigned long ramdisk_size;
  19. unsigned long mountrootrdonly;
  20. unsigned long rootdev;
  21. unsigned long video_num_cols;
  22. unsigned long video_num_rows;
  23. unsigned long video_x;
  24. unsigned long video_y;
  25. unsigned long memc_control_reg;
  26. unsigned char sounddefault;
  27. unsigned char adfsdrives;
  28. unsigned char bytes_per_char_h;
  29. unsigned char bytes_per_char_v;
  30. unsigned long unused[256/4-11];
  31. };
  32. static struct param_struct *params = (struct param_struct *)0x0207c000;
  33.  
  34. /*
  35.  * This does not append a newline
  36.  */
  37. static void puts(const char *s)
  38. {
  39. extern void ll_write_char(char *, unsigned long);
  40. int x,y;
  41. unsigned char c;
  42. char *ptr;
  43. x = params->video_x;
  44. y = params->video_y;
  45. while ( ( c = *(unsigned char *)s++ ) != '' ) {
  46. if ( c == 'n' ) {
  47. x = 0;
  48. if ( ++y >= video_num_lines ) {
  49. y--;
  50. }
  51. } else {
  52. ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
  53. ll_write_char(ptr, c|(white<<16));
  54. if ( ++x >= video_num_columns ) {
  55. x = 0;
  56. if ( ++y >= video_num_lines ) {
  57. y--;
  58. }
  59. }
  60. }
  61. }
  62. params->video_x = x;
  63. params->video_y = y;
  64. }
  65. static void error(char *x);
  66. /*
  67.  * Setup for decompression
  68.  */
  69. static void arch_decomp_setup(void)
  70. {
  71. int i;
  72. video_num_lines = params->video_num_rows;
  73. video_num_columns = params->video_num_cols;
  74. bytes_per_char_h = params->bytes_per_char_h;
  75. video_size_row = video_num_columns * bytes_per_char_h;
  76. if (bytes_per_char_h == 4)
  77. for (i = 0; i < 256; i++)
  78. con_charconvtable[i] =
  79. (i & 128 ? 1 << 0  : 0) |
  80. (i & 64  ? 1 << 4  : 0) |
  81. (i & 32  ? 1 << 8  : 0) |
  82. (i & 16  ? 1 << 12 : 0) |
  83. (i & 8   ? 1 << 16 : 0) |
  84. (i & 4   ? 1 << 20 : 0) |
  85. (i & 2   ? 1 << 24 : 0) |
  86. (i & 1   ? 1 << 28 : 0);
  87. else
  88. for (i = 0; i < 16; i++)
  89. con_charconvtable[i] =
  90. (i & 8   ? 1 << 0  : 0) |
  91. (i & 4   ? 1 << 8  : 0) |
  92. (i & 2   ? 1 << 16 : 0) |
  93. (i & 1   ? 1 << 24 : 0);
  94. white = bytes_per_char_h == 8 ? 0xfc : 7;
  95. if (params->nr_pages * params->page_size < 4096*1024) error("<4M of memn");
  96. }
  97. /*
  98.  * nothing to do
  99.  */
  100. #define arch_decomp_wdog()