[PATCH] tty_io.c balance tty_ldisc_ref()
[linux/fpc-iii.git] / include / asm-arm / arch-rpc / uncompress.h
blob06231ede54e5c05c82ec1b8d8b625fb2da1f6a31
1 /*
2 * linux/include/asm-arm/arch-rpc/uncompress.h
4 * Copyright (C) 1996 Russell King
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)
12 #include <asm/hardware.h>
13 #include <asm/io.h>
15 int video_num_columns, video_num_lines, video_size_row;
16 int white, bytes_per_char_h;
17 extern unsigned long con_charconvtable[256];
19 struct param_struct {
20 unsigned long page_size;
21 unsigned long nr_pages;
22 unsigned long ramdisk_size;
23 unsigned long mountrootrdonly;
24 unsigned long rootdev;
25 unsigned long video_num_cols;
26 unsigned long video_num_rows;
27 unsigned long video_x;
28 unsigned long video_y;
29 unsigned long memc_control_reg;
30 unsigned char sounddefault;
31 unsigned char adfsdrives;
32 unsigned char bytes_per_char_h;
33 unsigned char bytes_per_char_v;
34 unsigned long unused[256/4-11];
37 static const unsigned long palette_4[16] = {
38 0x00000000,
39 0x000000cc,
40 0x0000cc00, /* Green */
41 0x0000cccc, /* Yellow */
42 0x00cc0000, /* Blue */
43 0x00cc00cc, /* Magenta */
44 0x00cccc00, /* Cyan */
45 0x00cccccc, /* White */
46 0x00000000,
47 0x000000ff,
48 0x0000ff00,
49 0x0000ffff,
50 0x00ff0000,
51 0x00ff00ff,
52 0x00ffff00,
53 0x00ffffff
56 #define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
57 #define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
60 * params_phys is a linker defined symbol - see
61 * arch/arm/boot/compressed/Makefile
63 extern __attribute__((pure)) struct param_struct *params(void);
64 #define params (params())
66 #ifndef STANDALONE_DEBUG
68 * This does not append a newline
70 static void putc(int c)
72 extern void ll_write_char(char *, char c, char white);
73 int x,y;
74 char *ptr;
76 x = params->video_x;
77 y = params->video_y;
79 if (c == '\n') {
80 if (++y >= video_num_lines)
81 y--;
82 } else if (c == '\r') {
83 x = 0;
84 } else {
85 ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
86 ll_write_char(ptr, c, white);
87 if (++x >= video_num_columns) {
88 x = 0;
89 if ( ++y >= video_num_lines ) {
90 y--;
95 params->video_x = x;
96 params->video_y = y;
99 static inline void flush(void)
103 static void error(char *x);
106 * Setup for decompression
108 static void arch_decomp_setup(void)
110 int i;
112 video_num_lines = params->video_num_rows;
113 video_num_columns = params->video_num_cols;
114 bytes_per_char_h = params->bytes_per_char_h;
115 video_size_row = video_num_columns * bytes_per_char_h;
116 if (bytes_per_char_h == 4)
117 for (i = 0; i < 256; i++)
118 con_charconvtable[i] =
119 (i & 128 ? 1 << 0 : 0) |
120 (i & 64 ? 1 << 4 : 0) |
121 (i & 32 ? 1 << 8 : 0) |
122 (i & 16 ? 1 << 12 : 0) |
123 (i & 8 ? 1 << 16 : 0) |
124 (i & 4 ? 1 << 20 : 0) |
125 (i & 2 ? 1 << 24 : 0) |
126 (i & 1 ? 1 << 28 : 0);
127 else
128 for (i = 0; i < 16; i++)
129 con_charconvtable[i] =
130 (i & 8 ? 1 << 0 : 0) |
131 (i & 4 ? 1 << 8 : 0) |
132 (i & 2 ? 1 << 16 : 0) |
133 (i & 1 ? 1 << 24 : 0);
136 palette_setpixel(0);
137 if (bytes_per_char_h == 1) {
138 palette_write (0);
139 palette_write (0x00ffffff);
140 for (i = 2; i < 256; i++)
141 palette_write (0);
142 white = 1;
143 } else {
144 for (i = 0; i < 256; i++)
145 palette_write (i < 16 ? palette_4[i] : 0);
146 white = 7;
149 if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
151 #endif
154 * nothing to do
156 #define arch_decomp_wdog()