diff options
author | Olof Johansson <olof@lixom.net> | 2019-04-11 03:41:52 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2019-04-24 07:19:46 +0300 |
commit | 10baa64c02f6746fd506136e0693aa2d592574fb (patch) | |
tree | da00e48f0cb5d1434cbc7c31bb6ca15efa7d4564 /include/sbi/sbi_ecall_interface.h | |
parent | fbf986ac2a0b926ae97e6796b87e366610d7589e (diff) | |
download | opensbi-10baa64c02f6746fd506136e0693aa2d592574fb.tar.xz |
all: run clang-format and update checked-in files
Noisy commit, no functional changes.
Generated with an current upstream clang-format and:
clang-format -i $(find . -name \*.[ch])
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'include/sbi/sbi_ecall_interface.h')
-rw-r--r-- | include/sbi/sbi_ecall_interface.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/include/sbi/sbi_ecall_interface.h b/include/sbi/sbi_ecall_interface.h index 8e79e24..6c12272 100644 --- a/include/sbi/sbi_ecall_interface.h +++ b/include/sbi/sbi_ecall_interface.h @@ -24,24 +24,24 @@ /* clang-format on */ -#define SBI_ECALL(__num, __a0, __a1, __a2) ({ \ - register unsigned long a0 asm ("a0") = (unsigned long)(__a0); \ - register unsigned long a1 asm ("a1") = (unsigned long)(__a1); \ - register unsigned long a2 asm ("a2") = (unsigned long)(__a2); \ - register unsigned long a7 asm ("a7") = (unsigned long)(__num); \ - asm volatile ("ecall" \ - : "+r" (a0) \ - : "r" (a1), "r" (a2), "r" (a7) \ - : "memory"); \ - a0; \ -}) - -#define SBI_ECALL_0(__num) SBI_ECALL(__num, 0, 0, 0) -#define SBI_ECALL_1(__num, __a0) SBI_ECALL(__num, __a0, 0, 0) -#define SBI_ECALL_2(__num, __a0, __a1) SBI_ECALL(__num, __a0, __a1, 0) - -#define sbi_ecall_console_putc(c) \ - SBI_ECALL_1(SBI_ECALL_CONSOLE_PUTCHAR, (c)); +#define SBI_ECALL(__num, __a0, __a1, __a2) \ + ({ \ + register unsigned long a0 asm("a0") = (unsigned long)(__a0); \ + register unsigned long a1 asm("a1") = (unsigned long)(__a1); \ + register unsigned long a2 asm("a2") = (unsigned long)(__a2); \ + register unsigned long a7 asm("a7") = (unsigned long)(__num); \ + asm volatile("ecall" \ + : "+r"(a0) \ + : "r"(a1), "r"(a2), "r"(a7) \ + : "memory"); \ + a0; \ + }) + +#define SBI_ECALL_0(__num) SBI_ECALL(__num, 0, 0, 0) +#define SBI_ECALL_1(__num, __a0) SBI_ECALL(__num, __a0, 0, 0) +#define SBI_ECALL_2(__num, __a0, __a1) SBI_ECALL(__num, __a0, __a1, 0) + +#define sbi_ecall_console_putc(c) SBI_ECALL_1(SBI_ECALL_CONSOLE_PUTCHAR, (c)); static inline void sbi_ecall_console_puts(const char *str) { |