banner stub: preserve lr, pop-return to caller
This commit is contained in:
+5
-3
@@ -1,11 +1,13 @@
|
|||||||
.syntax unified
|
.syntax unified
|
||||||
.cpu cortex-a7
|
.cpu cortex-a7
|
||||||
.thumb
|
.thumb
|
||||||
@ Banner stub for SBL1 logger call at 0x802f690 (blx r3 patched to bl here).
|
@ Banner stub for SBL1 logger call at 0x802f690 (patched to bl here).
|
||||||
@ r0 = string. Print raw bytes via UARTDM until NUL (cap 256), return 0.
|
@ r0 = string. Print raw bytes via UARTDM until NUL (cap 256).
|
||||||
|
@ Preserve lr (set by bl) and return to caller with r0=0.
|
||||||
.text
|
.text
|
||||||
.global banner_stub
|
.global banner_stub
|
||||||
banner_stub:
|
banner_stub:
|
||||||
|
push {r4, lr}
|
||||||
movw r3, #0xf000
|
movw r3, #0xf000
|
||||||
movt r3, #0x78a
|
movt r3, #0x78a
|
||||||
bn_loop:
|
bn_loop:
|
||||||
@@ -15,4 +17,4 @@ bn_loop:
|
|||||||
b bn_loop
|
b bn_loop
|
||||||
bn_done:
|
bn_done:
|
||||||
movs r0, #0
|
movs r0, #0
|
||||||
bx lr
|
pop {r4, pc}
|
||||||
|
|||||||
+5
-9
@@ -440,17 +440,13 @@ static void saimaa_machine_init(MachineState *machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Banner stub at 0x08062150: print r0 string via UARTDM
|
/* Banner stub at 0x08062150: print r0 string via UARTDM
|
||||||
* (b16 redirects 0x802f690 blx here). Built from qemu/banner.S */
|
* (b16 redirects 0x802f690 blx here). Built from qemu/banner.S:
|
||||||
|
* push/pop frame, preserves lr, returns r0=0 to caller. */
|
||||||
{
|
{
|
||||||
static const uint8_t bn[] = {
|
static const uint8_t bn[] = {
|
||||||
0x4f, 0xf2, 0x00, 0x03, /* movw r3,#0xf000 */
|
0x10, 0xb5, 0x4f, 0xf2, 0x00, 0x03, 0xc0, 0xf2,
|
||||||
0xc0, 0xf2, 0x8a, 0x73, /* movt r3,#0x78a */
|
0x8a, 0x73, 0x10, 0xf8, 0x01, 0x1b, 0x09, 0xb1,
|
||||||
0x10, 0xf8, 0x01, 0x1b, /* ldrb r1,[r0],#1 */
|
0x19, 0x67, 0xfa, 0xe7, 0x00, 0x20, 0x10, 0xbd,
|
||||||
0x09, 0xb1, /* cbz r1,done */
|
|
||||||
0x19, 0x67, /* str r1,[r3,#0x70] */
|
|
||||||
0xfa, 0xe7, /* b loop */
|
|
||||||
0x00, 0x20, /* movs r0,#0 */
|
|
||||||
0x70, 0x47, /* bx lr */
|
|
||||||
};
|
};
|
||||||
size_t k;
|
size_t k;
|
||||||
for (k = 0; k < sizeof(bn); k += 4) {
|
for (k = 0; k < sizeof(bn); k += 4) {
|
||||||
|
|||||||
Reference in New Issue
Block a user