1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * linux/arch/arm/lib/ll_char_wr.S
5 * Copyright (C) 1995, 1996 Russell King.
7 * Speedups & 1bpp code (C) 1996 Philip Blundell & Russell King.
9 * 10-04-96 RMK Various cleanups & reduced register usage.
10 * 08-04-98 RMK Shifts re-ordered
13 @ Regs: [] = corruptible
17 #include <linux/linkage.h>
18 #include <asm/assembler.h>
22 .word bytes_per_char_h
25 .word con_charconvtable
33 stmfd sp!, {r4 - r7, lr}
35 @ Smashable regs: {r0 - r3}, [r4 - r7], (r8 - fp), [ip], (sp), [lr], (pc)
38 * calculate offset into character table
42 * calculate offset required for each row.
45 ldmia ip, {r3, r4, r5, r6, lr}
52 * Go to resolution-dependent routine...
56 add r0, r0, r5, lsl #3 @ Move to bottom of character
62 @ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
65 ldr r7, [lr, r7, lsl #2]
67 sub r1, r1, #1 @ avoid using r7 directly after
70 ldr r7, [lr, r7, lsl #2]
72 tst r1, #7 @ avoid using r7 directly after
77 ldmfd sp!, {r4 - r7, pc}
80 @ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)
84 ldr ip, [lr, ip, lsl #2]
86 and ip, r7, #15 @ avoid r4
87 ldr ip, [lr, ip, lsl #2] @ avoid r4
88 mul ip, r2, ip @ avoid r4
89 sub r1, r1, #1 @ avoid ip
90 sub r0, r0, r5 @ avoid ip
94 ldr ip, [lr, ip, lsl #2]
96 and ip, r7, #15 @ avoid r4
97 ldr ip, [lr, ip, lsl #2] @ avoid r4
98 mul ip, r2, ip @ avoid r4
100 sub r0, r0, r5 @ avoid ip
105 ldmfd sp!, {r4 - r7, pc}
108 @ Smashable regs: {r0 - r3}, [r4], {r5, r6}, [r7], (r8 - fp), [ip], (sp), [lr], (pc)
127 ldmfd sp!, {r4 - r7, pc}
130 ENTRY(con_charconvtable)