NEORV32 - Software Framework Documentation
Loading...
Searching...
No Matches
Macros | Functions | Variables
syscalls.c File Reference

Newlib system calls. More...

#include <sys/stat.h>
#include <sys/timeb.h>
#include <sys/times.h>
#include <utime.h>
#include <newlib.h>
#include <unistd.h>
#include <errno.h>
#include <neorv32.h>

Macros

#define _sbrk   sbrk
 
#define _write   write
 
#define _close   close
 
#define _lseek   lseek
 
#define _read   read
 
#define _fstat   fstat
 
#define _isatty   isatty
 

Functions

void unimplemented_syscall ()
 
int nanosleep (const struct timespec *rqtp, struct timespec *rmtp)
 
int _access (const char *file, int mode)
 
int _chdir (const char *path)
 
int _chmod (const char *path, mode_t mode)
 
int _chown (const char *path, uid_t owner, gid_t group)
 
int _close (int file)
 
int _execve (const char *name, char *const argv[], char *const env[])
 
void _exit (int exit_status)
 
int _faccessat (int dirfd, const char *file, int mode, int flags)
 
int _fork (void)
 
int _fstat (int file, struct stat *st)
 
int _fstatat (int dirfd, const char *file, struct stat *st, int flags)
 
int _ftime (struct timeb *tp)
 
char * _getcwd (char *buf, size_t size)
 
int _getpid ()
 
int _gettimeofday (struct timeval *tp, void *tzp)
 
int _isatty (int file)
 
int _kill (int pid, int sig)
 
int _link (const char *old_name, const char *new_name)
 
off_t _lseek (int file, off_t ptr, int dir)
 
int _lstat (const char *file, struct stat *st)
 
int _open (const char *name, int flags, int mode)
 
int _openat (int dirfd, const char *name, int flags, int mode)
 
ssize_t _read (int file, void *ptr, size_t len)
 
int _stat (const char *file, struct stat *st)
 
long _sysconf (int name)
 
clock_t _times (struct tms *buf)
 
int _unlink (const char *name)
 
int _utime (const char *path, const struct utimbuf *times)
 
int _wait (int *status)
 
ssize_t _write (int file, const void *ptr, size_t len)
 
int _brk (void *addr)
 
void * _sbrk (ptrdiff_t incr)
 

Variables

int errno
 
const volatile unsigned int __crt0_main_exit
 
char __heap_start []
 
char __heap_end []
 
static char * brk = &__heap_start[0]
 

Detailed Description

Newlib system calls.

Warning
UART0 (if available) is used to read/write console data (STDIN, STDOUT, STDERR, ...).
Note
Original source file: https://github.com/openhwgroup/cv32e40p/blob/master/example_tb/core/custom/syscalls.c
Original license: SOLDERPAD HARDWARE LICENSE version 0.51
More information was derived from: https://interrupt.memfault.com/blog/boostrapping-libc-with-newlib#implementing-newlib