MentOS  0.8.0
The Mentoring Operating System
Macros | Typedefs | Functions | Variables
syscall.c File Reference

System Call management functions. More...

Macros

#define __DEBUG_HEADER__   "[SYSCLL]"
 Change header.
 
#define __DEBUG_LEVEL__   LOGLEVEL_NOTICE
 Set log level.
 

Typedefs

typedef int(* SystemCall) (void)
 The signature of a function call.
 
typedef int(* SystemCall5) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
 The signature of a function call.
 
typedef int(* SystemCall6) (uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)
 The signature of a function call.
 

Functions

static int sys_ni_syscall (void)
 A Not Implemented (NI) system-call. More...
 
void syscall_init (void)
 Initialize the system calls.
 
pt_regsget_current_interrupt_stack_frame (void)
 Returns the current interrupt stack frame. More...
 
void syscall_handler (pt_regs *f)
 Handler for the system calls. More...
 

Variables

SystemCall sys_call_table [SYSCALL_NUMBER]
 The list of function call.
 
static pt_regscurrent_interrupt_stack_frame
 Last interupt stack frame.
 

Detailed Description

System Call management functions.

Function Documentation

◆ get_current_interrupt_stack_frame()

pt_regs* get_current_interrupt_stack_frame ( void  )

Returns the current interrupt stack frame.

Returns
Pointer to the stack frame.

◆ sys_ni_syscall()

static int sys_ni_syscall ( void  )
inlinestatic

A Not Implemented (NI) system-call.

Returns
Always returns -ENOSYS.

Linux provides a "not implemented" system call, sys_ni_syscall(), which does nothing except return ENOSYS, the error corresponding to an invalid system call. This function is used to "plug the hole" in the rare event that a syscall is removed or otherwise made unavailable.

◆ syscall_handler()

void syscall_handler ( pt_regs f)

Handler for the system calls.

Parameters
fThe interrupt stack frame.