[PATCH] W1: possible cleanups
[linux-2.6/verdex.git] / include / asm-arm26 / uncompress.h
blobdf2cba816a4ea1186a4323d2cfc8854003abe32b
1 /*
2 * linux/include/asm-arm/arch-arc/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 *)0x02000000)
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];
16 struct param_struct {
17 unsigned long page_size;
18 unsigned long nr_pages;
19 unsigned long ramdisk_size;
20 unsigned long mountrootrdonly;
21 unsigned long rootdev;
22 unsigned long video_num_cols;
23 unsigned long video_num_rows;
24 unsigned long video_x;
25 unsigned long video_y;
26 unsigned long memc_control_reg;
27 unsigned char sounddefault;
28 unsigned char adfsdrives;
29 unsigned char bytes_per_char_h;
30 unsigned char bytes_per_char_v;
31 unsigned long unused[256/4-11];
34 static struct param_struct *params = (struct param_struct *)0x0207c000;
37 * This does not append a newline
39 static void puts(const char *s)
41 extern void ll_write_char(char *, unsigned long);
42 int x,y;
43 unsigned char c;
44 char *ptr;
46 x = params->video_x;
47 y = params->video_y;
49 while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
50 if ( c == '\n' ) {
51 x = 0;
52 if ( ++y >= video_num_lines ) {
53 y--;
55 } else {
56 ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
57 ll_write_char(ptr, c|(white<<16));
58 if ( ++x >= video_num_columns ) {
59 x = 0;
60 if ( ++y >= video_num_lines ) {
61 y--;
67 params->video_x = x;
68 params->video_y = y;
71 static void error(char *x);
74 * Setup for decompression
76 static void arch_decomp_setup(void)
78 int i;
80 video_num_lines = params->video_num_rows;
81 video_num_columns = params->video_num_cols;
82 bytes_per_char_h = params->bytes_per_char_h;
83 video_size_row = video_num_columns * bytes_per_char_h;
84 if (bytes_per_char_h == 4)
85 for (i = 0; i < 256; i++)
86 con_charconvtable[i] =
87 (i & 128 ? 1 << 0 : 0) |
88 (i & 64 ? 1 << 4 : 0) |
89 (i & 32 ? 1 << 8 : 0) |
90 (i & 16 ? 1 << 12 : 0) |
91 (i & 8 ? 1 << 16 : 0) |
92 (i & 4 ? 1 << 20 : 0) |
93 (i & 2 ? 1 << 24 : 0) |
94 (i & 1 ? 1 << 28 : 0);
95 else
96 for (i = 0; i < 16; i++)
97 con_charconvtable[i] =
98 (i & 8 ? 1 << 0 : 0) |
99 (i & 4 ? 1 << 8 : 0) |
100 (i & 2 ? 1 << 16 : 0) |
101 (i & 1 ? 1 << 24 : 0);
103 white = bytes_per_char_h == 8 ? 0xfc : 7;
105 if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
109 * nothing to do
111 #define arch_decomp_wdog()