Files
codezero/tasks/mm0/include/task.h
Bahadir Balban 58b833dd7f Forks and COW situations show that we need vm objects rather than vm_files.
This is the first commit towards implementing vm object based paging with
right COW methods.
2008-03-03 22:05:01 +00:00

90 lines
1.9 KiB
C

/*
* Thread control block.
*
* Copyright (C) 2007, 2008 Bahadir Balban
*/
#ifndef __TASK_H__
#define __TASK_H__
#include <l4/macros.h>
#include <l4/types.h>
#include INC_GLUE(memlayout.h)
#include <l4/lib/list.h>
#include <l4lib/types.h>
#include <l4lib/utcb.h>
#include <lib/addr.h>
#define __TASKNAME__ __PAGERNAME__
#define TASK_OFILES_MAX 32
struct vm_file;
struct file_descriptor {
unsigned long vnum;
unsigned long cursor;
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 */
struct list_head list;
/* Name of the task */
char name[16];
/* Task ids */
int tid;
int spid;
/* Related task ids */
unsigned int pagerid; /* Task's pager */
/* Program segment marks, ends exclusive as usual */
unsigned long text_start;
unsigned long text_end;
unsigned long data_start;
unsigned long data_end;
unsigned long bss_start;
unsigned long bss_end;
unsigned long stack_start;
unsigned long stack_end;
unsigned long heap_start;
unsigned long heap_end;
unsigned long env_start;
unsigned long env_end;
unsigned long args_start;
unsigned long args_end;
/* UTCB address */
unsigned long utcb_address;
/* Task's private files */
struct proc_files proc_files;
/* Virtual memory areas */
struct list_head vm_area_list;
/* File descriptors for this task */
struct file_descriptor fd[TASK_OFILES_MAX];
};
struct tcb *find_task(int tid);
struct initdata;
void init_pm(struct initdata *initdata);
int start_init_tasks(struct initdata *initdata);
void dump_tasks(void);
void send_task_data(l4id_t requester);
#endif /* __TASK_H__ */