Moved all find_task(sender) calls into topmost ipc handler.

System calls now need not search for the tcb they are serving for.
This commit is contained in:
Bahadir Balban
2008-09-16 20:11:24 +03:00
parent 2e94a78253
commit a413b19842
13 changed files with 51 additions and 100 deletions

View File

@@ -9,17 +9,15 @@
void vmfile_init(void);
struct vm_file *vmfile_alloc_init(void);
int vfs_receive_sys_open(l4id_t sender, l4id_t opener, int fd,
unsigned long vnum, unsigned long size);
int vfs_read(unsigned long vnum, unsigned long f_offset, unsigned long npages,
void *pagebuf);
int vfs_write(unsigned long vnum, unsigned long f_offset, unsigned long npages,
void *pagebuf);
int sys_read(l4id_t sender, int fd, void *buf, int count);
int sys_write(l4id_t sender, int fd, void *buf, int count);
int sys_lseek(l4id_t sender, int fd, off_t offset, int whence);
int sys_close(l4id_t sender, int fd);
int sys_fsync(l4id_t sender, int fd);
int sys_read(struct tcb *sender, int fd, void *buf, int count);
int sys_write(struct tcb *sender, int fd, void *buf, int count);
int sys_lseek(struct tcb *sender, int fd, off_t offset, int whence);
int sys_close(struct tcb *sender, int fd);
int sys_fsync(struct tcb *sender, int fd);
int file_open(struct tcb *opener, int fd);
struct vfs_file_data {

View File

@@ -11,6 +11,7 @@
#include <sys/types.h>
#include <l4lib/types.h>
#include <task.h>
/* For reading argument data from a system call */
struct sys_mmap_args {
@@ -22,10 +23,10 @@ struct sys_mmap_args {
off_t offset;
};
void *sys_mmap(l4id_t sender, void *start, size_t length, int prot,
void *sys_mmap(struct tcb *sender, void *start, size_t length, int prot,
int flags, int fd, off_t offset);
int sys_munmap(l4id_t sender, void *vaddr, unsigned long size);
int sys_munmap(struct tcb *sender, void *vaddr, unsigned long size);
struct sys_shmat_args {
l4id_t shmid;
@@ -33,8 +34,8 @@ struct sys_shmat_args {
int shmflg;
};
void *sys_shmat(l4id_t requester, l4id_t shmid, const void *shmaddr, int shmflg);
int sys_shmdt(l4id_t requester, const void *shmaddr);
void *sys_shmat(struct tcb *requester, l4id_t shmid, const void *shmaddr, int shmflg);
int sys_shmdt(struct tcb *requester, const void *shmaddr);
struct sys_shmget_args {
key_t key;
@@ -44,7 +45,7 @@ struct sys_shmget_args {
int sys_shmget(key_t key, int size, int shmflg);
int sys_fork(l4id_t parent);
int sys_fork(struct tcb *parent);
#endif /* __MM0_SYSARGS_H__ */

View File

@@ -113,7 +113,7 @@ struct task_data_head {
struct tcb *find_task(int tid);
void task_add_global(struct tcb *t);
int send_task_data(l4id_t requester);
int send_task_data(struct tcb *requester);
void task_map_prefault_utcb(struct tcb *mapper, struct tcb *owner);
int task_mmap_regions(struct tcb *task, struct vm_file *file);
int task_setup_regions(struct vm_file *file, struct tcb *task,

View File

@@ -8,7 +8,7 @@ int utcb_pool_init(void);
/* IPC to send utcb address information to tasks */
void *task_send_utcb_address(l4id_t sender, l4id_t taskid);
void *task_send_utcb_address(struct tcb *sender, l4id_t taskid);
/* Prefault an *mmaped* utcb */
int utcb_prefault(struct tcb *task, unsigned int vmflags);

View File

@@ -252,6 +252,6 @@ static inline void task_add_vma(struct tcb *task, struct vm_area *vma)
}
/* Main page fault entry point */
int page_fault_handler(l4id_t tid, fault_kdata_t *fkdata);
int page_fault_handler(struct tcb *faulty_task, fault_kdata_t *fkdata);
#endif /* __VM_AREA_H__ */