summaryrefslogtreecommitdiff
path: root/components/libc/compilers
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-11-15 11:22:49 -0500
committerMeco Man <[email protected]>2021-11-16 00:57:56 -0500
commit973f25901c641f01b19b065a1e263533fc4d8755 (patch)
tree3e4e095bb0d1b4bd1b458f865ec7bf975594bc17 /components/libc/compilers
parent0bcab2892a81960ceb394b5cde4bc78eed3326eb (diff)
[dfs] move dfs back
Diffstat (limited to 'components/libc/compilers')
-rw-r--r--components/libc/compilers/armlibc/syscalls.c38
-rw-r--r--components/libc/compilers/dlib/SConscript2
-rw-r--r--components/libc/compilers/dlib/syscall_close.c4
-rw-r--r--components/libc/compilers/dlib/syscall_lseek.c4
-rw-r--r--components/libc/compilers/dlib/syscall_open.c4
-rw-r--r--components/libc/compilers/dlib/syscall_read.c4
-rw-r--r--components/libc/compilers/dlib/syscall_remove.c4
-rw-r--r--components/libc/compilers/dlib/syscall_write.c8
-rw-r--r--components/libc/compilers/gcc/newlib/syscalls.c40
9 files changed, 54 insertions, 54 deletions
diff --git a/components/libc/compilers/armlibc/syscalls.c b/components/libc/compilers/armlibc/syscalls.c
index b6448f2165..71eacb1c41 100644
--- a/components/libc/compilers/armlibc/syscalls.c
+++ b/components/libc/compilers/armlibc/syscalls.c
@@ -33,7 +33,7 @@
__asm(".global __use_no_semihosting\n\t");
#else
#pragma import(__use_no_semihosting_swi)
-#endif
+#endif /* __CLANG_ARM */
/* Standard IO device handles. */
#define STDIN 0
@@ -55,10 +55,10 @@ const char __stderr_name[] = "STDERR";
*/
FILEHANDLE _sys_open(const char *name, int openmode)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int fd;
int mode = O_RDONLY;
-#endif
+#endif /* DFS_USING_POSIX */
/* Register standard Input Output devices. */
if (strcmp(name, __stdin_name) == 0)
@@ -68,7 +68,7 @@ FILEHANDLE _sys_open(const char *name, int openmode)
if (strcmp(name, __stderr_name) == 0)
return (STDERR);
-#ifndef RT_USING_POSIX
+#ifndef DFS_USING_POSIX
return 0; /* error */
#else
/* Correct openmode from fopen to open */
@@ -102,19 +102,19 @@ FILEHANDLE _sys_open(const char *name, int openmode)
return 0; /* error */
else
return fd;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _sys_close(FILEHANDLE fh)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
if (fh <= STDERR)
return 0; /* error */
return close(fh);
#else
return 0;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
/*
@@ -144,7 +144,7 @@ int _sys_close(FILEHANDLE fh)
*/
int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int size;
if (fh == STDIN)
@@ -175,7 +175,7 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
}
#else
return 0; /* error */
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
/*
@@ -189,9 +189,9 @@ int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode)
*/
int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int size;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
if (fh == STDOUT || fh == STDERR)
{
@@ -213,7 +213,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
}
else
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
size = write(fh, buf, len);
if (size >= 0)
return 0; /* success */
@@ -221,7 +221,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
return 0; /* error */
#else
return 0; /* error */
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
}
@@ -231,7 +231,7 @@ int _sys_write(FILEHANDLE fh, const unsigned char *buf, unsigned len, int mode)
*/
int _sys_seek(FILEHANDLE fh, long pos)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
if (fh < STDERR)
return 0; /* error */
@@ -239,7 +239,7 @@ int _sys_seek(FILEHANDLE fh, long pos)
return lseek(fh, pos, 0);
#else
return 0; /* error */
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
/**
@@ -284,7 +284,7 @@ RT_WEAK void _sys_exit(int return_code)
*/
long _sys_flen(FILEHANDLE fh)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
struct stat stat;
if (fh < STDERR)
@@ -294,7 +294,7 @@ long _sys_flen(FILEHANDLE fh)
return stat.st_size;
#else
return 0;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _sys_istty(FILEHANDLE fh)
@@ -307,11 +307,11 @@ int _sys_istty(FILEHANDLE fh)
int remove(const char *filename)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
return unlink(filename);
#else
return 0; /* error */
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
#ifdef __MICROLIB
diff --git a/components/libc/compilers/dlib/SConscript b/components/libc/compilers/dlib/SConscript
index 39707abc61..f685873e16 100644
--- a/components/libc/compilers/dlib/SConscript
+++ b/components/libc/compilers/dlib/SConscript
@@ -7,7 +7,7 @@ group = []
CPPDEFINES = ['RT_USING_DLIBC']
if rtconfig.PLATFORM == 'iar':
- if GetDepend('RT_USING_POSIX'):
+ if GetDepend('DFS_USING_POSIX'):
from distutils.version import LooseVersion
from iar import IARVersion
diff --git a/components/libc/compilers/dlib/syscall_close.c b/components/libc/compilers/dlib/syscall_close.c
index aef9673153..30ee6f2388 100644
--- a/components/libc/compilers/dlib/syscall_close.c
+++ b/components/libc/compilers/dlib/syscall_close.c
@@ -24,9 +24,9 @@ int __close(int handle)
handle == _LLIO_STDERR ||
handle == _LLIO_STDIN)
return _LLIO_ERROR;
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
return close(handle);
#else
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_lseek.c b/components/libc/compilers/dlib/syscall_lseek.c
index b1547f699e..622f613c51 100644
--- a/components/libc/compilers/dlib/syscall_lseek.c
+++ b/components/libc/compilers/dlib/syscall_lseek.c
@@ -33,9 +33,9 @@ long __lseek(int handle, long offset, int whence)
handle == _LLIO_STDERR ||
handle == _LLIO_STDIN)
return _LLIO_ERROR;
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
return lseek(handle, offset, whence);
#else
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_open.c b/components/libc/compilers/dlib/syscall_open.c
index 3336bc8885..66cddc83c1 100644
--- a/components/libc/compilers/dlib/syscall_open.c
+++ b/components/libc/compilers/dlib/syscall_open.c
@@ -21,7 +21,7 @@
int __open(const char *filename, int mode)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int handle;
int open_mode = O_RDONLY;
@@ -73,5 +73,5 @@ int __open(const char *filename, int mode)
return handle;
#else
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_read.c b/components/libc/compilers/dlib/syscall_read.c
index e88f88ead4..469ea7c1dd 100644
--- a/components/libc/compilers/dlib/syscall_read.c
+++ b/components/libc/compilers/dlib/syscall_read.c
@@ -34,7 +34,7 @@
size_t __read(int handle, unsigned char *buf, size_t len)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int size;
if (handle == _LLIO_STDIN)
@@ -59,5 +59,5 @@ size_t __read(int handle, unsigned char *buf, size_t len)
return size; /* return the length of the data read */
#else
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_remove.c b/components/libc/compilers/dlib/syscall_remove.c
index cf6541132a..870f91b8c1 100644
--- a/components/libc/compilers/dlib/syscall_remove.c
+++ b/components/libc/compilers/dlib/syscall_remove.c
@@ -20,9 +20,9 @@
int remove(const char *filename)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
return unlink(filename);
#else
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
diff --git a/components/libc/compilers/dlib/syscall_write.c b/components/libc/compilers/dlib/syscall_write.c
index 9a7707e9d3..d5ede3e59e 100644
--- a/components/libc/compilers/dlib/syscall_write.c
+++ b/components/libc/compilers/dlib/syscall_write.c
@@ -37,9 +37,9 @@
size_t __write(int handle, const unsigned char *buf, size_t len)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int size;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
if ((handle == _LLIO_STDOUT) || (handle == _LLIO_STDERR))
{
@@ -63,11 +63,11 @@ size_t __write(int handle, const unsigned char *buf, size_t len)
}
else
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
size = write(handle, buf, len);
return size; /* return the length of the data written */
#else
return _LLIO_ERROR;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
}
diff --git a/components/libc/compilers/gcc/newlib/syscalls.c b/components/libc/compilers/gcc/newlib/syscalls.c
index f3a2f5bfcf..8bb9af940d 100644
--- a/components/libc/compilers/gcc/newlib/syscalls.c
+++ b/components/libc/compilers/gcc/newlib/syscalls.c
@@ -109,12 +109,12 @@ int _getpid_r(struct _reent *ptr)
int _close_r(struct _reent *ptr, int fd)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
return close(fd);
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif
+#endif /* DFS_USING_POSIX */
}
int _execve_r(struct _reent *ptr, const char * name, char *const *argv, char *const *env)
@@ -183,7 +183,7 @@ int flock(int fd, int operation)
_off_t _lseek_r(struct _reent *ptr, int fd, _off_t pos, int whence)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
_off_t rc;
rc = lseek(fd, pos, whence);
@@ -191,12 +191,12 @@ _off_t _lseek_r(struct _reent *ptr, int fd, _off_t pos, int whence)
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _mkdir_r(struct _reent *ptr, const char *name, int mode)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int rc;
rc = mkdir(name, mode);
@@ -204,24 +204,24 @@ int _mkdir_r(struct _reent *ptr, const char *name, int mode)
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _open_r(struct _reent *ptr, const char *file, int flags, int mode)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int rc;
rc = open(file, flags, mode);
return rc;
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
_ssize_t _read_r(struct _reent *ptr, int fd, void *buf, size_t nbytes)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
_ssize_t rc;
if (fd == STDIN_FILENO)
{
@@ -247,12 +247,12 @@ _ssize_t _read_r(struct _reent *ptr, int fd, void *buf, size_t nbytes)
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _rename_r(struct _reent *ptr, const char *old, const char *new)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int rc;
rc = rename(old, new);
@@ -260,12 +260,12 @@ int _rename_r(struct _reent *ptr, const char *old, const char *new)
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _stat_r(struct _reent *ptr, const char *file, struct stat *pstat)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
int rc;
rc = stat(file, pstat);
@@ -273,24 +273,24 @@ int _stat_r(struct _reent *ptr, const char *file, struct stat *pstat)
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
int _unlink_r(struct _reent *ptr, const char *file)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
return unlink(file);
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
_ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes)
{
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
_ssize_t rc;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
if (fd == STDOUT_FILENO || fd == STDERR_FILENO)
{
@@ -311,13 +311,13 @@ _ssize_t _write_r(struct _reent *ptr, int fd, const void *buf, size_t nbytes)
return -1;
}
-#ifdef RT_USING_POSIX
+#ifdef DFS_USING_POSIX
rc = write(fd, buf, nbytes);
return rc;
#else
ptr->_errno = ENOTSUP;
return -1;
-#endif /* RT_USING_POSIX */
+#endif /* DFS_USING_POSIX */
}
/* for exit() and abort() */