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

task.c File Reference

Functions pretaining to the setup and execution of tasks. More...

#include <task.h>
#include <thread.h>
#include <vm.h>
#include <x86/proc_reg.h>
#include <malloc.h>
#include <elf.h>
#include <string.h>

Functions

int task_manager_initialize (void)
 Initializes the task manager.

Task * task_current (void)
 Gets the currently running task.

Task * task_create (Task *parentTask)
 Creates a new task.

void task_destroy (Task *task)
 Destroys a task.

void task_exit (Task *task)
 Free resources for an exiting task.

Task * task_fork (void)
 Forks a task.

int task_exec (Task *task, char *execname, char **execvec)

Variables

Task * initTask
char execnameBuffer [EXECNAME_LIMIT]
char execvecBuffer [EXECVEC_BUFFER_LIMIT]
char * execvecArgv [EXECVEC_ARGV_LIMIT]


Detailed Description

Functions pretaining to the setup and execution of tasks.

Author:
Lee Salzman (lsalzman)

Hassaan Moin Khan (hkhan)

Bug:
No known bugs.

Function Documentation

Task* task_create Task *  parent  ) 
 

Creates a new task.

Creates a new task and inserts it to the back of the list

Parameters:
parent the parent of the task to be created
Returns:
NULL if task couldn't be created; the task otherwise

Task* task_current void   ) 
 

Gets the currently running task.

returns the task of the currently running thread

Returns:
NULL if no thread is running or the task of the currently running thread

void task_destroy Task *  task  ) 
 

Destroys a task.

Kills a task that was in the list of tasks

Parameters:
task the task to be killed
Returns:
Void

void task_exit Task *   ) 
 

Free resources for an exiting task.

This should be called once the last thread of a task has exited to free any resources associated with the task and wake any threads waiting for it to complete.

Parameters:
task the task to exit
Returns:
Void

Task* task_fork void   ) 
 

Forks a task.

Forks a new task that is a copy of the current task

Returns:
the forked task on success NULL on failure

int task_manager_initialize void   ) 
 

Initializes the task manager.

runs the init task

Returns:
returns 0 on success and -1 on failure


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