-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernel: add linux compatibility layer
It does not quite work yet, although binaries built for ArvernOS run on Linux... "Just" need to make the opposite to happen now.
- Loading branch information
1 parent
c52329b
commit 158c1e6
Showing
6 changed files
with
85 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// https://chromium.googlesource.com/chromiumos/docs/+/HEAD/constants/syscalls.md | ||
#ifndef SYS_LINUX_COMPAT_H | ||
#define SYS_LINUX_COMPAT_H | ||
|
||
#ifdef __x86_64__ | ||
|
||
#define SYSCALL_READ 0 | ||
#define SYSCALL_WRITE 1 | ||
#define SYSCALL_OPEN 2 | ||
#define SYSCALL_CLOSE 3 | ||
#define SYSCALL_FSTAT 5 | ||
#define SYSCALL_LSEEK 8 | ||
#define SYSCALL_GETPID 20 | ||
#define SYSCALL_SOCKET 41 | ||
#define SYSCALL_SENDTO 44 | ||
#define SYSCALL_RECVFROM 45 | ||
#define SYSCALL_EXECV 49 | ||
#define SYSCALL_EXIT 60 | ||
#define SYSCALL_GETTIMEOFDAY 96 | ||
#define SYSCALL_REBOOT 169 | ||
|
||
#elif __arm__ | ||
|
||
#define SYSCALL_EXIT 1 | ||
#define SYSCALL_READ 3 | ||
#define SYSCALL_WRITE 4 | ||
#define SYSCALL_OPEN 5 | ||
#define SYSCALL_CLOSE 6 | ||
#define SYSCALL_EXECV 11 | ||
#define SYSCALL_LSEEK 19 | ||
#define SYSCALL_GETPID 20 | ||
#define SYSCALL_GETTIMEOFDAY 78 | ||
#define SYSCALL_REBOOT 88 | ||
#define SYSCALL_FSTAT 108 | ||
#define SYSCALL_SOCKET 281 | ||
#define SYSCALL_SENDTO 290 | ||
#define SYSCALL_RECVFROM 292 | ||
|
||
#elif __aarch64__ | ||
|
||
#define SYSCALL_CLOSE 57 | ||
#define SYSCALL_LSEEK 62 | ||
#define SYSCALL_READ 63 | ||
#define SYSCALL_WRITE 64 | ||
#define SYSCALL_FSTAT 80 | ||
#define SYSCALL_EXIT 93 | ||
#define SYSCALL_REBOOT 142 | ||
#define SYSCALL_GETTIMEOFDAY 169 | ||
#define SYSCALL_GETPID 172 | ||
#define SYSCALL_SOCKET 198 | ||
#define SYSCALL_SENDTO 206 | ||
#define SYSCALL_RECVFROM 207 | ||
#define SYSCALL_EXECV 221 | ||
// Not available on AArch64 | ||
#define SYSCALL_OPEN 299 | ||
|
||
#endif | ||
|
||
// Not available | ||
#define SYSCALL_TEST 298 | ||
// Not available | ||
#define SYSCALL_GETHOSTBYNAME2 299 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters