Path: blob/master/arch/arm/boot/compressed/ll_char_wr.S
29269 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* linux/arch/arm/lib/ll_char_wr.S3*4* Copyright (C) 1995, 1996 Russell King.5*6* Speedups & 1bpp code (C) 1996 Philip Blundell & Russell King.7*8* 10-04-96 RMK Various cleanups & reduced register usage.9* 08-04-98 RMK Shifts re-ordered10*/1112@ Regs: [] = corruptible13@ {} = used14@ () = do not use1516#include <linux/linkage.h>17#include <asm/assembler.h>18.text1920LC0: .word LC021.word bytes_per_char_h22.word video_size_row23.word acorndata_8x824.word con_charconvtable2526/*27* r0 = ptr28* r1 = char29* r2 = white30*/31ENTRY(ll_write_char)32stmfd sp!, {r4 - r7, lr}33@34@ Smashable regs: {r0 - r3}, [r4 - r7], (r8 - fp), [ip], (sp), [lr], (pc)35@36/*37* calculate offset into character table38*/39mov r1, r1, lsl #340/*41* calculate offset required for each row.42*/43adr ip, LC044ldmia ip, {r3, r4, r5, r6, lr}45sub ip, ip, r346add r6, r6, ip47add lr, lr, ip48ldr r4, [r4, ip]49ldr r5, [r5, ip]50/*51* Go to resolution-dependent routine...52*/53cmp r4, #454blt Lrow1bpp55add r0, r0, r5, lsl #3 @ Move to bottom of character56orr r1, r1, #757ldrb r7, [r6, r1]58teq r4, #859beq Lrow8bpplp60@61@ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)62@63Lrow4bpplp:64ldr r7, [lr, r7, lsl #2]65mul r7, r2, r766sub r1, r1, #1 @ avoid using r7 directly after67str r7, [r0, -r5]!68ldrb r7, [r6, r1]69ldr r7, [lr, r7, lsl #2]70mul r7, r2, r771tst r1, #7 @ avoid using r7 directly after72str r7, [r0, -r5]!73subne r1, r1, #174ldrbne r7, [r6, r1]75bne Lrow4bpplp76ldmfd sp!, {r4 - r7, pc}7778@79@ Smashable regs: {r0 - r3}, [r4], {r5 - r7}, (r8 - fp), [ip], (sp), {lr}, (pc)80@81Lrow8bpplp:82mov ip, r7, lsr #483ldr ip, [lr, ip, lsl #2]84mul r4, r2, ip85and ip, r7, #15 @ avoid r486ldr ip, [lr, ip, lsl #2] @ avoid r487mul ip, r2, ip @ avoid r488sub r1, r1, #1 @ avoid ip89sub r0, r0, r5 @ avoid ip90stmia r0, {r4, ip}91ldrb r7, [r6, r1]92mov ip, r7, lsr #493ldr ip, [lr, ip, lsl #2]94mul r4, r2, ip95and ip, r7, #15 @ avoid r496ldr ip, [lr, ip, lsl #2] @ avoid r497mul ip, r2, ip @ avoid r498tst r1, #7 @ avoid ip99sub r0, r0, r5 @ avoid ip100stmia r0, {r4, ip}101subne r1, r1, #1102ldrbne r7, [r6, r1]103bne Lrow8bpplp104ldmfd sp!, {r4 - r7, pc}105106@107@ Smashable regs: {r0 - r3}, [r4], {r5, r6}, [r7], (r8 - fp), [ip], (sp), [lr], (pc)108@109Lrow1bpp:110add r6, r6, r1111ldmia r6, {r4, r7}112strb r4, [r0], r5113mov r4, r4, lsr #8114strb r4, [r0], r5115mov r4, r4, lsr #8116strb r4, [r0], r5117mov r4, r4, lsr #8118strb r4, [r0], r5119strb r7, [r0], r5120mov r7, r7, lsr #8121strb r7, [r0], r5122mov r7, r7, lsr #8123strb r7, [r0], r5124mov r7, r7, lsr #8125strb r7, [r0], r5126ldmfd sp!, {r4 - r7, pc}127128.bss129ENTRY(con_charconvtable)130.space 1024131132133