Browse Source

move mmap to src folder

Meco Man 3 years ago
parent
commit
219d1e20f5

+ 5 - 1
components/libc/Kconfig

@@ -44,16 +44,19 @@ config RT_USING_POSIX
 
 if RT_USING_POSIX
     config RT_USING_POSIX_STDIO
-        bool "Enable standard IO"
+        bool "Enable standard I/O"
+        select RT_USING_DFS
         select RT_USING_DFS_DEVFS
         default n
 
     config RT_USING_POSIX_POLL
         bool "Enable poll()"
+        select RT_USING_DFS
         default n
 
     config RT_USING_POSIX_SELECT
         bool "Enable select()"
+        select RT_USING_DFS
         select RT_USING_POSIX_POLL
         default n
 
@@ -67,6 +70,7 @@ if RT_USING_POSIX
 
     config RT_USING_POSIX_MMAP
         bool "Enable mmap() API"
+        select RT_USING_DFS
         default n
 
     config RT_USING_POSIX_TERMIOS

+ 0 - 13
components/libc/posix/mmap/SConscript

@@ -1,13 +0,0 @@
-# RT-Thread building script for component
-
-from building import *
-
-cwd = GetCurrentDir()
-src = Glob('*.c') + Glob('*.cpp')
-CPPPATH = [cwd]
-
-group = DefineGroup('POSIX', src,
-    depend = ['RT_USING_DFS', 'RT_USING_POSIX_MMAP'],
-    CPPPATH = CPPPATH)
-
-Return('group')

+ 3 - 0
components/libc/posix/src/SConscript

@@ -15,6 +15,9 @@ if GetDepend('RT_USING_POSIX_POLL'):
 if GetDepend('RT_USING_POSIX_SELECT'):
     src += ['select.c']
 
+if GetDepend('RT_USING_POSIX_MMAP'):
+    src += ['mmap.c']
+
 group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX'], CPPPATH = CPPPATH)
 
 Return('group')

+ 0 - 0
components/libc/posix/mmap/posix_mmap.c → components/libc/posix/src/mmap.c


+ 0 - 4
components/libc/posix/src/poll.c

@@ -14,8 +14,6 @@
 #include <dfs_file.h>
 #include <poll.h>
 
-#ifdef RT_USING_POSIX
-
 struct rt_poll_node;
 
 struct rt_poll_table
@@ -226,5 +224,3 @@ int poll(struct pollfd *fds, nfds_t nfds, int timeout)
 
     return num;
 }
-
-#endif

+ 0 - 4
components/libc/posix/src/select.c

@@ -11,8 +11,6 @@
 #include <poll.h>
 #include <sys/select.h>
 
-#ifdef RT_USING_POSIX
-
 static void fdszero(fd_set *set, int nfds)
 {
     fd_mask *m;
@@ -176,5 +174,3 @@ int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struc
 
     return ret;
 }
-
-#endif