2 * linux/arch/arm26/lib/ll_char_wr.S
4 * Copyright (C) 1995, 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.
10 * Speedups & 1bpp code (C) 1996 Philip Blundell & Russell King.
12 * 10-04-96 RMK Various cleanups & reduced register usage.
13 * 08-04-98 RMK Shifts re-ordered
16 @ Regs: [] = corruptible
20 #include <linux/linkage.h>
21 #include <asm/assembler.h>
26 #define UNDERLINE 0x04
30 LC0: .word bytes_per_char_h
33 .word con_charconvtable
36 stmfd sp!, {r4 - r7, lr}
38 @ Smashable regs: {r0 - r3}, [r4 - r7], (r8 - fp), [ip], (sp), [lr], (pc)
40 eor ip, r1, #UNDERLINE << 9
52 * calculate offset into character table
57 * calculate offset required for each row [maybe I should make this an argument to this fn.
58 * Have to see what the register usage is like in the calling routines.
61 ldmia r4, {r4, r5, r6, lr}
65 * Go to resolution-dependent routine...
69 eor r2, r3, r2 @ Create eor mask to change colour from bg
70 orr r3, r3, r3, lsl #8 @ to fg.
71 orr r3, r3, r3, lsl #16
72 add r0, r0, r5, lsl #3 @ Move to bottom of character
75 tst ip, #UNDERLINE << 9
80 @ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
82 orr r3, r3, r3, lsl #4
83 Lrow4bpplp: ldr r7, [lr, r7, lsl #2]
85 tst r1, #7 @ avoid using r7 directly after
88 LOADREGS(eqfd, sp!, {r4 - r7, pc})
91 ldr r7, [lr, r7, lsl #2]
93 tst r1, #7 @ avoid using r7 directly after
99 LOADREGS(fd, sp!, {r4 - r7, pc})
102 @ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
104 Lrow8bpplp: mov ip, r7, lsr #4
105 ldr ip, [lr, ip, lsl #2]
107 and ip, r7, #15 @ avoid r4
108 ldr ip, [lr, ip, lsl #2] @ avoid r4
109 mul ip, r2, ip @ avoid r4
110 eor r4, r3, r4 @ avoid ip
111 tst r1, #7 @ avoid ip
112 sub r0, r0, r5 @ avoid ip
115 LOADREGS(eqfd, sp!, {r4 - r7, pc})
119 ldr ip, [lr, ip, lsl #2]
121 and ip, r7, #15 @ avoid r4
122 ldr ip, [lr, ip, lsl #2] @ avoid r4
123 mul ip, r2, ip @ avoid r4
124 eor r4, r3, r4 @ avoid ip
125 tst r1, #7 @ avoid ip
126 sub r0, r0, r5 @ avoid ip
132 LOADREGS(fd, sp!, {r4 - r7, pc})
135 @ Smashable regs: {r0 - r3}, [r4], {r5, r6}, [r7], (r8 - fp), [ip], (sp), [lr], (pc)
137 Lrow1bpp: add r6, r6, r1
139 tst ip, #INVERSE << 9
155 tst ip, #UNDERLINE << 9
158 LOADREGS(fd, sp!, {r4 - r7, pc})
161 ENTRY(con_charconvtable)