1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
#pragma once
#define _SYS_EXIT 0
#define _SYS_FORK 2
#define _SYS_OPEN 3
#define _SYS_MOUNT 4
#define _SYS_DUP 5
#define _SYS_READ 6
#define _SYS_WRITE 7
#define _SYS_GETSIZE 8
#define _SYS_REMOVE 9
#define _SYS_CLOSE 10
#define _SYS_FS_WAIT 11
#define _SYS_FS_RESPOND 12
#define _SYS_MEMFLAG 13
#define _SYS_PIPE 14
#define _SYS_SLEEP 15
#define _SYS_INTR 17
#define _SYS_INTR_SET 18
#define _SYS_GETPID 19
#define _SYS_GETPPID 20
#define _SYS_WAIT2 21
#define _SYS_GETPROCFS 22
#define _SYS_TIME 23
#define _SYS_GETNULL 24
#define _SYS_DUPLEX 25
#define _SYS_INTR_RETURN 26
#define _SYS_GETXATTR 27
#define _SYS_EXECBUF 100
#define _SYS_DEBUG_KLOG 101
#ifndef ASM_FILE
#include <camellia/types.h>
#include <stddef.h>
long _syscall(long, long, long, long, long, long);
/** Kills the current process.
*/
_Noreturn void _sys_exit(long ret);
/** Creates a copy of the current process, and executes it.
* All user memory pages get copied too.
*
* @param flags FORK_NOREAP, FORK_NEWFS
* @param fs_front requires FORK_NEWFS. the front handle to the new fs is put there
*
* @return 0 in the child, the CID in the parent.
*/
long _sys_fork(int flags, hid_t __user *fs_front);
hid_t _sys_open(const char __user *path, long len, int flags);
long _sys_mount(hid_t h, const char __user *path, long len);
hid_t _sys_dup(hid_t from, hid_t to, int flags);
long _sys_read(hid_t h, void __user *buf, size_t len, long offset);
long _sys_write(hid_t h, const void __user *buf, size_t len, long offset, int flags);
long _sys_getsize(hid_t h);
long _sys_remove(hid_t h);
long _sys_close(hid_t h);
hid_t _sys_fs_wait(char __user *buf, long max_len, struct ufs_request __user *res);
long _sys_fs_respond(hid_t hid, const void __user *buf, long ret, int flags);
/** Modifies the virtual address space.
*
* If the MEMFLAG_PRESENT flag is present - mark the memory region as allocated.
* Otherwise, free it.
*
* MEMFLAG_FINDFREE tries to find the first free region of length `len`.
*
* @return address of the first affected page (usually == addr)
*/
void __user *_sys_memflag(void __user *addr, size_t len, int flags);
long _sys_pipe(hid_t __user user_ends[2], int flags);
void _sys_sleep(long ms);
int _sys_intr(const char __user *msg, size_t len);
void _sys_intr_set(void __user *ip);
uint32_t _sys_getpid(void);
uint32_t _sys_getppid(void);
int _sys_wait2(int pid, int flags, struct sys_wait2 __user *out);
hid_t _sys_getprocfs(int flags);
/** Returns the time in nanoseconds since the first _sys_time call in the process */
uint64_t _sys_time(int flags);
hid_t _sys_getnull(int flags);
long _sys_duplex(hid_t from, hid_t to, int flags);
void _sys_intr_return(struct intr_data __user *intr, int flags);
ssize_t _sys_getxattr(hid_t h, const char __user *name, void __user *buf, size_t len, int flags);
/* see shared/execbuf.h */
long _sys_execbuf(void __user *buf, size_t len);
void _sys_debug_klog(const void __user *buf, size_t len);
#endif
|