From 44ad3d1cb96912a6397ceec39903a4d8c83253ea Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 24 Sep 2015 20:46:59 +0800 Subject: [PATCH 1/4] [DeviceDrivers] Remove open_flag assertion. --- components/drivers/serial/serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/components/drivers/serial/serial.c b/components/drivers/serial/serial.c index f5a199e10..3bae89c74 100644 --- a/components/drivers/serial/serial.c +++ b/components/drivers/serial/serial.c @@ -522,12 +522,10 @@ void rt_hw_serial_isr(struct rt_serial_device *serial, int event) rt_base_t level; struct rt_serial_rx_fifo* rx_fifo; + /* interrupt mode receive */ rx_fifo = (struct rt_serial_rx_fifo*)serial->serial_rx; RT_ASSERT(rx_fifo != RT_NULL); - - /* interrupt mode receive */ - RT_ASSERT(serial->parent.open_flag & RT_DEVICE_FLAG_INT_RX); - + while (1) { ch = serial->ops->getc(serial); From cfbe17681ede262c607508ff62676d90b15c8ef8 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 24 Sep 2015 20:58:30 +0800 Subject: [PATCH 2/4] [external] fix the VC++ simulation issue for lodepng. --- components/external/lodepng/SConscript | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/external/lodepng/SConscript b/components/external/lodepng/SConscript index fd05e1013..55d6d01d3 100644 --- a/components/external/lodepng/SConscript +++ b/components/external/lodepng/SConscript @@ -1,4 +1,5 @@ from building import * +import rtconfig cwd = GetCurrentDir() src = Split(''' @@ -7,6 +8,9 @@ lodepng.c CPPPATH = [cwd] -group = DefineGroup('RTGUI', src, depend = ['RT_USING_RTGUI', 'RTGUI_IMAGE_LODEPNG', 'RT_USING_LIBC'], CPPPATH = CPPPATH) +if rtconfig.ARCH == 'sim': + group = DefineGroup('RTGUI', src, depend = ['RT_USING_RTGUI', 'RTGUI_IMAGE_LODEPNG'], CPPPATH = CPPPATH) +else: + group = DefineGroup('RTGUI', src, depend = ['RT_USING_RTGUI', 'RTGUI_IMAGE_LODEPNG', 'RT_USING_LIBC'], CPPPATH = CPPPATH) Return('group') From 3dc91bf8abd9d17812c31378444de047b08233f7 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 24 Sep 2015 20:58:40 +0800 Subject: [PATCH 3/4] [finsh] Code cleanup. --- components/finsh/msh_cmd.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/finsh/msh_cmd.c b/components/finsh/msh_cmd.c index eb446f731..fc6b56cdd 100644 --- a/components/finsh/msh_cmd.c +++ b/components/finsh/msh_cmd.c @@ -297,8 +297,14 @@ FINSH_FUNCTION_EXPORT_ALIAS(cmd_netstat, __cmd_netstat, list the information of int cmd_ps(int argc, char** argv) { extern long list_thread(void); - - list_thread(); + extern int list_module(void); + +#ifdef RT_USING_MODULE + if ((argc == 2) && (strcmp(argv[1], "-m") == 0)) + list_module(); + else +#endif + list_thread(); return 0; } FINSH_FUNCTION_EXPORT_ALIAS(cmd_ps, __cmd_ps, List threads in the system.); From d0dcdd11fe6ed42b853fb7b4ef0e91163c5f50ee Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 24 Sep 2015 20:59:00 +0800 Subject: [PATCH 4/4] [Kernel] Export more symbols for module. --- src/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/module.c b/src/module.c index 0de93867c..b03611a4f 100644 --- a/src/module.c +++ b/src/module.c @@ -178,6 +178,7 @@ rt_module_t rt_module_self(void) /* return current module */ return (rt_module_t)tid->module_id; } +RTM_EXPORT(rt_module_self); static int rt_module_arm_relocate(struct rt_module *module, Elf32_Rel *rel, @@ -1563,6 +1564,7 @@ rt_module_t rt_module_find(const char *name) /* not found */ return RT_NULL; } +RTM_EXPORT(rt_module_find); #ifdef RT_USING_SLAB /*