summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorstefan <stefan@s00.xyz>2023-04-19 21:02:58 -0400
committerstefan <stefan@s00.xyz>2023-04-19 21:02:58 -0400
commit821706a3fea34c18a6171cf5169d5d6d852966de (patch)
treeeee908df401a7bab1ecf1cb60cab31a15c0e3c8b /sys/include
parent83e17e29456ec9b6d45f4d9f2634eb280c6f414f (diff)
downloadsv-821706a3fea34c18a6171cf5169d5d6d852966de.tar.gz
normalized tab expansion
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/cpu.h10
-rw-r--r--sys/include/sbi.h42
2 files changed, 21 insertions, 31 deletions
diff --git a/sys/include/cpu.h b/sys/include/cpu.h
deleted file mode 100644
index 9567496..0000000
--- a/sys/include/cpu.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef _CPU_H
-#define _CPU_H
-
-struct hart {
- int intr_stack;
-};
-
-struct hart harts[NPROC] = {0};
-
-#endif /* _CPU_H */
diff --git a/sys/include/sbi.h b/sys/include/sbi.h
index 1c0fc7f..94c3749 100644
--- a/sys/include/sbi.h
+++ b/sys/include/sbi.h
@@ -2,8 +2,8 @@
#define _SBI_H
struct sbiret {
- long err;
- long val;
+ long err;
+ long val;
};
#define SBI_SUCCESS 0
@@ -28,28 +28,28 @@ enum HART_STATUS {
static inline struct sbiret
sbi_ecall(int ext, int fid, unsigned long arg0,
- unsigned long arg1, unsigned long arg2,
- unsigned long arg3, unsigned long arg4,
- unsigned long arg5)
+ unsigned long arg1, unsigned long arg2,
+ unsigned long arg3, unsigned long arg4,
+ unsigned long arg5)
{
- struct sbiret ret;
+ struct sbiret ret;
- register unsigned long a0 asm ("a0") = (unsigned long)(arg0);
- register unsigned long a1 asm ("a1") = (unsigned long)(arg1);
- register unsigned long a2 asm ("a2") = (unsigned long)(arg2);
- register unsigned long a3 asm ("a3") = (unsigned long)(arg3);
- register unsigned long a4 asm ("a4") = (unsigned long)(arg4);
- register unsigned long a5 asm ("a5") = (unsigned long)(arg5);
- register unsigned long a6 asm ("a6") = (unsigned long)(fid);
- register unsigned long a7 asm ("a7") = (unsigned long)(ext);
- asm volatile ("ecall"
- : "+r" (a0), "+r" (a1)
- : "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7)
- : "memory");
- ret.err = a0;
- ret.val = a1;
+ register unsigned long a0 asm ("a0") = (unsigned long)(arg0);
+ register unsigned long a1 asm ("a1") = (unsigned long)(arg1);
+ register unsigned long a2 asm ("a2") = (unsigned long)(arg2);
+ register unsigned long a3 asm ("a3") = (unsigned long)(arg3);
+ register unsigned long a4 asm ("a4") = (unsigned long)(arg4);
+ register unsigned long a5 asm ("a5") = (unsigned long)(arg5);
+ register unsigned long a6 asm ("a6") = (unsigned long)(fid);
+ register unsigned long a7 asm ("a7") = (unsigned long)(ext);
+ asm volatile ("ecall"
+ : "+r" (a0), "+r" (a1)
+ : "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), "r" (a7)
+ : "memory");
+ ret.err = a0;
+ ret.val = a1;
- return ret;
+ return ret;
}
static inline void