diff options
author | Alan Hourihane <alanh@fairlite.demon.co.uk> | 2007-09-02 14:59:34 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-10-12 18:43:11 -0400 |
commit | e16edefe6532c032d86ee802b63972e3a1e953a9 (patch) | |
tree | 6c9c7aa8973719ff58013c7b5c7c1c87b1d5f3c3 /include/asm-arm/arch-rpc | |
parent | bf62e8626963d0002315facb786a8833d404e21e (diff) |
[ARM] 4564/1: Add tagged list support for Acorn RiscPC's uncompress code
arch_decomp_setup() does not understand the new tagged lists
for parameter setup. It's fixed in using the older param struct.
This patch adds support for tagged lists and allows the older
param struct too.
Signed-off-by: Alan Hourihane <alanh@fairlite.demon.co.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-rpc')
-rw-r--r-- | include/asm-arm/arch-rpc/uncompress.h | 72 |
1 files changed, 57 insertions, 15 deletions
diff --git a/include/asm-arm/arch-rpc/uncompress.h b/include/asm-arm/arch-rpc/uncompress.h index 06231ede54e5..b8e29efd8c5b 100644 --- a/include/asm-arm/arch-rpc/uncompress.h +++ b/include/asm-arm/arch-rpc/uncompress.h | |||
@@ -11,9 +11,11 @@ | |||
11 | 11 | ||
12 | #include <asm/hardware.h> | 12 | #include <asm/hardware.h> |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #include <asm/setup.h> | ||
15 | #include <asm/page.h> | ||
14 | 16 | ||
15 | int video_num_columns, video_num_lines, video_size_row; | 17 | int video_size_row; |
16 | int white, bytes_per_char_h; | 18 | unsigned char bytes_per_char_h; |
17 | extern unsigned long con_charconvtable[256]; | 19 | extern unsigned long con_charconvtable[256]; |
18 | 20 | ||
19 | struct param_struct { | 21 | struct param_struct { |
@@ -64,6 +66,13 @@ extern __attribute__((pure)) struct param_struct *params(void); | |||
64 | #define params (params()) | 66 | #define params (params()) |
65 | 67 | ||
66 | #ifndef STANDALONE_DEBUG | 68 | #ifndef STANDALONE_DEBUG |
69 | static unsigned long video_num_cols; | ||
70 | static unsigned long video_num_rows; | ||
71 | static unsigned long video_x; | ||
72 | static unsigned long video_y; | ||
73 | static unsigned char bytes_per_char_v; | ||
74 | static int white; | ||
75 | |||
67 | /* | 76 | /* |
68 | * This does not append a newline | 77 | * This does not append a newline |
69 | */ | 78 | */ |
@@ -73,27 +82,27 @@ static void putc(int c) | |||
73 | int x,y; | 82 | int x,y; |
74 | char *ptr; | 83 | char *ptr; |
75 | 84 | ||
76 | x = params->video_x; | 85 | x = video_x; |
77 | y = params->video_y; | 86 | y = video_y; |
78 | 87 | ||
79 | if (c == '\n') { | 88 | if (c == '\n') { |
80 | if (++y >= video_num_lines) | 89 | if (++y >= video_num_rows) |
81 | y--; | 90 | y--; |
82 | } else if (c == '\r') { | 91 | } else if (c == '\r') { |
83 | x = 0; | 92 | x = 0; |
84 | } else { | 93 | } else { |
85 | ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h); | 94 | ptr = VIDMEM + ((y*video_num_cols*bytes_per_char_v+x)*bytes_per_char_h); |
86 | ll_write_char(ptr, c, white); | 95 | ll_write_char(ptr, c, white); |
87 | if (++x >= video_num_columns) { | 96 | if (++x >= video_num_cols) { |
88 | x = 0; | 97 | x = 0; |
89 | if ( ++y >= video_num_lines ) { | 98 | if ( ++y >= video_num_rows ) { |
90 | y--; | 99 | y--; |
91 | } | 100 | } |
92 | } | 101 | } |
93 | } | 102 | } |
94 | 103 | ||
95 | params->video_x = x; | 104 | video_x = x; |
96 | params->video_y = y; | 105 | video_y = y; |
97 | } | 106 | } |
98 | 107 | ||
99 | static inline void flush(void) | 108 | static inline void flush(void) |
@@ -108,11 +117,44 @@ static void error(char *x); | |||
108 | static void arch_decomp_setup(void) | 117 | static void arch_decomp_setup(void) |
109 | { | 118 | { |
110 | int i; | 119 | int i; |
120 | struct tag *t = (struct tag *)params; | ||
121 | unsigned int nr_pages = 0, page_size = PAGE_SIZE; | ||
122 | |||
123 | if (t->hdr.tag == ATAG_CORE) | ||
124 | { | ||
125 | for (; t->hdr.size; t = tag_next(t)) | ||
126 | { | ||
127 | if (t->hdr.tag == ATAG_VIDEOTEXT) | ||
128 | { | ||
129 | video_num_rows = t->u.videotext.video_lines; | ||
130 | video_num_cols = t->u.videotext.video_cols; | ||
131 | bytes_per_char_h = t->u.videotext.video_points; | ||
132 | bytes_per_char_v = t->u.videotext.video_points; | ||
133 | video_x = t->u.videotext.x; | ||
134 | video_y = t->u.videotext.y; | ||
135 | } | ||
136 | |||
137 | if (t->hdr.tag == ATAG_MEM) | ||
138 | { | ||
139 | page_size = PAGE_SIZE; | ||
140 | nr_pages += (t->u.mem.size / PAGE_SIZE); | ||
141 | } | ||
142 | } | ||
143 | } | ||
144 | else | ||
145 | { | ||
146 | nr_pages = params->nr_pages; | ||
147 | page_size = params->page_size; | ||
148 | video_num_rows = params->video_num_rows; | ||
149 | video_num_cols = params->video_num_cols; | ||
150 | video_x = params->video_x; | ||
151 | video_y = params->video_y; | ||
152 | bytes_per_char_h = params->bytes_per_char_h; | ||
153 | bytes_per_char_v = params->bytes_per_char_v; | ||
154 | } | ||
155 | |||
156 | video_size_row = video_num_cols * bytes_per_char_h; | ||
111 | 157 | ||
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) | 158 | if (bytes_per_char_h == 4) |
117 | for (i = 0; i < 256; i++) | 159 | for (i = 0; i < 256; i++) |
118 | con_charconvtable[i] = | 160 | con_charconvtable[i] = |
@@ -146,7 +188,7 @@ static void arch_decomp_setup(void) | |||
146 | white = 7; | 188 | white = 7; |
147 | } | 189 | } |
148 | 190 | ||
149 | if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n"); | 191 | if (nr_pages * page_size < 4096*1024) error("<4M of mem\n"); |
150 | } | 192 | } |
151 | #endif | 193 | #endif |
152 | 194 | ||