]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - embedded/arch/arm/generic/libs/misc/system_stub.c
Embedded code-base updated to actual version from uLan repository.
[lincan.git] / embedded / arch / arm / generic / libs / misc / system_stub.c
index 24fa2f9677a4f35d886d4906b980fc509bdc69d5..31a8f666942ce366bc33df1a19084dc7cd3476d4 100644 (file)
@@ -30,7 +30,7 @@ _read (int file,
 
 int
 _write (int    file,
 
 int
 _write (int    file,
-       char * ptr,
+       const char * ptr,
        int    len)
 {
   if(!system_stub_ops.write)
        int    len)
 {
   if(!system_stub_ops.write)
@@ -76,6 +76,12 @@ _exit (int n)
   while(1);
 }
 
   while(1);
 }
 
+void abort(void)
+{
+  ((local_call_t*)0)();
+  while(1);
+}
+
 int
 _kill (int n, int m)
 {
 int
 _kill (int n, int m)
 {
@@ -83,14 +89,14 @@ _kill (int n, int m)
 }
 
 int
 }
 
 int
-_getpid (int n)
+_getpid (void)
 {
   return 1;
 }
 
 
 {
   return 1;
 }
 
 
-caddr_t
-_sbrk (int incr)
+void *
+_sbrk (ptrdiff_t incr)
 {
   extern char   end asm ("end");       /* Defined by the linker.  */
   static char   *heap_end;
 {
   extern char   end asm ("end");       /* Defined by the linker.  */
   static char   *heap_end;
@@ -121,7 +127,7 @@ _sbrk (int incr)
   
   heap_end += incr;
 
   
   heap_end += incr;
 
-  return (caddr_t) prev_heap_end;
+  return /*(caddr_t)*/ prev_heap_end;
 }
 
 int
 }
 
 int
@@ -136,13 +142,13 @@ int _stat (const char *fname, struct stat *st)
 }
 
 int
 }
 
 int
-_link (void)
+_link (const char *path1, const char *path2 )
 {
   return -1;
 }
 
 int
 {
   return -1;
 }
 
 int
-_unlink (void)
+_unlink (const char *path)
 {
   return -1;
 }
 {
   return -1;
 }
@@ -207,3 +213,47 @@ _rename (const char * oldpath, const char * newpath)
 {
   return -1;
 }
 {
   return -1;
 }
+
+/* extern (.*) ([^ ]*) _PARAMS \(\(struct _reent \*(,*)(.*)\)\); */
+/* \1 \2 (struct _reent *\3\4) { return \2(\4);} */
+
+struct _reent;
+
+int _close_r(struct _reent * reent, int file) 
+  { return _close(file);}
+/*
+int _fcntl_r(struct _reent *, int, int, int)
+  { return _fcntl( int, int, int);}
+*/
+int _fstat_r(struct _reent * reent, int file, struct stat * st)
+  { return _fstat(file, st);}
+
+int _getpid_r(struct _reent * reent)
+  { return _getpid();}
+
+int _kill_r(struct _reent * reent, int n, int m)
+  { return _kill(n, m);}
+
+int _link_r(struct _reent * reent, const char *path1, const char *path2)
+  { return _link(path1, path2);}
+
+_off_t _lseek_r(struct _reent * reent, int file, _off_t pos, int dir)
+  { return _lseek(file, pos, dir);}
+
+int _open_r(struct _reent * reent, const char * path, int flags, int opts)
+  { return _open(path, flags, opts);}
+
+_ssize_t _read_r(struct _reent * reent, int file, void * ptr, size_t len)
+  { return _read(file, ptr, len);}
+
+void *_sbrk_r(struct _reent * reent, ptrdiff_t incr)
+  { return _sbrk(incr);}
+
+int _stat_r(struct _reent * reent, const char * path, struct stat * st)
+  { return _stat(path, st);}
+
+int _unlink_r(struct _reent * reent, const char * path)
+  { return _unlink(path);}
+
+_ssize_t _write_r(struct _reent * reent, int file, const void * ptr, size_t len)
+  { return _write(file, ptr, len);}