|
| 1 | +/* Copyright 2023 Google LLC |
| 2 | + * SPDX-License-Identifier: Apache-2.0 |
| 3 | + */ |
| 4 | +#ifndef ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_ |
| 5 | +#define ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_ |
| 6 | + |
| 7 | +/* The Xtensa syscall interface is a straightforward extension of the |
| 8 | + * CALL0 function ABI convention, the only difference being placement |
| 9 | + * of the system call ID (the C declarations for Zephyr put it in the |
| 10 | + * last argument, which is variable, where the handler wants to see it |
| 11 | + * in A11 always. Therefore the system calls are expressed as tiny |
| 12 | + * linkable functions in xtensa-call0.S. |
| 13 | + * |
| 14 | + * Alas the declarations for the Zephyr API have these functions |
| 15 | + * tagged inline, so we need to do a little preprocessor work to avoid |
| 16 | + * redeclaration warnings. |
| 17 | + */ |
| 18 | + |
| 19 | +uintptr_t xtensa_syscall6(uintptr_t a1, uintptr_t a2, uintptr_t a3, |
| 20 | + uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t id); |
| 21 | +uintptr_t xtensa_syscall5(uintptr_t a1, uintptr_t a2, uintptr_t a3, |
| 22 | + uintptr_t a4, uintptr_t a5, uintptr_t id); |
| 23 | +uintptr_t xtensa_syscall4(uintptr_t a1, uintptr_t a2, uintptr_t a3, |
| 24 | + uintptr_t a4, uintptr_t id); |
| 25 | +uintptr_t xtensa_syscall3(uintptr_t a1, uintptr_t a2, uintptr_t a3, |
| 26 | + uintptr_t id); |
| 27 | +uintptr_t xtensa_syscall2(uintptr_t a1, uintptr_t a2, uintptr_t id); |
| 28 | +uintptr_t xtensa_syscall1(uintptr_t a1, uintptr_t id); |
| 29 | + |
| 30 | +#define arch_syscall_invoke6 xtensa_syscall6 |
| 31 | +#define arch_syscall_invoke5 xtensa_syscall5 |
| 32 | +#define arch_syscall_invoke4 xtensa_syscall4 |
| 33 | +#define arch_syscall_invoke3 xtensa_syscall3 |
| 34 | +#define arch_syscall_invoke2 xtensa_syscall2 |
| 35 | +#define arch_syscall_invoke1 xtensa_syscall1 |
| 36 | + |
| 37 | +#endif /* ZEPHYR_INCLUDE_ARCH_XTENSA_SYSCALL_H_ */ |
0 commit comments