src/syscall.c File Reference

More...

#include <syscall.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "startup.h"
#include "time.h"
#include <sys/types.h>
#include <sys/time.h>

Include dependency graph for syscall.c:


Functions

register char *stack_ptr asm ("SP")
int _open (const char *file, int flags, int mode)
 Code for open.
int _close (int fd)
 Close function.
int _write (int fd, const void *buf, size_t cnt)
 Write function call the device own write.
int _read (int fd, void *buf, size_t cnt)
 Read function call the device own read.
int _fstat (int fd, struct stat *pstat)
int _lseek (int fd, _off_t offset, int whence)
int _isatty (int file)
void * _sbrk (int incr)
int _stat (const char *fname, struct stat *st)
int _link (const char *existing, const char *new)
int _unlink (const char *path)
void _raise (void)
int _system (const char *s)
int _rename (const char *oldpath, const char *newpath)
static int __setup_argv_for_main (int argc)
int __setup_argv_and_call_main ()
void _exit (int n)
int _kill (int n, int m)
int _getpid (int n)
int _gettimeofday (struct timeval *tp, void *tzvp)
 The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since epoch, and store it in the timeval structure pointed to by tp.

Variables

const devoptab_t console_devoptab
 Console table.
int errno
const devoptab_tdevoptab_list []
 Instantiation of the device operation All new devices will be added here.

Detailed Description

Target: TLL6527v1.1 Compiler: GCC

Author:
Rohan Kangralkar
Date:
11/11/2011
LastChange:
Id
syscall.c 1069 2013-02-25 18:19:21Z ovaskevi

Function Documentation

int __setup_argv_and_call_main (  ) 

static int __setup_argv_for_main ( int  argc  )  [inline, static]

int _close ( int  fd  ) 

Close function.

Parameters:
fd file descriptor or index to the device opt list

void _exit ( int  n  ) 

int _fstat ( int  fd,
struct stat *  pstat 
)

Parameters:
fd 
stat 
Returns:

int _getpid ( int  n  ) 

int _gettimeofday ( struct timeval *  tp,
void *  tzvp 
)

The gettimeofday() function shall obtain the current time, expressed as seconds and microseconds since epoch, and store it in the timeval structure pointed to by tp.

Timezone is not used.

int _isatty ( int  file  ) 

Parameters:
file 
Returns:

Todo:
check for tty

int _kill ( int  n,
int  m 
)

int _link ( const char *  existing,
const char *  new 
)

int _lseek ( int  fd,
_off_t  offset,
int  whence 
)

Parameters:
fd 
offset 
whence 
Returns:

int _open ( const char *  file,
int  flags,
int  mode 
)

Code for open.

The standard IO will not be calling open.

Parameters:
file file name
flags flags for opening the file unused at present
mode mode of opening the file unused
Returns:

Todo:
To use mode and flags while opening the files

void _raise ( void   ) 

int _read ( int  fd,
void *  buf,
size_t  cnt 
)

Read function call the device own read.

The deviceoptab_list is used as a table and the function is called;

Parameters:
fd file descriptor and is an index into the devoptab_list
buf buffer to read into
cnt size of the buffer
Returns:
number of bytes read

int _rename ( const char *  oldpath,
const char *  newpath 
)

void* _sbrk ( int  incr  ) 

int _stat ( const char *  fname,
struct stat *  st 
)

int _system ( const char *  s  ) 

int _unlink ( const char *  path  ) 

int _write ( int  fd,
const void *  buf,
size_t  cnt 
)

Write function call the device own write.

The deviceoptab_list is used as a table and the function is called;

Parameters:
fd file descriptor and is an index into the devoptab_list
buf buffer to write
cnt size of the buffer
Returns:
number of bytes written

register char* stack_ptr asm ( "SP"   ) 


Variable Documentation

const devoptab_t console_devoptab

Console table.

const devoptab_t* devoptab_list[]

Initial value:

 {





    &console_devoptab,
    &console_devoptab,
    &console_devoptab,

   0             
}
Instantiation of the device operation All new devices will be added here.

int errno


Generated on 3 Mar 2014 for PAL bare-c Library by  doxygen 1.4.7