/*1* linux/arch/unicore32/kernel/debug.S2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*11* 32-bit debugging code12*/13#include <linux/linkage.h>14#include <asm/assembler.h>1516.text1718/*19* Some debugging routines (useful if you've got MM problems and20* printk isn't working). For DEBUGGING ONLY!!! Do not leave21* references to these in a production kernel!22*/23#include "debug-macro.S"2425/*26* Useful debugging routines27*/28ENTRY(printhex8)29mov r1, #830b printhex31ENDPROC(printhex8)3233ENTRY(printhex4)34mov r1, #435b printhex36ENDPROC(printhex4)3738ENTRY(printhex2)39mov r1, #240printhex: adr r2, hexbuf41add r3, r2, r142mov r1, #043stb r1, [r3]441: and r1, r0, #1545mov r0, r0 >> #446csub.a r1, #1047beg 2f48add r1, r1, #'0' - 'a' + 10492: add r1, r1, #'a' - 1050stb.w r1, [r3+], #-151cxor.a r3, r252bne 1b53mov r0, r254b printascii55ENDPROC(printhex2)5657.ltorg5859ENTRY(printascii)60addruart r361b 2f621: waituart r2, r363senduart r1, r364busyuart r2, r365cxor.a r1, #'\n'66cmoveq r1, #'\r'67beq 1b682: cxor.a r0, #069beq 3f70ldb.w r1, [r0]+, #171cxor.a r1, #072bne 1b733: mov pc, lr74ENDPROC(printascii)7576ENTRY(printch)77addruart r378mov r1, r079mov r0, #080b 1b81ENDPROC(printch)8283hexbuf: .space 1684858687