summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorliukangcc <[email protected]>2021-09-17 15:12:52 +0800
committerliukangcc <[email protected]>2021-09-17 15:12:52 +0800
commitc447018c406f1a49000150d8a52224b576eea65a (patch)
treeef614a6a4edf73e2cab522b4e3e6f4d6965af68a /components
parent2adfbcaeca0c3b565583cbb3d808c1e02ac8bd6d (diff)
parentef71de34f76d4403fcd2cddd21a17f3a53a40296 (diff)
Merge remote-tracking branch 'remotes/rtt_github/master'
Diffstat (limited to 'components')
-rw-r--r--components/dfs/include/dfs_select.h11
-rw-r--r--components/libc/compilers/common/nogcc/SConscript (renamed from components/libc/compilers/common/none-gcc/SConscript)0
-rw-r--r--components/libc/compilers/common/nogcc/readme.md (renamed from components/libc/compilers/common/none-gcc/readme.md)0
-rw-r--r--components/libc/compilers/common/nogcc/sys/errno.h (renamed from components/libc/compilers/common/none-gcc/sys/errno.h)0
-rw-r--r--components/libc/compilers/common/nogcc/sys/select.h (renamed from components/libc/compilers/common/sys/select.h)3
-rw-r--r--components/libc/compilers/common/nogcc/sys/stat.h (renamed from components/libc/compilers/common/none-gcc/sys/stat.h)0
-rw-r--r--components/libc/compilers/common/nogcc/sys/types.h (renamed from components/libc/compilers/common/none-gcc/sys/types.h)1
-rw-r--r--components/libc/compilers/common/nogcc/sys/unistd.h (renamed from components/libc/compilers/common/none-gcc/sys/unistd.h)0
-rw-r--r--components/libc/compilers/common/nogcc/unistd.h (renamed from components/libc/compilers/common/none-gcc/unistd.h)0
-rw-r--r--components/libc/compilers/common/partial/SConscript15
-rw-r--r--components/libc/compilers/common/partial/ls/SConscript23
-rw-r--r--components/libc/compilers/common/partial/ls/readme.md9
-rw-r--r--components/libc/compilers/common/partial/ls/sys/select.h52
13 files changed, 103 insertions, 11 deletions
diff --git a/components/dfs/include/dfs_select.h b/components/dfs/include/dfs_select.h
index e0572c5059..17291a60dc 100644
--- a/components/dfs/include/dfs_select.h
+++ b/components/dfs/include/dfs_select.h
@@ -12,15 +12,4 @@
#include <sys/select.h>
-#ifdef __cplusplus
-extern "C" {
#endif
-
-int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/components/libc/compilers/common/none-gcc/SConscript b/components/libc/compilers/common/nogcc/SConscript
index c766c8f82d..c766c8f82d 100644
--- a/components/libc/compilers/common/none-gcc/SConscript
+++ b/components/libc/compilers/common/nogcc/SConscript
diff --git a/components/libc/compilers/common/none-gcc/readme.md b/components/libc/compilers/common/nogcc/readme.md
index b10940d003..b10940d003 100644
--- a/components/libc/compilers/common/none-gcc/readme.md
+++ b/components/libc/compilers/common/nogcc/readme.md
diff --git a/components/libc/compilers/common/none-gcc/sys/errno.h b/components/libc/compilers/common/nogcc/sys/errno.h
index ff1abca387..ff1abca387 100644
--- a/components/libc/compilers/common/none-gcc/sys/errno.h
+++ b/components/libc/compilers/common/nogcc/sys/errno.h
diff --git a/components/libc/compilers/common/sys/select.h b/components/libc/compilers/common/nogcc/sys/select.h
index db42b6ebcc..575ad3a1b5 100644
--- a/components/libc/compilers/common/sys/select.h
+++ b/components/libc/compilers/common/nogcc/sys/select.h
@@ -13,6 +13,7 @@
#include <rtconfig.h>
#include <sys/types.h>
+#include <sys/time.h>
#ifndef FD_SETSIZE
#define FD_SETSIZE 32
@@ -46,4 +47,6 @@ typedef struct _types_fd_set {
#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
#endif /* _SYS_TYPES_FD_SET */
+int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
+
#endif /* __SYS_SELECT_H__ */
diff --git a/components/libc/compilers/common/none-gcc/sys/stat.h b/components/libc/compilers/common/nogcc/sys/stat.h
index 107c15decf..107c15decf 100644
--- a/components/libc/compilers/common/none-gcc/sys/stat.h
+++ b/components/libc/compilers/common/nogcc/sys/stat.h
diff --git a/components/libc/compilers/common/none-gcc/sys/types.h b/components/libc/compilers/common/nogcc/sys/types.h
index a7c566f643..2c4c12055f 100644
--- a/components/libc/compilers/common/none-gcc/sys/types.h
+++ b/components/libc/compilers/common/nogcc/sys/types.h
@@ -13,6 +13,7 @@
#include <stdint.h>
#include <stddef.h>
+#include <time.h>
typedef int32_t clockid_t;
typedef int32_t key_t; /* Used for interprocess communication. */
diff --git a/components/libc/compilers/common/none-gcc/sys/unistd.h b/components/libc/compilers/common/nogcc/sys/unistd.h
index 6195c4c2aa..6195c4c2aa 100644
--- a/components/libc/compilers/common/none-gcc/sys/unistd.h
+++ b/components/libc/compilers/common/nogcc/sys/unistd.h
diff --git a/components/libc/compilers/common/none-gcc/unistd.h b/components/libc/compilers/common/nogcc/unistd.h
index cd77a12e3b..cd77a12e3b 100644
--- a/components/libc/compilers/common/none-gcc/unistd.h
+++ b/components/libc/compilers/common/nogcc/unistd.h
diff --git a/components/libc/compilers/common/partial/SConscript b/components/libc/compilers/common/partial/SConscript
new file mode 100644
index 0000000000..4c815c49b8
--- /dev/null
+++ b/components/libc/compilers/common/partial/SConscript
@@ -0,0 +1,15 @@
+# RT-Thread building script for bridge
+
+import os
+from building import *
+
+cwd = GetCurrentDir()
+objs = []
+list = os.listdir(cwd)
+
+for d in list:
+ path = os.path.join(cwd, d)
+ if os.path.isfile(os.path.join(path, 'SConscript')):
+ objs = objs + SConscript(os.path.join(d, 'SConscript'))
+
+Return('objs')
diff --git a/components/libc/compilers/common/partial/ls/SConscript b/components/libc/compilers/common/partial/ls/SConscript
new file mode 100644
index 0000000000..2665bee078
--- /dev/null
+++ b/components/libc/compilers/common/partial/ls/SConscript
@@ -0,0 +1,23 @@
+from shutil import copy
+from building import *
+
+Import('rtconfig')
+
+src = []
+cwd = GetCurrentDir()
+CPPPATH = [cwd]
+group = []
+
+if rtconfig.PLATFORM == 'gcc' and GetDepend('SOC_LS'):
+ try:
+ # There is no 'sys/select.h' in these bsp's gcc toolchain; thus, we need to copy this file from 'nogcc/sys/select.h'
+ copy("../../nogcc/sys/select.h", "./sys/select.h")
+ except:
+ pass
+
+ if GetDepend('RT_USING_LIBC'):
+ src += Glob('*.c')
+
+ group = DefineGroup('libc', src, depend = [], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/components/libc/compilers/common/partial/ls/readme.md b/components/libc/compilers/common/partial/ls/readme.md
new file mode 100644
index 0000000000..fa68e1e84a
--- /dev/null
+++ b/components/libc/compilers/common/partial/ls/readme.md
@@ -0,0 +1,9 @@
+This folder will be included when compiling the BSPs as follow:
+
+- ls1bdev
+- ls1cdev
+- ls2kdev
+
+These files will be generated by scons automatically , and **DO NOT** change them:
+
+- sys/select.h \ No newline at end of file
diff --git a/components/libc/compilers/common/partial/ls/sys/select.h b/components/libc/compilers/common/partial/ls/sys/select.h
new file mode 100644
index 0000000000..575ad3a1b5
--- /dev/null
+++ b/components/libc/compilers/common/partial/ls/sys/select.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2021-07-21 Meco Man The first version
+ */
+
+#ifndef __SYS_SELECT_H__
+#define __SYS_SELECT_H__
+
+#include <rtconfig.h>
+#include <sys/types.h>
+#include <sys/time.h>
+
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 32
+#endif
+
+#ifdef SAL_USING_POSIX
+#ifdef FD_SETSIZE
+#undef FD_SETSIZE
+#endif
+#define FD_SETSIZE DFS_FD_MAX
+#endif /* SAL_USING_POSIX */
+
+#define NBBY 8 /* number of bits in a byte */
+
+typedef long fd_mask;
+
+#define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */
+#ifndef howmany
+#define howmany(x,y) (((x)+((y)-1))/(y))
+#endif
+
+#ifndef _SYS_TYPES_FD_SET /* MIPS */
+typedef struct _types_fd_set {
+ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];
+} _types_fd_set;
+#define fd_set _types_fd_set
+
+#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS)))
+#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS)))
+#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS)))
+#define FD_ZERO(p) memset((void*)(p), 0, sizeof(*(p)))
+#endif /* _SYS_TYPES_FD_SET */
+
+int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
+
+#endif /* __SYS_SELECT_H__ */