mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 02:43:15 +01:00
- fixed is_err(x), was evaluating x twice, resulting in calling a function x twice. - Divided task initialisation into multiple parts. - MM0 now creates a tcb for itself and maintains memory regions of its own. - MM0's tcb is used for mmapping other tasks' regions. MM0 mmaps and prefaults those regions, instead of the typical mmap() and fault approach used by non-pager tasks. For example there's an internal shmget_shmat() path to map in other tasks' shm utcbs. Those mappings are then prefaulted into mm0's address space using the default fault handling path. - FS0 now reads task data into its utcb from mm0 via a syscall. FS0 shmat()s to utcbs of other tasks, e.g. mm0 and test0. FS0 then crashes, that is to be fixed and where this commit is left last.
36 lines
674 B
C
36 lines
674 B
C
/*
|
|
* Copyright (C) 2008 Bahadir Balban
|
|
*/
|
|
#ifndef __FS0_TASK_H__
|
|
#define __FS0_TASK_H__
|
|
|
|
#include <lib/idpool.h>
|
|
#include <l4/lib/list.h>
|
|
#include <l4/api/kip.h>
|
|
|
|
#define __TASKNAME__ __VFSNAME__
|
|
|
|
#define TASK_OFILES_MAX 32
|
|
|
|
/* 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_OFILES_MAX];
|
|
struct id_pool *fdpool;
|
|
struct vnode *curdir;
|
|
struct vnode *rootdir;
|
|
};
|
|
|
|
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);
|
|
|
|
#endif /* __FS0_TASK_H__ */
|