uncompress.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. int video_num_columns, video_num_lines, video_size_row;
  12. int white, bytes_per_char_h;
  13. extern unsigned long con_charconvtable[256];
  14. struct param_struct {
  15. unsigned long page_size;
  16. unsigned long nr_pages;
  17. unsigned long ramdisk_size;
  18. unsigned long mountrootrdonly;
  19. unsigned long rootdev;
  20. unsigned long video_num_cols;
  21. unsigned long video_num_rows;
  22. unsigned long video_x;
  23. unsigned long video_y;
  24. unsigned long memc_control_reg;
  25. unsigned char sounddefault;
  26. unsigned char adfsdrives;
  27. unsigned char bytes_per_char_h;
  28. unsigned char bytes_per_char_v;
  29. unsigned long unused[256/4-11];
  30. };
  31. static struct param_struct *params = (struct param_struct *)0x0207c000;
  32. /*
  33. * This does not append a newline
  34. */
  35. static void puts(const char *s)
  36. {
  37. extern void ll_write_char(char *, unsigned long);
  38. int x,y;
  39. unsigned char c;
  40. char *ptr;
  41. x = params->video_x;
  42. y = params->video_y;
  43. while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
  44. if ( c == '\n' ) {
  45. x = 0;
  46. if ( ++y >= video_num_lines ) {
  47. y--;
  48. }
  49. } else {
  50. ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
  51. ll_write_char(ptr, c|(white<<16));
  52. if ( ++x >= video_num_columns ) {
  53. x = 0;
  54. if ( ++y >= video_num_lines ) {
  55. y--;
  56. }
  57. }
  58. }
  59. }
  60. params->video_x = x;
  61. params->video_y = y;
  62. }
  63. static void error(char *x);
  64. /*
  65. * Setup for decompression
  66. */
  67. static void arch_decomp_setup(void)
  68. {
  69. int i;
  70. video_num_lines = params->video_num_rows;
  71. video_num_columns = params->video_num_cols;
  72. bytes_per_char_h = params->bytes_per_char_h;
  73. video_size_row = video_num_columns * bytes_per_char_h;
  74. if (bytes_per_char_h == 4)
  75. for (i = 0; i < 256; i++)
  76. con_charconvtable[i] =
  77. (i & 128 ? 1 << 0 : 0) |
  78. (i & 64 ? 1 << 4 : 0) |
  79. (i & 32 ? 1 << 8 : 0) |
  80. (i & 16 ? 1 << 12 : 0) |
  81. (i & 8 ? 1 << 16 : 0) |
  82. (i & 4 ? 1 << 20 : 0) |
  83. (i & 2 ? 1 << 24 : 0) |
  84. (i & 1 ? 1 << 28 : 0);
  85. else
  86. for (i = 0; i < 16; i++)
  87. con_charconvtable[i] =
  88. (i & 8 ? 1 << 0 : 0) |
  89. (i & 4 ? 1 << 8 : 0) |
  90. (i & 2 ? 1 << 16 : 0) |
  91. (i & 1 ? 1 << 24 : 0);
  92. white = bytes_per_char_h == 8 ? 0xfc : 7;
  93. if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
  94. }
  95. /*
  96. * nothing to do
  97. */
  98. #define arch_decomp_wdog()