From 9f55c88ddde6d55524217a2ae609df83cd6c09d2 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 15 Sep 2021 11:39:01 -0400 Subject: 刷新龙芯工程 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../libc/compilers/common/partial/ls/SConscript | 23 ++++++++++ .../libc/compilers/common/partial/ls/readme.md | 9 ++++ .../libc/compilers/common/partial/ls/sys/select.h | 52 ++++++++++++++++++++++ .../libc/compilers/common/partial/ls1/SConscript | 23 ---------- .../libc/compilers/common/partial/ls1/readme.md | 8 ---- .../libc/compilers/common/partial/ls1/sys/select.h | 52 ---------------------- 6 files changed, 84 insertions(+), 83 deletions(-) create mode 100644 components/libc/compilers/common/partial/ls/SConscript create mode 100644 components/libc/compilers/common/partial/ls/readme.md create mode 100644 components/libc/compilers/common/partial/ls/sys/select.h delete mode 100644 components/libc/compilers/common/partial/ls1/SConscript delete mode 100644 components/libc/compilers/common/partial/ls1/readme.md delete mode 100644 components/libc/compilers/common/partial/ls1/sys/select.h (limited to 'components') 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 +#include +#include + +#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__ */ diff --git a/components/libc/compilers/common/partial/ls1/SConscript b/components/libc/compilers/common/partial/ls1/SConscript deleted file mode 100644 index b988f7cf5f..0000000000 --- a/components/libc/compilers/common/partial/ls1/SConscript +++ /dev/null @@ -1,23 +0,0 @@ -from shutil import copy -from building import * - -Import('rtconfig') - -src = [] -cwd = GetCurrentDir() -CPPPATH = [cwd] -group = [] - -if rtconfig.PLATFORM == 'gcc': - if GetDepend('SOC_LS1B') or GetDepend('SOC_LS1C300'): - 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/ls1/readme.md b/components/libc/compilers/common/partial/ls1/readme.md deleted file mode 100644 index 575d713442..0000000000 --- a/components/libc/compilers/common/partial/ls1/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -This folder will be included when compiling the BSPs as follow: - -- ls1bdev -- ls1cdev - -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/ls1/sys/select.h b/components/libc/compilers/common/partial/ls1/sys/select.h deleted file mode 100644 index 575ad3a1b5..0000000000 --- a/components/libc/compilers/common/partial/ls1/sys/select.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 -#include -#include - -#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__ */ -- cgit v1.3.1