blob: 49bb419a962c68817deb184f0a67381edb5a777c [file] [log] [blame]
Andre Przywarac34de682023-02-07 15:21:05 +00001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright (C) 2022 Ventana Micro Systems Inc.
4 */
5
6#include <asm/asm.h>
7#include <linux/linkage.h>
8
9.pushsection .text.smh_trap, "ax"
10ENTRY(smh_trap)
Heinrich Schuchardt1f3ebfd2024-06-19 17:22:52 +020011 .align 4 /* keep slli, ebreak, srai in same page */
Andre Przywarac34de682023-02-07 15:21:05 +000012 .option push
13 .option norvc /* semihosting sequence must be 32-bit wide */
14
15 slli zero, zero, 0x1f /* Entry NOP to identify semihosting */
16 ebreak
17 srai zero, zero, 7 /* NOP encoding of semihosting call number */
18 .option pop
19
20 ret
21ENDPROC(smh_trap)
22.popsection