mirror of
https://github.com/drasko/codezero.git
synced 2026-04-18 01:39:05 +02:00
Towards implementing fork.
Issue is that shadow object references from original objects are into the links rather than the objects.
This commit is contained in:
@@ -87,6 +87,7 @@ struct tcb *find_task(int tid);
|
||||
struct initdata;
|
||||
void init_pm(struct initdata *initdata);
|
||||
|
||||
struct tcb *task_create(struct task_ids *ids, unsigned int flags);
|
||||
int send_task_data(l4id_t requester);
|
||||
|
||||
#endif /* __TASK_H__ */
|
||||
|
||||
@@ -122,7 +122,7 @@ struct vm_pager {
|
||||
struct vm_object {
|
||||
int npages; /* Number of pages in memory */
|
||||
int refcnt; /* Number of shadows (or vmas) that refer */
|
||||
struct list_head shadowers; /* List of vm objects that shadow this one */
|
||||
struct list_head shadowers; /* List of links to the vm object that shadows this one */
|
||||
struct vm_object *orig_obj; /* Original object that this one shadows */
|
||||
unsigned int flags; /* Defines the type and flags of the object */
|
||||
struct list_head list; /* List of all vm objects in memory */
|
||||
@@ -142,7 +142,13 @@ struct vm_file {
|
||||
/* To create per-vma vm_object lists */
|
||||
struct vm_obj_link {
|
||||
struct list_head list;
|
||||
struct list_head shref; /* Ref to shadowers by original objects */
|
||||
|
||||
/*
|
||||
* Ref to shadowers by original objects. This could be in the shadow
|
||||
* object itself, but then we would not be able to reach its link
|
||||
* when trying to free it.
|
||||
*/
|
||||
struct list_head shref;
|
||||
struct vm_object *obj;
|
||||
};
|
||||
|
||||
@@ -218,6 +224,9 @@ struct page *task_virt_to_page(struct tcb *t, unsigned long virtual);
|
||||
int validate_task_range(struct tcb *t, unsigned long start,
|
||||
unsigned long end, unsigned int vmflags);
|
||||
|
||||
/* Changes all shadows and their ptes to read-only */
|
||||
int vm_freeze_shadows(struct tcb *task);
|
||||
|
||||
/* Main page fault entry point */
|
||||
int page_fault_handler(l4id_t tid, fault_kdata_t *fkdata);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user