feat: add support for aarch64 timer/interrupts, port MontaukOS userspace
This commit is contained in:
1 parent
8b6379fb7e
commit
8c09ccef66
101 files changed
+1720
-629
No files matched your search
@@ -8,6 +8,8 @@
|
||||
* calls main(), then exits with main()'s return code.
|
||||
*/
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
static inline long _sys1(long nr, long a1) {
|
||||
long ret;
|
||||
__asm__ volatile(
|
||||
@@ -31,6 +33,27 @@ static inline long _sys2(long nr, long a1, long a2) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#elif defined(__aarch64__)
|
||||
|
||||
static inline long _sys1(long nr, long a1) {
|
||||
register long x8 __asm__("x8") = nr;
|
||||
register long x0 __asm__("x0") = a1;
|
||||
__asm__ volatile("svc #0" : "+r"(x0) : "r"(x8) : "memory");
|
||||
return x0;
|
||||
}
|
||||
|
||||
static inline long _sys2(long nr, long a1, long a2) {
|
||||
register long x8 __asm__("x8") = nr;
|
||||
register long x0 __asm__("x0") = a1;
|
||||
register long x1 __asm__("x1") = a2;
|
||||
__asm__ volatile("svc #0" : "+r"(x0) : "r"(x8), "r"(x1) : "memory");
|
||||
return x0;
|
||||
}
|
||||
|
||||
#else
|
||||
#error "unsupported architecture"
|
||||
#endif
|
||||
|
||||
#define SYS_EXIT 0
|
||||
#define SYS_GETARGS 25
|
||||
#define SYS_GETEXECPATH 151
|
||||
|
||||
Reference in new issue
Block a user