xref: /aosp_15_r20/system/core/debuggerd/crasher/riscv64/crashglue.S (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1/*
2 * Copyright 2022, The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17.globl crash1
18crash1:
19	.cfi_startproc
20	addi sp, sp, -16
21	.cfi_def_cfa_offset 16
22	sd ra, 8(sp)
23	.cfi_offset ra, -8
24
25	li	x0,0xa5a50000
26	li	x1,0xa5a50001
27	li	x2,0xa5a50002
28	li	x3,0xa5a50003
29	li	x4,0xa5a50004
30	li	x5,0xa5a50005
31	li	x6,0xa5a50006
32	li	x7,0xa5a50007
33	li	x8,0xa5a50008
34	li	x9,0xa5a50009
35	li	x10,0xa5a50010
36	li	x11,0xa5a50011
37	li	x12,0xa5a50012
38	li	x13,0xa5a50013
39	li	x14,0xa5a50014
40	li	x15,0xa5a50015
41	li	x16,0xa5a50016
42	li	x17,0xa5a50017
43	li	x18,0xa5a50018
44	li	x19,0xa5a50019
45	li	x20,0xa5a50020
46	li	x21,0xa5a50021
47	li	x22,0xa5a50022
48	li	x23,0xa5a50023
49	li	x24,0xa5a50024
50	li	x25,0xa5a50025
51	li	x26,0xa5a50026
52	li	x27,0xa5a50027
53	li	x28,0xa5a50028
54	li	x29,0xa5a50029
55	li	x30,0xa5a50030
56	li	x31,0xa5a50031
57
58	li sp, 0
59	ld t2, 0(zero)
60	j .
61	.cfi_endproc
62	.size crash1, .-crash1
63
64
65.globl crash_no_stack
66crash_no_stack:
67	.cfi_startproc
68	mv t1, sp
69	.cfi_def_cfa_register t1
70	li sp, 0
71	ld t2, 0(zero)
72	j .
73	.cfi_endproc
74	.size crash_no_stack, .-crash_no_stack
75