xref: /openbmc/qemu/tests/tcg/hexagon/first.S (revision b8116f4c)
1/*
2 *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights Reserved.
3 *
4 *  This program is free software; you can redistribute it and/or modify
5 *  it under the terms of the GNU General Public License as published by
6 *  the Free Software Foundation; either version 2 of the License, or
7 *  (at your option) any later version.
8 *
9 *  This program is distributed in the hope that it will be useful,
10 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 *  GNU General Public License for more details.
13 *
14 *  You should have received a copy of the GNU General Public License
15 *  along with this program; if not, see <http://www.gnu.org/licenses/>.
16 */
17
18#define SYS_write		 64
19#define SYS_exit_group           94
20#define SYS_exit                 93
21
22#define FD_STDOUT                1
23
24	.type	str,@object
25	.section	.rodata
26str:
27	.string	"Hello!\n"
28	.size	str, 8
29
30.text
31.global _start
32_start:
33	r6 = #SYS_write
34	r0 = #FD_STDOUT
35	r1 = ##str
36	r2 = #7
37	trap0(#1)
38
39	r0 = #0
40	r6 = #SYS_exit_group
41	trap0(#1)
42
43.section ".note.ABI-tag", "a"
44.align 4
45.long 1f - 0f          /* name length */
46.long 3f - 2f          /* data length */
47.long  1               /* note type */
48
49/*
50 * vendor name seems like this should be MUSL but lldb doesn't agree.
51 */
520:     .asciz "GNU"
531:     .align 4
542:     .long 0 /* linux */
55       .long 3,0,0
563:     .align 4
57