summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorMeco Man <[email protected]>2021-11-24 09:14:46 -0500
committerMeco Man <[email protected]>2021-11-24 09:47:55 -0500
commit7c789d4b11c13e45ab1d2a858c68dabb022eb07c (patch)
tree084b7a54eebb1ad0574111a429d24b51bc9f6271 /components
parentbd80b7a4a15a2e97b13bbda69af8e909be544100 (diff)
revise some RT_USING_POSIX to RT_USING_POSIX_DEVIO
Diffstat (limited to 'components')
-rw-r--r--components/dfs/filesystems/devfs/devfs.c4
-rw-r--r--components/drivers/serial/serial.c13
-rw-r--r--components/drivers/serial/serial_v2.c6
-rw-r--r--components/drivers/src/pipe.c10
-rw-r--r--components/libc/compilers/common/sys/ioctl.h2
-rw-r--r--components/libc/posix/aio/SConscript2
-rw-r--r--components/libc/posix/src/libc.c9
-rw-r--r--components/libc/posix/src/libc.h4
-rw-r--r--components/libc/posix/termios/SConscript4
-rw-r--r--components/utilities/rt-link/src/rtlink_dev.c6
10 files changed, 27 insertions, 33 deletions
diff --git a/components/dfs/filesystems/devfs/devfs.c b/components/dfs/filesystems/devfs/devfs.c
index d615482452..d60f7ddc9b 100644
--- a/components/dfs/filesystems/devfs/devfs.c
+++ b/components/dfs/filesystems/devfs/devfs.c
@@ -173,7 +173,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
if (device == RT_NULL)
return -ENODEV;
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
if (device->fops)
{
/* use device fops */
@@ -192,7 +192,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
}
}
else
-#endif
+#endif /* RT_USING_POSIX_DEVIO */
{
result = rt_device_open(device, RT_DEVICE_OFLAG_RDWR);
if (result == RT_EOK || result == -RT_ENOSYS)
diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c
index 289d523bd2..c17c7aaebb 100644
--- a/components/drivers/serial/serial.c
+++ b/components/drivers/serial/serial.c
@@ -36,7 +36,7 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
#include <dfs_posix.h>
#include <poll.h>
#include <sys/ioctl.h>
@@ -203,7 +203,7 @@ const static struct dfs_file_ops _serial_fops =
RT_NULL, /* getdents */
serial_fops_poll,
};
-#endif
+#endif /* RT_USING_POSIX_DEVIO */
/*
* Serial poll routines
@@ -976,8 +976,7 @@ static void _tc_flush(struct rt_serial_device *serial, int queue)
}
}
-
-#endif
+#endif /* RT_USING_POSIX_TERMIOS */
static rt_err_t rt_serial_control(struct rt_device *dev,
int cmd,
@@ -1020,7 +1019,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
}
break;
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
#ifdef RT_USING_POSIX_TERMIOS
case TCGETA:
{
@@ -1215,7 +1214,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
*(rt_size_t *)args = recved;
}
break;
-#endif /*RT_USING_POSIX*/
+#endif /* RT_USING_POSIX_DEVIO */
default :
/* control device */
ret = serial->ops->control(serial, cmd, args);
@@ -1270,7 +1269,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial,
/* register a character device */
ret = rt_device_register(device, name, flag);
-#if defined(RT_USING_POSIX)
+#ifdef RT_USING_POSIX_DEVIO
/* set fops */
device->fops = &_serial_fops;
#endif
diff --git a/components/drivers/serial/serial_v2.c b/components/drivers/serial/serial_v2.c
index 390dd31748..4a43970126 100644
--- a/components/drivers/serial/serial_v2.c
+++ b/components/drivers/serial/serial_v2.c
@@ -16,7 +16,7 @@
#define DBG_LVL DBG_INFO
#include <rtdbg.h>
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
#include <dfs_posix.h>
#include <poll.h>
#include <sys/ioctl.h>
@@ -179,7 +179,7 @@ const static struct dfs_file_ops _serial_fops =
RT_NULL, /* getdents */
serial_fops_poll,
};
-#endif
+#endif /* RT_USING_POSIX_DEVIO */
static rt_size_t rt_serial_get_linear_buffer(struct rt_ringbuffer *rb,
rt_uint8_t **ptr)
@@ -1135,7 +1135,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial,
/* register a character device */
ret = rt_device_register(device, name, flag);
-#if defined(RT_USING_POSIX)
+#ifdef RT_USING_POSIX_DEVIO
/* set fops */
device->fops = &_serial_fops;
#endif
diff --git a/components/drivers/src/pipe.c b/components/drivers/src/pipe.c
index bfb07fa950..1d803e9a4c 100644
--- a/components/drivers/src/pipe.c
+++ b/components/drivers/src/pipe.c
@@ -13,7 +13,7 @@
#include <stdint.h>
#include <sys/errno.h>
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
#include <dfs_file.h>
#include <dfs_posix.h>
#include <poll.h>
@@ -320,7 +320,7 @@ static const struct dfs_file_ops pipe_fops =
RT_NULL,
pipe_fops_poll,
};
-#endif /* end of RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
rt_err_t rt_pipe_open(rt_device_t device, rt_uint16_t oflag)
{
@@ -479,7 +479,7 @@ rt_pipe_t *rt_pipe_create(const char *name, int bufsz)
rt_free(pipe);
return RT_NULL;
}
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
dev->fops = (void*)&pipe_fops;
#endif
@@ -529,7 +529,7 @@ int rt_pipe_delete(const char *name)
return result;
}
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
int pipe(int fildes[2])
{
rt_pipe_t *pipe;
@@ -575,4 +575,4 @@ int mkfifo(const char *path, mode_t mode)
return 0;
}
-#endif
+#endif /* RT_USING_POSIX_DEVIO */
diff --git a/components/libc/compilers/common/sys/ioctl.h b/components/libc/compilers/common/sys/ioctl.h
index 04f73837bc..29ed3a8b84 100644
--- a/components/libc/compilers/common/sys/ioctl.h
+++ b/components/libc/compilers/common/sys/ioctl.h
@@ -11,9 +11,7 @@
#define _SYS_IOCTL_H
#include <rtconfig.h>
-#ifdef RT_USING_POSIX
#include <dfs_posix.h>
-#endif
#ifdef _WIN32
#include <winsock.h>
diff --git a/components/libc/posix/aio/SConscript b/components/libc/posix/aio/SConscript
index 445efaade5..139bc45749 100644
--- a/components/libc/posix/aio/SConscript
+++ b/components/libc/posix/aio/SConscript
@@ -6,6 +6,6 @@ cwd = GetCurrentDir()
src = Glob('*.c')
CPPPATH = [cwd]
-group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX', 'RT_USING_POSIX_AIO'], CPPPATH = CPPPATH)
+group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX_AIO'], CPPPATH = CPPPATH)
Return('group')
diff --git a/components/libc/posix/src/libc.c b/components/libc/posix/src/libc.c
index 068719d5d6..c324d84ef8 100644
--- a/components/libc/posix/src/libc.c
+++ b/components/libc/posix/src/libc.c
@@ -23,7 +23,7 @@
int libc_system_init(void)
{
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
rt_device_t dev_console;
dev_console = rt_console_get_device();
@@ -31,7 +31,7 @@ int libc_system_init(void)
{
libc_stdio_set_console(dev_console->parent.name, O_RDWR);
}
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
#if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
pthread_system_init();
@@ -41,8 +41,7 @@ int libc_system_init(void)
}
INIT_COMPONENT_EXPORT(libc_system_init);
-#ifdef RT_USING_POSIX
-
+#ifdef RT_USING_POSIX_DEVIO
#if defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB)
#define STDIO_DEVICE_NAME_MAX 32
static FILE* std_console = NULL;
@@ -145,4 +144,4 @@ int libc_stdio_get_console(void) {
return std_fd;
}
#endif /* defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB) */
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
diff --git a/components/libc/posix/src/libc.h b/components/libc/posix/src/libc.h
index f81380bf78..b019267926 100644
--- a/components/libc/posix/src/libc.h
+++ b/components/libc/posix/src/libc.h
@@ -17,10 +17,10 @@ extern "C" {
#endif
int libc_system_init(void);
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
int libc_stdio_get_console(void);
int libc_stdio_set_console(const char* device_name, int mode);
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
#ifdef __cplusplus
}
diff --git a/components/libc/posix/termios/SConscript b/components/libc/posix/termios/SConscript
index bd9a528461..3615926251 100644
--- a/components/libc/posix/termios/SConscript
+++ b/components/libc/posix/termios/SConscript
@@ -6,8 +6,6 @@ cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp')
CPPPATH = [cwd]
-group = DefineGroup('POSIX', src,
- depend = ['RT_USING_LIBC', 'RT_USING_POSIX', 'RT_USING_POSIX_TERMIOS'],
- CPPPATH = CPPPATH)
+group = DefineGroup('POSIX', src, depend = ['RT_USING_LIBC', 'RT_USING_POSIX_TERMIOS'], CPPPATH = CPPPATH)
Return('group')
diff --git a/components/utilities/rt-link/src/rtlink_dev.c b/components/utilities/rt-link/src/rtlink_dev.c
index efebf37565..e91736251d 100644
--- a/components/utilities/rt-link/src/rtlink_dev.c
+++ b/components/utilities/rt-link/src/rtlink_dev.c
@@ -19,7 +19,7 @@
#define RTLINK_SERV(dev) (((struct rt_link_device*)dev)->service)
-#ifdef RT_USING_POSIX
+#ifdef RT_USING_POSIX_DEVIO
#include <dfs_posix.h>
#include <poll.h>
@@ -148,7 +148,7 @@ const static struct dfs_file_ops _rtlink_fops =
RT_NULL, /* getdents */
rtlink_fops_poll,
};
-#endif /* RT_USING_POSIX */
+#endif /* RT_USING_POSIX_DEVIO */
/* The event type for the service channel number,
* which is used to wake up the service thread in blocking receive mode */
@@ -386,7 +386,7 @@ rt_err_t rt_link_dev_register(struct rt_link_device *rtlink,
/* register a character device */
ret = rt_device_register(device, name, flag);
-#if defined(RT_USING_POSIX)
+#ifdef RT_USING_POSIX_DEVIO
/* set fops */
device->fops = &_rtlink_fops;
#endif