mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-25 18:18:19 +01:00
Commit 7400d34ba992 ("riscv: semihosting: replace inline assembly with
assembly file") reduced the alignment of function smh_trap().
As described in the "RISC-V Semihosting" specification [1] the ssli,
ebreak, and srai statements must all reside in the same memory page.
[1] RISC-V Semihosting, Version 0.4, 12th June 2024
https://github.com/riscv-non-isa/riscv-semihosting
Fixes: 7400d34ba992 ("riscv: semihosting: replace inline assembly with assembly file")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
23 lines
514 B
ArmAsm
23 lines
514 B
ArmAsm
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright (C) 2022 Ventana Micro Systems Inc.
|
|
*/
|
|
|
|
#include <asm/asm.h>
|
|
#include <linux/linkage.h>
|
|
|
|
.pushsection .text.smh_trap, "ax"
|
|
ENTRY(smh_trap)
|
|
.align 4 /* keep slli, ebreak, srai in same page */
|
|
.option push
|
|
.option norvc /* semihosting sequence must be 32-bit wide */
|
|
|
|
slli zero, zero, 0x1f /* Entry NOP to identify semihosting */
|
|
ebreak
|
|
srai zero, zero, 7 /* NOP encoding of semihosting call number */
|
|
.option pop
|
|
|
|
ret
|
|
ENDPROC(smh_trap)
|
|
.popsection
|