2014-08-08 00:58:41 +00:00
|
|
|
|
|
|
|
#ifndef __SYSCALL_H__
|
|
|
|
#define __SYSCALL_H__
|
|
|
|
|
2014-12-05 08:25:20 +00:00
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2014-08-08 00:58:41 +00:00
|
|
|
uint64_t SystemTime();
|
|
|
|
void SystemExit(int status);
|
|
|
|
uint64_t SystemGetPID();
|
2014-11-26 06:24:54 +00:00
|
|
|
uint64_t SystemSpawn(const char *path);
|
2014-08-08 00:58:41 +00:00
|
|
|
|
|
|
|
// Memory
|
|
|
|
void *SystemMemMap(void *addr, uint64_t len, int flags);
|
|
|
|
int SystemMemUnmap(void *addr, uint64_t len);
|
|
|
|
int SystemMemProtect(void *addr, uint64_t len, int flags);
|
|
|
|
|
2014-10-14 23:24:47 +00:00
|
|
|
// IO
|
|
|
|
int SystemRead(uint64_t fd, void *addr, uint64_t off, uint64_t length);
|
2014-10-15 01:00:14 +00:00
|
|
|
int SystemWrite(uint64_t fd, const void *addr, uint64_t off, uint64_t length);
|
2014-10-14 23:24:47 +00:00
|
|
|
int SystemFlush(uint64_t fd);
|
|
|
|
uint64_t SystemOpen(const char *path, uint64_t flags);
|
2014-10-15 01:00:14 +00:00
|
|
|
int SystemClose(uint64_t fd);
|
2014-10-14 23:24:47 +00:00
|
|
|
|
2014-12-05 08:25:20 +00:00
|
|
|
// Directory
|
|
|
|
int SystemStat(const char *path, struct stat *sb);
|
|
|
|
int SystemReadDir(uint64_t fd, char *buf, size_t length, uint64_t *offset);
|
|
|
|
|
2014-11-29 23:46:17 +00:00
|
|
|
// Threads
|
|
|
|
int SystemThreadSleep(uint64_t time);
|
|
|
|
|
2014-08-08 00:58:41 +00:00
|
|
|
#endif /* __SYSCALL_H__ */
|
|
|
|
|