Commit d6494ca3 authored by Russell King's avatar Russell King

[ARM] Update RiscPC decompressor for PIC changes

This cset fixes the RiscPC decompressor code for the PIC changes.

We use a pointer to a structure rather than a structure to access
params.  With a PIC decompressor, the address of the structure gets
PIC-ified which is not what we want.
parent b8f8251c
...@@ -18,7 +18,7 @@ ZLDFLAGS = -p -X -T vmlinux.lds ...@@ -18,7 +18,7 @@ ZLDFLAGS = -p -X -T vmlinux.lds
# #
ifeq ($(CONFIG_ARCH_ACORN),y) ifeq ($(CONFIG_ARCH_ACORN),y)
OBJS += ll_char_wr.o font.o OBJS += ll_char_wr.o font.o
ZLDFLAGS += -defsym params=$(PARAMS_PHYS) CFLAGS += -DPARAMS_PHYS=$(PARAMS_PHYS)
endif endif
ifeq ($(CONFIG_ARCH_NETWINDER),y) ifeq ($(CONFIG_ARCH_NETWINDER),y)
......
...@@ -19,144 +19,116 @@ ...@@ -19,144 +19,116 @@
#include <linux/linkage.h> #include <linux/linkage.h>
#include <asm/assembler.h> #include <asm/assembler.h>
.text .text
#define BOLD 0x01 LC0: .word LC0
#define ITALIC 0x02 .word bytes_per_char_h
#define UNDERLINE 0x04 .word video_size_row
#define FLASH 0x08 .word acorndata_8x8
#define INVERSE 0x10 .word con_charconvtable
LC0: .word bytes_per_char_h
.word video_size_row
.word acorndata_8x8
.word con_charconvtable
/*
* r0 = ptr
* r1 = char
* r2 = white
*/
ENTRY(ll_write_char) ENTRY(ll_write_char)
stmfd sp!, {r4 - r7, lr} stmfd sp!, {r4 - r7, lr}
@ @
@ Smashable regs: {r0 - r3}, [r4 - r7], (r8 - fp), [ip], (sp), [lr], (pc) @ Smashable regs: {r0 - r3}, [r4 - r7], (r8 - fp), [ip], (sp), [lr], (pc)
@ @
eor ip, r1, #UNDERLINE << 9 /*
/* * calculate offset into character table
* calculate colours */
*/ mov r1, r1, lsl #3
tst r1, #INVERSE << 9 /*
moveq r2, r1, lsr #16 * calculate offset required for each row.
moveq r3, r1, lsr #24 */
movne r2, r1, lsr #24 adr ip, LC0
movne r3, r1, lsr #16 ldmia ip, {r3, r4, r5, r6, lr}
and r3, r3, #255 sub ip, ip, r3
and r2, r2, #255 add r6, r6, ip
/* add lr, lr, ip
* calculate offset into character table ldr r4, [r4, ip]
*/ ldr r5, [r5, ip]
mov r1, r1, lsl #23 /*
mov r1, r1, lsr #20 * Go to resolution-dependent routine...
/* */
* calculate offset required for each row [maybe I should make this an argument to this fn. cmp r4, #4
* Have to see what the register usage is like in the calling routines. blt Lrow1bpp
*/ add r0, r0, r5, lsl #3 @ Move to bottom of character
adr r4, LC0 orr r1, r1, #7
ldmia r4, {r4, r5, r6, lr} ldrb r7, [r6, r1]
ldr r4, [r4] teq r4, #8
ldr r5, [r5] beq Lrow8bpplp
/*
* Go to resolution-dependent routine...
*/
cmp r4, #4
blt Lrow1bpp
eor r2, r3, r2 @ Create eor mask to change colour from bg
orr r3, r3, r3, lsl #8 @ to fg.
orr r3, r3, r3, lsl #16
add r0, r0, r5, lsl #3 @ Move to bottom of character
add r1, r1, #7
ldrb r7, [r6, r1]
tst ip, #UNDERLINE << 9
eoreq r7, r7, #255
teq r4, #8
beq Lrow8bpplp
@ @
@ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc) @ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
@ @
orr r3, r3, r3, lsl #4 Lrow4bpplp:
Lrow4bpplp: ldr r7, [lr, r7, lsl #2] ldr r7, [lr, r7, lsl #2]
mul r7, r2, r7 mul r7, r2, r7
tst r1, #7 @ avoid using r7 directly after sub r1, r1, #1 @ avoid using r7 directly after
eor ip, r3, r7 str r7, [r0, -r5]!
str ip, [r0, -r5]! ldrb r7, [r6, r1]
LOADREGS(eqfd, sp!, {r4 - r7, pc}) ldr r7, [lr, r7, lsl #2]
sub r1, r1, #1 mul r7, r2, r7
ldrb r7, [r6, r1] tst r1, #7 @ avoid using r7 directly after
ldr r7, [lr, r7, lsl #2] str r7, [r0, -r5]!
mul r7, r2, r7 subne r1, r1, #1
tst r1, #7 @ avoid using r7 directly after ldrneb r7, [r6, r1]
eor ip, r3, r7 bne Lrow4bpplp
str ip, [r0, -r5]! LOADREGS(fd, sp!, {r4 - r7, pc})
subne r1, r1, #1
ldrneb r7, [r6, r1]
bne Lrow4bpplp
LOADREGS(fd, sp!, {r4 - r7, pc})
@ @
@ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc) @ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
@ @
Lrow8bpplp: mov ip, r7, lsr #4 Lrow8bpplp:
ldr ip, [lr, ip, lsl #2] mov ip, r7, lsr #4
mul r4, r2, ip ldr ip, [lr, ip, lsl #2]
and ip, r7, #15 @ avoid r4 mul r4, r2, ip
ldr ip, [lr, ip, lsl #2] @ avoid r4 and ip, r7, #15 @ avoid r4
mul ip, r2, ip @ avoid r4 ldr ip, [lr, ip, lsl #2] @ avoid r4
eor r4, r3, r4 @ avoid ip mul ip, r2, ip @ avoid r4
tst r1, #7 @ avoid ip sub r1, r1, #1 @ avoid ip
sub r0, r0, r5 @ avoid ip sub r0, r0, r5 @ avoid ip
eor ip, r3, ip stmia r0, {r4, ip}
stmia r0, {r4, ip} ldrb r7, [r6, r1]
LOADREGS(eqfd, sp!, {r4 - r7, pc}) mov ip, r7, lsr #4
sub r1, r1, #1 ldr ip, [lr, ip, lsl #2]
ldrb r7, [r6, r1] mul r4, r2, ip
mov ip, r7, lsr #4 and ip, r7, #15 @ avoid r4
ldr ip, [lr, ip, lsl #2] ldr ip, [lr, ip, lsl #2] @ avoid r4
mul r4, r2, ip mul ip, r2, ip @ avoid r4
and ip, r7, #15 @ avoid r4 tst r1, #7 @ avoid ip
ldr ip, [lr, ip, lsl #2] @ avoid r4 sub r0, r0, r5 @ avoid ip
mul ip, r2, ip @ avoid r4 stmia r0, {r4, ip}
eor r4, r3, r4 @ avoid ip subne r1, r1, #1
tst r1, #7 @ avoid ip ldrneb r7, [r6, r1]
sub r0, r0, r5 @ avoid ip bne Lrow8bpplp
eor ip, r3, ip LOADREGS(fd, sp!, {r4 - r7, pc})
stmia r0, {r4, ip}
subne r1, r1, #1
ldrneb r7, [r6, r1]
bne Lrow8bpplp
LOADREGS(fd, sp!, {r4 - r7, pc})
@ @
@ Smashable regs: {r0 - r3}, [r4], {r5, r6}, [r7], (r8 - fp), [ip], (sp), [lr], (pc) @ Smashable regs: {r0 - r3}, [r4], {r5, r6}, [r7], (r8 - fp), [ip], (sp), [lr], (pc)
@ @
Lrow1bpp: add r6, r6, r1 Lrow1bpp:
ldmia r6, {r4, r7} add r6, r6, r1
tst ip, #INVERSE << 9 ldmia r6, {r4, r7}
mvnne r4, r4 strb r4, [r0], r5
mvnne r7, r7 mov r4, r4, lsr #8
strb r4, [r0], r5 strb r4, [r0], r5
mov r4, r4, lsr #8 mov r4, r4, lsr #8
strb r4, [r0], r5 strb r4, [r0], r5
mov r4, r4, lsr #8 mov r4, r4, lsr #8
strb r4, [r0], r5 strb r4, [r0], r5
mov r4, r4, lsr #8 strb r7, [r0], r5
strb r4, [r0], r5 mov r7, r7, lsr #8
strb r7, [r0], r5 strb r7, [r0], r5
mov r7, r7, lsr #8 mov r7, r7, lsr #8
strb r7, [r0], r5 strb r7, [r0], r5
mov r7, r7, lsr #8 mov r7, r7, lsr #8
strb r7, [r0], r5 strb r7, [r0], r5
mov r7, r7, lsr #8 LOADREGS(fd, sp!, {r4 - r7, pc})
tst ip, #UNDERLINE << 9
mvneq r7, r7
strb r7, [r0], r5
LOADREGS(fd, sp!, {r4 - r7, pc})
.bss .bss
ENTRY(con_charconvtable) ENTRY(con_charconvtable)
.space 1024 .space 1024
...@@ -56,7 +56,7 @@ static const unsigned long palette_4[16] = { ...@@ -56,7 +56,7 @@ static const unsigned long palette_4[16] = {
#define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255) #define palette_setpixel(p) *(unsigned long *)(IO_START+0x00400000) = 0x10000000|((p) & 255)
#define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff) #define palette_write(v) *(unsigned long *)(IO_START+0x00400000) = 0x00000000|((v) & 0x00ffffff)
extern struct param_struct params; static struct param_struct *params = (struct param_struct *)PARAMS_PHYS;
#ifndef STANDALONE_DEBUG #ifndef STANDALONE_DEBUG
/* /*
...@@ -64,13 +64,13 @@ extern struct param_struct params; ...@@ -64,13 +64,13 @@ extern struct param_struct params;
*/ */
static void puts(const char *s) static void puts(const char *s)
{ {
extern void ll_write_char(char *, unsigned long); extern void ll_write_char(char *, char c, char white);
int x,y; int x,y;
unsigned char c; unsigned char c;
char *ptr; char *ptr;
x = params.video_x; x = params->video_x;
y = params.video_y; y = params->video_y;
while ( ( c = *(unsigned char *)s++ ) != '\0' ) { while ( ( c = *(unsigned char *)s++ ) != '\0' ) {
if ( c == '\n' ) { if ( c == '\n' ) {
...@@ -79,8 +79,8 @@ static void puts(const char *s) ...@@ -79,8 +79,8 @@ static void puts(const char *s)
y--; y--;
} }
} else { } else {
ptr = VIDMEM + ((y*video_num_columns*params.bytes_per_char_v+x)*bytes_per_char_h); ptr = VIDMEM + ((y*video_num_columns*params->bytes_per_char_v+x)*bytes_per_char_h);
ll_write_char(ptr, c|(white<<16)); ll_write_char(ptr, c, white);
if ( ++x >= video_num_columns ) { if ( ++x >= video_num_columns ) {
x = 0; x = 0;
if ( ++y >= video_num_lines ) { if ( ++y >= video_num_lines ) {
...@@ -90,8 +90,8 @@ static void puts(const char *s) ...@@ -90,8 +90,8 @@ static void puts(const char *s)
} }
} }
params.video_x = x; params->video_x = x;
params.video_y = y; params->video_y = y;
} }
static void error(char *x); static void error(char *x);
...@@ -103,9 +103,9 @@ static void arch_decomp_setup(void) ...@@ -103,9 +103,9 @@ static void arch_decomp_setup(void)
{ {
int i; int i;
video_num_lines = params.video_num_rows; video_num_lines = params->video_num_rows;
video_num_columns = params.video_num_cols; video_num_columns = params->video_num_cols;
bytes_per_char_h = params.bytes_per_char_h; bytes_per_char_h = params->bytes_per_char_h;
video_size_row = video_num_columns * bytes_per_char_h; video_size_row = video_num_columns * bytes_per_char_h;
if (bytes_per_char_h == 4) if (bytes_per_char_h == 4)
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
...@@ -140,7 +140,7 @@ static void arch_decomp_setup(void) ...@@ -140,7 +140,7 @@ static void arch_decomp_setup(void)
white = 7; white = 7;
} }
if (params.nr_pages * params.page_size < 4096*1024) error("<4M of mem\n"); if (params->nr_pages * params->page_size < 4096*1024) error("<4M of mem\n");
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment