OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [asm-armnommu/] [arch-a5k/] [uncompress.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1633 jcastillo
/*
2
 * linux/include/asm-arm/arch-a5k/uncompress.h
3
 *
4
 * Copyright (C) 1996 Russell King
5
 */
6
#define VIDMEM ((char *)0x02000000)
7
 
8
#include "../arch/arm/drivers/char/font.h"
9
 
10
int video_num_columns, video_num_lines, video_size_row;
11
int white, bytes_per_char_h;
12
extern unsigned long con_charconvtable[256];
13
 
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
 
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
 
44
        x = params->video_x;
45
        y = params->video_y;
46
 
47
        while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
48
                if ( c == '\n' ) {
49
                        x = 0;
50
                        if ( ++y >= video_num_lines ) {
51
                                y--;
52
                        }
53
                } else {
54
                        ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
55
                        ll_write_char(ptr, c|(white<<8));
56
                        if ( ++x >= video_num_columns ) {
57
                                x = 0;
58
                                if ( ++y >= video_num_lines ) {
59
                                        y--;
60
                                }
61
                        }
62
                }
63
        }
64
 
65
        params->video_x = x;
66
        params->video_y = y;
67
}
68
 
69
static void error(char *x);
70
 
71
/*
72
 * Setup for decompression
73
 */
74
static void arch_decomp_setup(void)
75
{
76
        int i;
77
 
78
        video_num_lines = params->video_num_rows;
79
        video_num_columns = params->video_num_cols;
80
        bytes_per_char_h = params->bytes_per_char_h;
81
        video_size_row = video_num_columns * bytes_per_char_h;
82
        if (bytes_per_char_h == 4)
83
                for (i = 0; i < 256; i++)
84
                        con_charconvtable[i] =
85
                                (i & 128 ? 1 << 0  : 0) |
86
                                (i & 64  ? 1 << 4  : 0) |
87
                                (i & 32  ? 1 << 8  : 0) |
88
                                (i & 16  ? 1 << 12 : 0) |
89
                                (i & 8   ? 1 << 16 : 0) |
90
                                (i & 4   ? 1 << 20 : 0) |
91
                                (i & 2   ? 1 << 24 : 0) |
92
                                (i & 1   ? 1 << 28 : 0);
93
        else
94
                for (i = 0; i < 16; i++)
95
                        con_charconvtable[i] =
96
                                (i & 8   ? 1 << 0  : 0) |
97
                                (i & 4   ? 1 << 8  : 0) |
98
                                (i & 2   ? 1 << 16 : 0) |
99
                                (i & 1   ? 1 << 24 : 0);
100
 
101
        white = bytes_per_char_h == 8 ? 0xfc : 7;
102
 
103
        if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
104
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.