mirror of
https://github.com/drasko/codezero.git
synced 2026-01-13 11:23:16 +01:00
fs0 used to receive open() requests and notify pager about them via a syscall ipc. This caused deadlocks because normally request flow is mm0 -> fs0 on all other calls. The solution was to have mm0 ask and validate file descriptors from fs0 on the first request instance that involved that file descriptor. By this method we delay the validation of the fd until its first use, and avoid deadlock. It also fits well with the lazy request handling design philosophy.
32 lines
1.0 KiB
C
32 lines
1.0 KiB
C
/*
|
|
* System call function signatures.
|
|
*
|
|
* Copyright (C) 2007, 2008 Bahadir Balban
|
|
*/
|
|
#ifndef __FS0_SYSCALLS_H__
|
|
#define __FS0_SYSCALLS_H__
|
|
|
|
/* Posix calls */
|
|
int sys_open(l4id_t sender, char *pathname, int flags, u32 mode);
|
|
int sys_readdir(l4id_t sender, int fd, void *buf, int count);
|
|
int sys_mkdir(l4id_t sender, const char *pathname, unsigned int mode);
|
|
int sys_chdir(l4id_t sender, const char *pathname);
|
|
|
|
/* Calls from pager that completes a posix call */
|
|
|
|
int pager_sys_open(l4id_t sender, l4id_t opener, int fd);
|
|
int pager_sys_read(l4id_t sender, unsigned long vnum, unsigned long f_offset,
|
|
unsigned long npages, void *pagebuf);
|
|
|
|
int pager_sys_write(l4id_t sender, unsigned long vnum, unsigned long f_offset,
|
|
unsigned long npages, void *pagebuf);
|
|
|
|
int pager_sys_close(l4id_t sender, l4id_t closer, int fd);
|
|
int pager_update_stats(l4id_t sender, unsigned long vnum,
|
|
unsigned long newsize);
|
|
|
|
int pager_notify_fork(l4id_t sender, l4id_t parid,
|
|
l4id_t chid, unsigned long utcb_address);
|
|
|
|
#endif /* __FS0_SYSCALLS_H__ */
|