]>
Commit | Line | Data |
---|---|---|
76e95654 S |
1 | //------------------------------------------------------------------------------\r |
2 | //\r | |
3 | // Make ECALL to SBI\r | |
4 | //\r | |
5 | // Copyright (c) 2023, Ventana Micro Systems Inc. All rights reserved.<BR>\r | |
6 | //\r | |
7 | // SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
8 | //\r | |
9 | //------------------------------------------------------------------------------\r | |
10 | \r | |
11 | #include <Register/RiscV64/RiscVImpl.h>\r | |
12 | \r | |
13 | .data\r | |
14 | .align 3\r | |
15 | .section .text\r | |
16 | \r | |
17 | //\r | |
18 | // Make ECALL to SBI\r | |
19 | // ecall updates the same a0 and a1 registers with\r | |
20 | // return values. Hence, the C function which calls\r | |
21 | // this should pass the address of Arg0 and Arg1.\r | |
22 | // This routine saves the address and updates it\r | |
23 | // with a0 and a1 once ecall returns.\r | |
24 | //\r | |
25 | // @param a0 : Pointer to Arg0\r | |
26 | // @param a1 : Pointer to Arg1\r | |
27 | // @param a2 : Arg2\r | |
28 | // @param a3 : Arg3\r | |
29 | // @param a4 : Arg4\r | |
30 | // @param a5 : Arg5\r | |
31 | // @param a6 : FunctionID\r | |
32 | // @param a7 : ExtensionId\r | |
33 | //\r | |
34 | ASM_FUNC (RiscVSbiEcall)\r | |
35 | mv t0, a0\r | |
36 | mv t1, a1\r | |
37 | ld a0, 0(a0)\r | |
38 | ld a1, 0(a1)\r | |
39 | ecall\r | |
40 | sd a0, 0(t0)\r | |
41 | sd a1, 0(t1)\r | |
42 | ret\r |