AquilaOS documentation
How it works, and its code
Loading...
Searching...
No Matches
syscall.h File Reference
#include <core/system.h>

Go to the source code of this file.

Typedefs

typedef long(*) syscall_t(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t)

Functions

void syscall_dispatch (unsigned long nr, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5)
 Runs a system call that the current thread made from user mode.

Variables

const syscall_t syscall_table []
const size_t syscall_cnt

Typedef Documentation

◆ syscall_t

typedef long(*) syscall_t(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t)

Definition at line 8 of file syscall.h.

Function Documentation

◆ syscall_dispatch()

void syscall_dispatch ( unsigned long nr,
uintptr_t a1,
uintptr_t a2,
uintptr_t a3,
uintptr_t a4,
uintptr_t a5 )

Runs a system call that the current thread made from user mode.

The architecture's arch_syscall() calls it with the number and the arguments, as they came in registers.

The call's result is set as the thread's result to return to user mode (arch_syscall_return()), except for sigreturn's: its registers are the ones it restored from the signal frame. A call that doesn't return (exit, or an execve that worked) doesn't come back here.

Parameters
nrthe system call's number (SYS_*)
a1its first argument
a2its second argument
a3its third argument
a4its fourth argument
a5its fifth argument

Definition at line 313 of file syscall.c.

References arch_syscall_return(), curproc, curthread, printk(), syscall_cnt, syscall_dispatch(), syscall_table, and thread_files_release().

Referenced by arch_syscall(), arch_syscall(), and syscall_dispatch().

Variable Documentation

◆ syscall_cnt

const size_t syscall_cnt
extern

Definition at line 293 of file syscall.c.

Referenced by syscall_dispatch().

◆ syscall_table

const syscall_t syscall_table[]
extern

Definition at line 197 of file syscall.c.

Referenced by syscall_dispatch().