xref: /openbmc/qemu/tests/tcg/s390x/head64.S (revision 7d87775f)
1/*
2 * Startup code for multiarch tests.
3 * Reuses the pc-bios/s390-ccw implementation.
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7#define main main_pre
8#include "../../../pc-bios/s390-ccw/start.S"
9#undef main
10
11.text
12
13main_pre:
14    aghi %r15,-160                     /* reserve stack for C code */
15    brasl %r14,sclp_setup
16    brasl %r14,main
17    larl %r1,success_psw               /* check main() return code */
18    ltgr %r2,%r2
19    je 0f
20    larl %r1,failure_psw
210:
22    lpswe 0(%r1)
23
24    .align 8
25success_psw:
26    .quad 0x2000180000000,0xfff        /* see is_special_wait_psw() */
27failure_psw:
28    .quad 0x2000180000000,0            /* disabled wait */
29