Loading [MathJax]/jax/output/HTML-CSS/config.js
CS350 COS
COS
All Data Structures Files Functions Variables Typedefs Macros
syscall.h
Go to the documentation of this file.
1
2#ifndef __SYS_SYSCALL_H__
3#define __SYS_SYSCALL_H__
4
5#define SYSCALL_NULL 0x00
6#define SYSCALL_TIME 0x01
7#define SYSCALL_GETPID 0x02
8#define SYSCALL_EXIT 0x03
9#define SYSCALL_SPAWN 0x04
10#define SYSCALL_WAIT 0x05
11
12// Memory
13#define SYSCALL_MMAP 0x08
14#define SYSCALL_MUNMAP 0x09
15#define SYSCALL_MPROTECT 0x0A
16
17// Stream
18#define SYSCALL_READ 0x10
19#define SYSCALL_WRITE 0x11
20#define SYSCALL_FLUSH 0x12
21
22// File
23#define SYSCALL_OPEN 0x18
24#define SYSCALL_CLOSE 0x19
25#define SYSCALL_MOVE 0x1A
26#define SYSCALL_DELETE 0x1B
27#define SYSCALL_SETLENGTH 0x1C
28#define SYSCALL_STAT 0x1D
29#define SYSCALL_READDIR 0x1E
30
31// IPC
32#define SYSCALL_PIPE 0x20
33
34// Threading
35#define SYSCALL_THREADCREATE 0x30
36#define SYSCALL_GETTID 0x31
37#define SYSCALL_THREADEXIT 0x32
38#define SYSCALL_THREADSLEEP 0x33
39#define SYSCALL_THREADWAIT 0x34
40
41// Network
42#define SYSCALL_NICSTAT 0x40
43#define SYSCALL_NICSEND 0x41
44#define SYSCALL_NICRECV 0x42
45
46// System
47#define SYSCALL_SYSCTL 0x80
48#define SYSCALL_FSMOUNT 0x81
49#define SYSCALL_FSUNMOUNT 0x82
50#define SYSCALL_FSINFO 0x83
51
53 uint64_t a3, uint64_t a4, uint64_t a5);
54
55#define SYSCALL_PACK(_errcode, _val) (((uint64_t)_errcode << 32) | (_val))
56#define SYSCALL_ERRCODE(_result) (_result >> 32)
57#define SYSCALL_VALUE(_result) (_result & 0xFFFFFFFF)
58
59#endif /* __SYS_SYSCALL_H__ */
60
uint64_t Syscall_Entry(uint64_t syscall, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5)
Definition: syscall.c:673
unsigned long uint64_t
Definition: types.h:13
int syscall(int number,...)