xref: /openbmc/qemu/tests/tcg/nios2/intr.S (revision ccbaa553)
1/*
2 * Minimal Nios2 system boot code -- exit on interrupt.
3 *
4 * Copyright Linaro Ltd 2022
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#include "semicall.h"
9
10        .section .text.intr, "ax"
11	.global	_interrupt
12	.type	_interrupt, @function
13
14_interrupt:
15	rdctl	r5, exception		/* extract exception.CAUSE */
16	srli	r5, r5, 2
17	movi	r4, HOSTED_EXIT
18	semihosting_call
19
20	.size	_interrupt, . - _interrupt
21
22        .text
23	.global	_fast_tlb_miss
24	.type	_fast_tlb_miss, @function
25
26_fast_tlb_miss:
27	movi	r5, 32
28	movi	r4, HOSTED_EXIT
29	semihosting_call
30
31	.size	_fast_tlb_miss, . - _fast_tlb_miss
32