1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(DATA61_BSD)
11 */
12
13/* See trampoline.h for an explanation of this functionality. */
14
15    .global debug_trampoline
16    .text
17
18#ifdef CONFIG_ARCH_AARCH32
19debug_trampoline:
20    /* Give ourselves a stack. */
21    ldr sp, =debug_stack_top
22
23    /* Shuffle the (up to) three arguments. */
24    mov r4, r0
25    mov r0, r1
26    mov r1, r2
27    mov r2, r3
28
29    /* bl so, if the caller had set the lr, the callee can return through to
30     * it.
31     */
32    blx r4
33    bx lr
34
35    .bss
36    .align  8
37    .space  4096
38debug_stack_top:
39#endif /* CONFIG_ARCH_AARCH64 */
40