From e2e6c89da2b5870bba0f2ce98326577878ebf39c Mon Sep 17 00:00:00 2001 From: Bahadir Balban Date: Sat, 1 Mar 2008 15:15:36 +0000 Subject: [PATCH] Prepare to reimplement copy-on-write. previous commit stable. --- tasks/mm0/include/env.h | 6 ------ tasks/mm0/include/proc.h | 13 +++++++++++++ tasks/mm0/include/task.h | 11 +++++++++-- tasks/mm0/src/{env.c => proc.c} | 1 + tasks/mm0/src/task.c | 2 +- 5 files changed, 24 insertions(+), 9 deletions(-) delete mode 100644 tasks/mm0/include/env.h create mode 100644 tasks/mm0/include/proc.h rename tasks/mm0/src/{env.c => proc.c} (99%) diff --git a/tasks/mm0/include/env.h b/tasks/mm0/include/env.h deleted file mode 100644 index f6553c1..0000000 --- a/tasks/mm0/include/env.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __MM0_ENV__ -#define __MM0_ENV__ - -int task_prepare_environment(struct tcb *t); - -#endif diff --git a/tasks/mm0/include/proc.h b/tasks/mm0/include/proc.h new file mode 100644 index 0000000..9c8a2db --- /dev/null +++ b/tasks/mm0/include/proc.h @@ -0,0 +1,13 @@ +#ifndef __MM0_PROC__ +#define __MM0_PROC__ + +struct proc_files { + struct vm_file *stackfile; /* ZI, private, devzero, then autogenerated */ + struct vm_file *envfile; /* NON-ZI, private, autogenerated, then autogenerated */ + struct vm_file *datafile; /* NON-ZI, private, real file, then autogenerated */ + struct vm_file *bssfile; /* ZI private, devzero, then autogenerated */ +}; + +int task_prepare_procfiles(struct tcb *t); + +#endif diff --git a/tasks/mm0/include/task.h b/tasks/mm0/include/task.h index dce59d7..aa62254 100644 --- a/tasks/mm0/include/task.h +++ b/tasks/mm0/include/task.h @@ -29,6 +29,13 @@ struct file_descriptor { struct vm_file *vmfile; }; +struct proc_files { + struct vm_file *stackfile; /* ZI, private, devzero, then autogenerated */ + struct vm_file *envfile; /* NON-ZI, private, autogenerated, then autogenerated */ + struct vm_file *datafile; /* NON-ZI, private, real file, then autogenerated */ + struct vm_file *bssfile; /* ZI private, devzero, then autogenerated */ +}; + /* Stores all task information that can be kept in userspace. */ struct tcb { /* Task list */ @@ -63,8 +70,8 @@ struct tcb { /* UTCB address */ unsigned long utcb_address; - /* Per-task environment file */ - struct vm_file *env_file; + /* Task's private files */ + struct proc_files proc_files; /* Virtual memory areas */ struct list_head vm_area_list; diff --git a/tasks/mm0/src/env.c b/tasks/mm0/src/proc.c similarity index 99% rename from tasks/mm0/src/env.c rename to tasks/mm0/src/proc.c index 94bd199..72a6033 100644 --- a/tasks/mm0/src/env.c +++ b/tasks/mm0/src/proc.c @@ -22,6 +22,7 @@ #include #include #include +#include struct envdata { struct list_head list; diff --git a/tasks/mm0/src/task.c b/tasks/mm0/src/task.c index 714746f..3d36c7c 100644 --- a/tasks/mm0/src/task.c +++ b/tasks/mm0/src/task.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include struct tcb_head { struct list_head list;