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

syscall.c File Reference

Installs the syscalls. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <exec2obj.h>
#include <x86/proc_reg.h>
#include <kerndebug.h>
#include <syscall_int.h>
#include <syscall.h>
#include <interrupt.h>
#include <task.h>
#include <thread.h>
#include <timer.h>
#include <vm.h>

Functions

void gettid_handler (InterruptVector vector, Registers *registers)
 The handler to get the id of the thread.

void fork_handler (InterruptVector vector, Registers *registers)
 The handler fork a child.

void exec_handler (InterruptVector vector, Registers *registers)
 The handler for task_exec.

void exit_handler (InterruptVector vector, Registers *registers)
 The handler for task_exit.

void wait_wake_handler (Thread *thread, void *data)
 The handler for wait.

void wait_handler (InterruptVector vector, Registers *registers)
 The handler for putting thread in wait state.

void thread_fork_handler (InterruptVector vector, Registers *registers)
 The handler for forking a new therad.

void yield_handler (InterruptVector vector, Registers *registers)
 The handler for yield.

void deschedule_handler (InterruptVector vector, Registers *registers)
 The handler for descheule.

void make_runnable_handler (InterruptVector vector, Registers *registers)
 The handler for make_runnable.

void get_ticks_handler (InterruptVector vector, Registers *registers)
 The handler for get_ticks.

void sleep_handler (InterruptVector vector, Registers *registers)
 The handler for sleep.

void new_pages_handler (InterruptVector vector, Registers *registers)
 The handler for new_pages.

void remove_pages_handler (InterruptVector vector, Registers *registers)
 The handler for remove_pages.

void halt_handler (InterruptVector vector, Registers *registers)
 The handler for halt.

void ls_handler (InterruptVector vector, Registers *registers)
 The handler for ls.

int syscall_initialize (void)
 Initialize the system syscalls.


Detailed Description

Installs the syscalls.

This file provides the implementation for installing the syscalls

Author:
Lee Salzman (lsalzman)
Bug:
No known bugs.

Function Documentation

void deschedule_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for descheule.

deschedules the currently running thread

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void exec_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for task_exec.

execs a new task

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void exit_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for task_exit.

exits a thread

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void fork_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler fork a child.

forks a new task

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void get_ticks_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for get_ticks.

Retruns the number of ticks

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void gettid_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler to get the id of the thread.

get the thread id of the current task

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void halt_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for halt.

shuts down the OS

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void ls_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for ls.

returns the names of the executable files

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void make_runnable_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for make_runnable.

changes the status of the thread to run state

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void new_pages_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for new_pages.

Allocates new memory to the calling task

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void remove_pages_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for remove_pages.

Removes new memory to the calling task

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void sleep_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for sleep.

Puts the thread to sleep

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

int syscall_initialize void   ) 
 

Initialize the system syscalls.

Sets up the interrupt handlers for the system calls.

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
0 on success -1 on failure

void thread_fork_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for forking a new therad.

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void wait_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for putting thread in wait state.

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void wait_wake_handler Thread *  thread,
void *  data
[static]
 

The handler for wait.

wakes the thread after a specified task has completed

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void

void yield_handler InterruptVector  vector,
Registers *  registers
[static]
 

The handler for yield.

Parameters:
vector The syscall interrupt
registers The syscall registers
Returns:
Void


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