aboutsummaryrefslogtreecommitdiff
path: root/include/apos/syscalls.h
blob: 7e2845b37f378af68b3769ed743ef3bb6751005b (plain) (blame)
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
#ifndef APOS_SYSCALLS_H
#define APOS_SYSCALLS_H

/**
 * @file syscalls.h
 * Table of system calls.
 */

/* enum for now, possibly macros in the future once I get an approximate idea of
 * which syscalls are necessary etc. */
enum {
	/* noop, for testing out how many syscalls per second can done I suppose
	 * */
	SYS_NOOP,

	/* memory management */
	SYS_REQ_MEM,    /* request memory from anywhere */
	SYS_REQ_PMEM,   /* request physical address */
	SYS_REQ_FIXMEM, /* request memory at fixed address */
	SYS_FREE_MEM,   /* free memory */

	/* timers */
	SYS_TIMEBASE,
	SYS_REQ_REL_TIMER,
	SYS_REQ_ABS_TIMER,
	SYS_FREE_TIMER,

	/* IPC */
	/* I really should try to find my notes about the server/client
	 * structure of the OS, but these following syscalls are probably
	 * required */
	SYS_IPC_SERVER,     /* inform kernel that process should be treated as a server */
	SYS_IPC_REQ,   /* IPC request to server */
	SYS_IPC_FWD, /* IPC request forwarding */
	SYS_IPC_RESP,       /* IPC response from server */

	/* process management */
	SYS_CREATE, /* create new thread */
	SYS_FORK,   /* duplicate process */
	SYS_EXEC,   /* execute new binary in process space */
	SYS_KILL,   /* kill thread */
	SYS_SIGNAL, /* send signal to process (kill etc.) */
	SYS_SWAP, /* switch running process */

	/* kernel management */
	SYS_CONF,     /* config system parameters (stack size etc.) */
	SYS_POWEROFF, /* shutdown/reboot etc. */
};

/* function declarations should be somewhere else, this file could be used in
 * userspace applications as well */

#endif /* APOS_SYSCALLS_H */