Main Page | Data Structures | File List | Globals | Related Pages

task.h

Go to the documentation of this file.
00001 
00011 #ifndef __KERN_TASK_H__
00012 #define __KERN_TASK_H__
00013 
00014 #include <list.h>
00015 #include <frame.h>
00016 #include <scheduler.h>
00017 
00018 /* Max. size of the name of a file */
00019 #define EXECNAME_LIMIT          256
00020 /* Max size of the parameters sent to the task */
00021 #define EXECVEC_ARGV_LIMIT      256
00022 /* Max size of the buffer */
00023 #define EXECVEC_BUFFER_LIMIT    4096
00024 
00025 struct Thread;
00026 
00027 typedef struct Task
00028 {
00029         /*Task list for the tasks */
00030         ListNode taskList;
00031         /*The parent task */
00032         struct Task * parentTask;
00033         /*List of teh child tasks */
00034         List childTasks;        
00035         /*The page the page directory is on */
00036         Frame * pageTable;
00037         /*The list of the page tables */
00038         List pageTables;
00039         /* Task address space */
00040         List memoryRegions;
00041         struct Thread * mainThread;
00042         /*List of threads running */
00043         List threads;
00044         /*Resource to monitor the exit status of threads */
00045         Resource exitResource;
00046        /*exitId for the task */
00047         int exitId;
00048        /*The status of the task */
00049         int exitStatus;
00050 } Task;
00051 
00052 
00059 extern int task_manager_initialize (void);
00060 
00061 
00068 extern Task * task_current (void);
00069 
00078 extern Task * task_create (Task * parent);
00079 
00080 
00089 extern void task_destroy (Task * task);
00090 
00091 
00099 extern Task * task_fork (void);
00100 
00101 
00102 extern int task_exec (Task * task, char * execname, char ** execvec);
00103 
00114 extern void task_exit (Task *);
00115  
00116 #endif /* __KERN_TASK_H__ */
00117 

Generated on Fri Apr 9 21:59:16 2004 for 15-410 Project 3 by doxygen 1.3.2