mirror of
https://github.com/drasko/codezero.git
synced 2026-02-28 17:53:13 +01:00
Modified task initialisation so that stack now comes beneath the environment
Environment is backed by a special per-task file maintained by mm0 for each task. This file is filled in by the env pager, by simple copying of env data into the faulty page upon a fault. UTCB and all anon regions (stack) could use the same scheme. Fixed IS_ERR(x) to accept negative values that are above -1000 for errors. This protects against false positives for pointers such as 0xE0000000. modified: include/l4/generic/scheduler.h modified: include/l4/macros.h modified: src/arch/arm/exception.c modified: tasks/fs0/include/linker.lds modified: tasks/libl4/src/init.c modified: tasks/libposix/shm.c new file: tasks/mm0/include/env.h modified: tasks/mm0/include/file.h new file: tasks/mm0/include/lib/addr.h deleted: tasks/mm0/include/lib/vaddr.h modified: tasks/mm0/include/task.h new file: tasks/mm0/include/utcb.h new file: tasks/mm0/src/env.c modified: tasks/mm0/src/fault.c modified: tasks/mm0/src/file.c modified: tasks/mm0/src/init.c new file: tasks/mm0/src/lib/addr.c modified: tasks/mm0/src/lib/idpool.c deleted: tasks/mm0/src/lib/vaddr.c modified: tasks/mm0/src/mmap.c modified: tasks/mm0/src/shm.c modified: tasks/mm0/src/task.c new file: tasks/mm0/src/utcb.c modified: tasks/test0/include/linker.lds
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include <l4/lib/list.h>
|
||||
#include <l4lib/types.h>
|
||||
#include <l4lib/utcb.h>
|
||||
#include <lib/addr.h>
|
||||
|
||||
#define __TASKNAME__ __PAGERNAME__
|
||||
|
||||
@@ -43,7 +44,7 @@ struct tcb {
|
||||
/* Related task ids */
|
||||
unsigned int pagerid; /* Task's pager */
|
||||
|
||||
/* Program segment marks */
|
||||
/* Program segment marks, ends exclusive as usual */
|
||||
unsigned long text_start;
|
||||
unsigned long text_end;
|
||||
unsigned long data_start;
|
||||
@@ -51,9 +52,9 @@ struct tcb {
|
||||
unsigned long bss_start;
|
||||
unsigned long bss_end;
|
||||
unsigned long stack_start;
|
||||
unsigned long stack_end; /* Exclusive of last currently mapped page */
|
||||
unsigned long stack_end;
|
||||
unsigned long heap_start;
|
||||
unsigned long heap_end; /* Exclusive of last currently mapped page */
|
||||
unsigned long heap_end;
|
||||
unsigned long env_start;
|
||||
unsigned long env_end;
|
||||
unsigned long args_start;
|
||||
@@ -62,17 +63,24 @@ struct tcb {
|
||||
/* UTCB address */
|
||||
unsigned long utcb_address;
|
||||
|
||||
/* Temporary storage for environment data */
|
||||
void *env_data;
|
||||
unsigned long env_size;
|
||||
|
||||
/* Per-task environment file */
|
||||
struct vm_file *env_file;
|
||||
|
||||
/* Virtual memory areas */
|
||||
struct list_head vm_area_list;
|
||||
|
||||
/* Per-task swap file for now */
|
||||
struct vm_file *swap_file;
|
||||
|
||||
/* File descriptors for this task */
|
||||
struct file_descriptor fd[TASK_OFILES_MAX];
|
||||
|
||||
/* Per-task swap file for now */
|
||||
struct vm_file *swap_file;
|
||||
|
||||
/* Pool to generate swap file offsets for fileless anonymous regions */
|
||||
struct id_pool *swap_file_offset_pool;
|
||||
struct address_pool swap_file_offset_pool;
|
||||
};
|
||||
|
||||
struct tcb *find_task(int tid);
|
||||
|
||||
Reference in New Issue
Block a user