Kautuk Consul | c86cb4a | 2022-12-07 17:12:35 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2022 Ventana Micro Systems Inc. |
| 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | |
| 8 | long smh_trap(int sysnum, void *addr) |
| 9 | { |
| 10 | register int ret asm ("a0") = sysnum; |
| 11 | register void *param0 asm ("a1") = addr; |
| 12 | |
| 13 | asm volatile (".align 4\n" |
| 14 | ".option push\n" |
| 15 | ".option norvc\n" |
| 16 | |
| 17 | "slli zero, zero, 0x1f\n" |
| 18 | "ebreak\n" |
| 19 | "srai zero, zero, 7\n" |
| 20 | ".option pop\n" |
| 21 | : "+r" (ret) : "r" (param0) : "memory"); |
| 22 | |
| 23 | return ret; |
| 24 | } |