mirror of
https://github.com/drasko/codezero.git
synced 2026-02-13 02:13:15 +01:00
Made changes to have shared tcb parts in fs0 in preparation for clone()
fs_data and files structures can now be shared in the vfs task. Currently no means to free shared structures in tcb destruction. Need to add that.
This commit is contained in:
@@ -10,6 +10,7 @@ int find_and_set_first_free_contig_bits(u32 *word, unsigned int limit,
|
||||
int check_and_clear_bit(u32 *word, int bit);
|
||||
int check_and_clear_contig_bits(u32 *word, int first, int nbits);
|
||||
|
||||
int check_and_set_bit(u32 *word, int bit);
|
||||
|
||||
/* Set */
|
||||
static inline void setbit(unsigned int *w, unsigned int flags)
|
||||
|
||||
@@ -22,6 +22,7 @@ static inline void id_pool_copy(struct id_pool *to, struct id_pool *from, int to
|
||||
struct id_pool *id_pool_new_init(int mapsize);
|
||||
int id_new(struct id_pool *pool);
|
||||
int id_del(struct id_pool *pool, int id);
|
||||
int id_get(struct id_pool *pool, int id);
|
||||
int ids_new_contiguous(struct id_pool *pool, int numids);
|
||||
int ids_del_contiguous(struct id_pool *pool, int first, int numids);
|
||||
|
||||
|
||||
@@ -27,8 +27,9 @@ int pager_sys_close(struct tcb *sender, l4id_t closer, int fd);
|
||||
int pager_update_stats(struct tcb *sender, unsigned long vnum,
|
||||
unsigned long newsize);
|
||||
|
||||
int pager_notify_fork(struct tcb *sender, l4id_t parid,
|
||||
l4id_t chid, unsigned long utcb_address);
|
||||
int pager_notify_fork(struct tcb *sender, l4id_t parentid,
|
||||
l4id_t childid, unsigned long utcb_address,
|
||||
unsigned int flags);
|
||||
|
||||
int pager_notify_exit(struct tcb *sender, l4id_t tid);
|
||||
#endif /* __FS0_SYSCALLS_H__ */
|
||||
|
||||
@@ -10,18 +10,32 @@
|
||||
|
||||
#define __TASKNAME__ __VFSNAME__
|
||||
|
||||
#define TCB_NO_SHARING 0
|
||||
#define TCB_SHARED_VM (1 << 0)
|
||||
#define TCB_SHARED_FILES (1 << 1)
|
||||
#define TCB_SHARED_FS (1 << 2)
|
||||
|
||||
#define TASK_FILES_MAX 32
|
||||
|
||||
struct task_fd_head {
|
||||
int fd[TASK_FILES_MAX];
|
||||
struct id_pool *fdpool;
|
||||
int tcb_refs;
|
||||
};
|
||||
|
||||
struct task_fs_data {
|
||||
struct vnode *curdir;
|
||||
struct vnode *rootdir;
|
||||
int tcb_refs;
|
||||
};
|
||||
|
||||
/* Thread control block, fs0 portion */
|
||||
struct tcb {
|
||||
l4id_t tid;
|
||||
unsigned long utcb_address;
|
||||
int utcb_mapped; /* Set if we mapped their utcb */
|
||||
struct list_head list;
|
||||
int fd[TASK_FILES_MAX];
|
||||
struct id_pool *fdpool;
|
||||
struct vnode *curdir;
|
||||
struct vnode *rootdir;
|
||||
unsigned long utcb_address;
|
||||
struct task_fd_head *files;
|
||||
struct task_fs_data *fs_data;
|
||||
};
|
||||
|
||||
/* Structures used when receiving new task info from pager */
|
||||
@@ -35,11 +49,6 @@ struct task_data_head {
|
||||
struct task_data tdata[];
|
||||
};
|
||||
|
||||
static inline int task_is_utcb_mapped(struct tcb *t)
|
||||
{
|
||||
return t->utcb_mapped;
|
||||
}
|
||||
|
||||
struct tcb *find_task(int tid);
|
||||
int init_task_data(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user