~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-rpc/include/mach/uncompress.h

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.10 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.83 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.153 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.200 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.200 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.76 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  arch/arm/mach-rpc/include/mach/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 *)SCREEN_START)
 11  
 12 #include <linux/io.h>
 13 #include <mach/hardware.h>
 14 #include <asm/setup.h>
 15 #include <asm/page.h>
 16 
 17 int video_size_row;
 18 unsigned char bytes_per_char_h;
 19 extern unsigned long con_charconvtable[256];
 20 
 21 struct param_struct {
 22         unsigned long page_size;
 23         unsigned long nr_pages;
 24         unsigned long ramdisk_size;
 25         unsigned long mountrootrdonly;
 26         unsigned long rootdev;
 27         unsigned long video_num_cols;
 28         unsigned long video_num_rows;
 29         unsigned long video_x;
 30         unsigned long video_y;
 31         unsigned long memc_control_reg;
 32         unsigned char sounddefault;
 33         unsigned char adfsdrives;
 34         unsigned char bytes_per_char_h;
 35         unsigned char bytes_per_char_v;
 36         unsigned long unused[256/4-11];
 37 };
 38 
 39 static const unsigned long palette_4[16] = {
 40         0x00000000,
 41         0x000000cc,
 42         0x0000cc00,             /* Green   */
 43         0x0000cccc,             /* Yellow  */
 44         0x00cc0000,             /* Blue    */
 45         0x00cc00cc,             /* Magenta */
 46         0x00cccc00,             /* Cyan    */
 47         0x00cccccc,             /* White   */
 48         0x00000000,
 49         0x000000ff,
 50         0x0000ff00,
 51         0x0000ffff,
 52         0x00ff0000,
 53         0x00ff00ff,
 54         0x00ffff00,
 55         0x00ffffff
 56 };
 57 
 58 #define palette_setpixel(p)     *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
 59 #define palette_write(v)        *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
 60 
 61 /*
 62  * params_phys is a linker defined symbol - see
 63  * arch/arm/boot/compressed/Makefile
 64  */
 65 extern __attribute__((pure)) struct param_struct *params(void);
 66 #define params (params())
 67 
 68 #ifndef STANDALONE_DEBUG 
 69 unsigned long video_num_cols;
 70 unsigned long video_num_rows;
 71 unsigned long video_x;
 72 unsigned long video_y;
 73 unsigned char bytes_per_char_v;
 74 int white;
 75 
 76 /*
 77  * This does not append a newline
 78  */
 79 static void putc(int c)
 80 {
 81         extern void ll_write_char(char *, char c, char white);
 82         int x,y;
 83         char *ptr;
 84 
 85         x = video_x;
 86         y = video_y;
 87 
 88         if (c == '\n') {
 89                 if (++y >= video_num_rows)
 90                         y--;
 91         } else if (c == '\r') {
 92                 x = 0;
 93         } else {
 94                 ptr = VIDMEM + ((y*video_num_cols*bytes_per_char_v+x)*bytes_per_char_h);
 95                 ll_write_char(ptr, c, white);
 96                 if (++x >= video_num_cols) {
 97                         x = 0;
 98                         if ( ++y >= video_num_rows ) {
 99                                 y--;
100                         }
101                 }
102         }
103 
104         video_x = x;
105         video_y = y;
106 }
107 
108 static inline void flush(void)
109 {
110 }
111 
112 /*
113  * Setup for decompression
114  */
115 static void arch_decomp_setup(void)
116 {
117         int i;
118         struct tag *t = (struct tag *)params;
119         unsigned int nr_pages = 0, page_size = PAGE_SIZE;
120 
121         if (t->hdr.tag == ATAG_CORE)
122         {
123                 for (; t->hdr.size; t = tag_next(t))
124                 {
125                         if (t->hdr.tag == ATAG_VIDEOTEXT)
126                         {
127                                 video_num_rows = t->u.videotext.video_lines;
128                                 video_num_cols = t->u.videotext.video_cols;
129                                 bytes_per_char_h = t->u.videotext.video_points;
130                                 bytes_per_char_v = t->u.videotext.video_points;
131                                 video_x = t->u.videotext.x;
132                                 video_y = t->u.videotext.y;
133                         }
134 
135                         if (t->hdr.tag == ATAG_MEM)
136                         {
137                                 page_size = PAGE_SIZE;
138                                 nr_pages += (t->u.mem.size / PAGE_SIZE);
139                         }
140                 }
141         }
142         else
143         {
144                 nr_pages = params->nr_pages;
145                 page_size = params->page_size;
146                 video_num_rows = params->video_num_rows;
147                 video_num_cols = params->video_num_cols;
148                 video_x = params->video_x;
149                 video_y = params->video_y;
150                 bytes_per_char_h = params->bytes_per_char_h;
151                 bytes_per_char_v = params->bytes_per_char_v;
152         }
153 
154         video_size_row = video_num_cols * bytes_per_char_h;
155         
156         if (bytes_per_char_h == 4)
157                 for (i = 0; i < 256; i++)
158                         con_charconvtable[i] =
159                                 (i & 128 ? 1 << 0  : 0) |
160                                 (i & 64  ? 1 << 4  : 0) |
161                                 (i & 32  ? 1 << 8  : 0) |
162                                 (i & 16  ? 1 << 12 : 0) |
163                                 (i & 8   ? 1 << 16 : 0) |
164                                 (i & 4   ? 1 << 20 : 0) |
165                                 (i & 2   ? 1 << 24 : 0) |
166                                 (i & 1   ? 1 << 28 : 0);
167         else
168                 for (i = 0; i < 16; i++)
169                         con_charconvtable[i] =
170                                 (i & 8   ? 1 << 0  : 0) |
171                                 (i & 4   ? 1 << 8  : 0) |
172                                 (i & 2   ? 1 << 16 : 0) |
173                                 (i & 1   ? 1 << 24 : 0);
174 
175 
176         palette_setpixel(0);
177         if (bytes_per_char_h == 1) {
178                 palette_write (0);
179                 palette_write (0x00ffffff);
180                 for (i = 2; i < 256; i++)
181                         palette_write (0);
182                 white = 1;
183         } else {
184                 for (i = 0; i < 256; i++)
185                         palette_write (i < 16 ? palette_4[i] : 0);
186                 white = 7;
187         }
188 
189         if (nr_pages * page_size < 4096*1024) error("<4M of mem\n");
190 }
191 #endif
192 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp