Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
syscall.h File Reference
#include "procc/process.h"
#include <type.h>

Go to the source code of this file.

Data Structures

struct  iovec
 

Macros

#define SYSCALL_READ   0X0
 
#define SYSCALL_WRITE   0X1
 
#define SYSCALL_OPEN   0X2
 
#define SYSCALL_CLOSE   0x3
 
#define SYSCALL_FSTAT   0X4
 
#define SYSCALL_ALLOC   0x8
 
#define SYSCALL_ARCH_PRCTL   158
 
#define SYSCALL_API   0X9F
 
#define SYSCALL_SET_TID   0xDA
 
#define SYSCALL_EXIT   0x3C
 
#define SYSCALL_IOCTL   0x10
 
#define SYSCALL_WRITEV   0x14
 
#define SYSCALL_EXIT_GROUP   0xE7
 
#define SYSCALL_BRK   0x0C
 
#define SYSCALL_MMAP   0x9
 
#define SYSCALL_MPORTECT   0x0A
 
#define PROT_NONE   0
 
#define PROT_READ   1
 
#define PROT_WRITE   2
 
#define PROT_EXEC   4
 
#define PROT_GROWSDOWN   0x01000000
 
#define PROT_GROWSUP   0x02000000
 

Functions

void syscall_init (void)
 
int syscall_read (int fd, void *buf, long count)
 
int syscall_write (int fd, void *buf, long count)
 
int syscall_open (const char *path, int flags, int mode)
 
int syscall_arch_prctl (int code, unsigned long addr)
 
pid_t syscall_set_tid (uint32_t tid)
 
int syscall_ioctl (int fd, uint32_t req, void *arg)
 
intptr_t syscall_brk (void *addr)
 
void * syscall_mmap (void *addr, size_t len, int prot, int flags, int fd, long off)
 
int syscall_mprotect (void *addr, size_t len, int prot)
 
long syscall_writev (int fd, const struct iovec *iov, int iovcnt)
 
void syscall_exit_group (int status)
 

Macro Definition Documentation

◆ PROT_EXEC

#define PROT_EXEC   4

Definition at line 28 of file syscall.h.

Referenced by mmap_prot_to_flags(), and syscall_mprotect().

◆ PROT_GROWSDOWN

#define PROT_GROWSDOWN   0x01000000

Definition at line 29 of file syscall.h.

◆ PROT_GROWSUP

#define PROT_GROWSUP   0x02000000

Definition at line 30 of file syscall.h.

◆ PROT_NONE

#define PROT_NONE   0

Definition at line 25 of file syscall.h.

Referenced by mmap_prot_to_flags().

◆ PROT_READ

#define PROT_READ   1

Definition at line 26 of file syscall.h.

Referenced by mmap_prot_to_flags(), and syscall_mprotect().

◆ PROT_WRITE

#define PROT_WRITE   2

Definition at line 27 of file syscall.h.

Referenced by mmap_prot_to_flags(), and syscall_mprotect().

◆ SYSCALL_ALLOC

#define SYSCALL_ALLOC   0x8

Definition at line 13 of file syscall.h.

◆ SYSCALL_API

#define SYSCALL_API   0X9F

Definition at line 15 of file syscall.h.

◆ SYSCALL_ARCH_PRCTL

#define SYSCALL_ARCH_PRCTL   158

Definition at line 14 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_BRK

#define SYSCALL_BRK   0x0C

Definition at line 21 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_CLOSE

#define SYSCALL_CLOSE   0x3

Definition at line 11 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_EXIT

#define SYSCALL_EXIT   0x3C

Definition at line 17 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_EXIT_GROUP

#define SYSCALL_EXIT_GROUP   0xE7

Definition at line 20 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_FSTAT

#define SYSCALL_FSTAT   0X4

Definition at line 12 of file syscall.h.

◆ SYSCALL_IOCTL

#define SYSCALL_IOCTL   0x10

Definition at line 18 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_MMAP

#define SYSCALL_MMAP   0x9

Definition at line 22 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_MPORTECT

#define SYSCALL_MPORTECT   0x0A

Definition at line 23 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_OPEN

#define SYSCALL_OPEN   0X2

Definition at line 10 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_READ

#define SYSCALL_READ   0X0

Definition at line 8 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_SET_TID

#define SYSCALL_SET_TID   0xDA

Definition at line 16 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_WRITE

#define SYSCALL_WRITE   0X1

Definition at line 9 of file syscall.h.

Referenced by syscall_dispatch().

◆ SYSCALL_WRITEV

#define SYSCALL_WRITEV   0x14

Definition at line 19 of file syscall.h.

Referenced by syscall_dispatch().

Function Documentation

◆ syscall_arch_prctl()

int syscall_arch_prctl ( int code,
unsigned long addr )

◆ syscall_brk()

intptr_t syscall_brk ( void * addr)

◆ syscall_exit_group()

void syscall_exit_group ( int status)

Definition at line 5 of file exit_group.c.

References get_current_core_data(), serial2_printf(), and status.

Referenced by syscall_dispatch().

◆ syscall_init()

void syscall_init ( void )

Definition at line 15 of file syscall.c.

References MSR_EFER, MSR_FMASK, MSR_LSTAR, MSR_STAR, syscall_entry(), vxRDMSR(), and vxWRSR().

Referenced by __attribute__(), and INIT().

◆ syscall_ioctl()

int syscall_ioctl ( int fd,
uint32_t req,
void * arg )

Definition at line 8 of file ioctl.c.

References EBADF, ENOTTY, fdt, get_current_core_data(), LOG2_ERROR, and ops.

Referenced by syscall_dispatch().

◆ syscall_mmap()

void * syscall_mmap ( void * addr,
size_t len,
int prot,
int flags,
int fd,
long off )

◆ syscall_mprotect()

int syscall_mprotect ( void * addr,
size_t len,
int prot )

◆ syscall_open()

int syscall_open ( const char * path,
int flags,
int mode )

Definition at line 6 of file open.c.

References flags, mode, and path.

Referenced by syscall_dispatch().

◆ syscall_read()

int syscall_read ( int fd,
void * buf,
long count )

Definition at line 9 of file read.c.

References count, EBADF, ENOTTY, fdt, get_current_core_data(), LOG2_ERROR, and ops.

Referenced by syscall_dispatch().

◆ syscall_set_tid()

pid_t syscall_set_tid ( uint32_t tid)

Definition at line 5 of file set_tid.c.

References get_current_core_data().

Referenced by syscall_dispatch().

◆ syscall_write()

int syscall_write ( int fd,
void * buf,
long count )

Definition at line 8 of file write.c.

References count, EBADF, ENOTTY, fdt, get_current_core_data(), LOG2_ERROR, and ops.

Referenced by syscall_dispatch().

◆ syscall_writev()

long syscall_writev ( int fd,
const struct iovec * iov,
int iovcnt )