From 6ee8244a19b362299412c87cabf092dc793c366e Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Wed, 2 Sep 2015 11:23:23 +0800 Subject: [PATCH 1/6] [lwIP] export more symbols --- components/net/lwip-1.4.1/src/arch/sys_arch.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/net/lwip-1.4.1/src/arch/sys_arch.c b/components/net/lwip-1.4.1/src/arch/sys_arch.c index 287c861f04..d3a69f9ac3 100644 --- a/components/net/lwip-1.4.1/src/arch/sys_arch.c +++ b/components/net/lwip-1.4.1/src/arch/sys_arch.c @@ -695,3 +695,17 @@ RTM_EXPORT(dhcp_stop); #include RTM_EXPORT(netifapi_netif_set_addr); #endif + +#if LWIP_NETIF_LINK_CALLBACK +RTM_EXPORT(netif_set_link_callback); +#endif + +#if LWIP_NETIF_STATUS_CALLBACK +RTM_EXPORT(netif_set_status_callback); +#endif + +RTM_EXPORT(netif_find); +RTM_EXPORT(netif_set_addr); +RTM_EXPORT(netif_set_ipaddr); +RTM_EXPORT(netif_set_gw); +RTM_EXPORT(netif_set_netmask); From 340a013f53be4c9081ab2079b3734f79447fc766 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Wed, 2 Sep 2015 11:24:41 +0800 Subject: [PATCH 2/6] [finsh] export system symbol --- components/finsh/msh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/finsh/msh.c b/components/finsh/msh.c index 02cbeea196..6d747b40db 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -253,6 +253,7 @@ int system(const char *command) { return msh_exec_module(command, rt_strlen(command)); } +RTM_EXPORT(system); #endif static int _msh_exec_cmd(char* cmd, rt_size_t length, int *retp) From 8d309a40f5c4b33c8f398fe31c8559f1132e4fd2 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Wed, 2 Sep 2015 12:06:40 +0800 Subject: [PATCH 3/6] [BSP] Add copyright information. --- bsp/stm32f7-disco/applications/application.c | 18 +++++++++++--- bsp/stm32f7-disco/applications/sram.c | 26 ++++++++++++++------ bsp/stm32f7-disco/applications/startup.c | 18 +++++++++++--- bsp/stm32f7-disco/drivers/board.c | 18 +++++++++++--- bsp/stm32f7-disco/drivers/drv_led.c | 16 +++++++++--- bsp/stm32f7-disco/drivers/drv_mpu.c | 24 ++++++++++++++++++ bsp/stm32f7-disco/drivers/drv_sdram.c | 18 +++++++++++--- bsp/stm32f7-disco/drivers/drv_usart.c | 20 +++++++++++---- 8 files changed, 126 insertions(+), 32 deletions(-) diff --git a/bsp/stm32f7-disco/applications/application.c b/bsp/stm32f7-disco/applications/application.c index 3ec2855020..c8491a53f9 100644 --- a/bsp/stm32f7-disco/applications/application.c +++ b/bsp/stm32f7-disco/applications/application.c @@ -1,11 +1,21 @@ /* * File : application.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006, RT-Thread Development Team + * COPYRIGHT (C) 2015, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/stm32f7-disco/applications/sram.c b/bsp/stm32f7-disco/applications/sram.c index 29c4ad1dc2..a00295aa35 100644 --- a/bsp/stm32f7-disco/applications/sram.c +++ b/bsp/stm32f7-disco/applications/sram.c @@ -1,13 +1,23 @@ /* * File : sram.c -* This file is part of RT-Thread RTOS -* COPYRIGHT (C) 2015 RT-Thread Develop Team -* -* The license and distribution terms for this file may be -* found in the file LICENSE in this distribution or at -* http://www.rt-thread.org/license/LICENSE -* -* Change Logs: + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2015, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: * Date Author Notes * 2015-08-03 xiaonong The first version for STM32F7 */ diff --git a/bsp/stm32f7-disco/applications/startup.c b/bsp/stm32f7-disco/applications/startup.c index 8cd4dbe75c..1ac9176778 100644 --- a/bsp/stm32f7-disco/applications/startup.c +++ b/bsp/stm32f7-disco/applications/startup.c @@ -1,11 +1,21 @@ /* * File : startup.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2015, RT-Thread Develop Team + * COPYRIGHT (C) 2015, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://openlab.rt-thread.com/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/stm32f7-disco/drivers/board.c b/bsp/stm32f7-disco/drivers/board.c index 1dec971ca0..4d5c0d6164 100644 --- a/bsp/stm32f7-disco/drivers/board.c +++ b/bsp/stm32f7-disco/drivers/board.c @@ -1,11 +1,21 @@ /* * File : board.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2015 RT-Thread Develop Team + * COPYRIGHT (C) 2015, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/stm32f7-disco/drivers/drv_led.c b/bsp/stm32f7-disco/drivers/drv_led.c index 81c34bfc83..a58c5f3b6b 100644 --- a/bsp/stm32f7-disco/drivers/drv_led.c +++ b/bsp/stm32f7-disco/drivers/drv_led.c @@ -3,9 +3,19 @@ * This file is part of RT-Thread RTOS * COPYRIGHT (C) 2015, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/stm32f7-disco/drivers/drv_mpu.c b/bsp/stm32f7-disco/drivers/drv_mpu.c index cf457ee2eb..284887846e 100644 --- a/bsp/stm32f7-disco/drivers/drv_mpu.c +++ b/bsp/stm32f7-disco/drivers/drv_mpu.c @@ -1,3 +1,27 @@ +/* + * File : drv_mpu.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2015, RT-Thread Development Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Change Logs: + * Date Author Notes + * 2015-08-01 xiaonong the first version for stm32f7xx + */ + #include "drv_mpu.h" diff --git a/bsp/stm32f7-disco/drivers/drv_sdram.c b/bsp/stm32f7-disco/drivers/drv_sdram.c index 335a53d04d..fd61b83ae7 100644 --- a/bsp/stm32f7-disco/drivers/drv_sdram.c +++ b/bsp/stm32f7-disco/drivers/drv_sdram.c @@ -1,11 +1,21 @@ /* * File : drv_sdram.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2015 RT-Thread Develop Team + * COPYRIGHT (C) 2015, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes diff --git a/bsp/stm32f7-disco/drivers/drv_usart.c b/bsp/stm32f7-disco/drivers/drv_usart.c index 140b1c2beb..58e25ba395 100644 --- a/bsp/stm32f7-disco/drivers/drv_usart.c +++ b/bsp/stm32f7-disco/drivers/drv_usart.c @@ -1,11 +1,21 @@ /* - * File : usart.c + * File : drv_usart.c * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2009, RT-Thread Development Team + * COPYRIGHT (C) 2015, RT-Thread Development Team * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rt-thread.org/license/LICENSE + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Change Logs: * Date Author Notes From df0c6a9e3a6736c7fd3dcc002e8a7ebf8ef50afe Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Wed, 2 Sep 2015 12:07:09 +0800 Subject: [PATCH 4/6] [BSP] fix LIBC options in stm32f7 rtconfig.h --- bsp/stm32f7-disco/rtconfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/stm32f7-disco/rtconfig.h b/bsp/stm32f7-disco/rtconfig.h index 8abaf29921..64bd443678 100644 --- a/bsp/stm32f7-disco/rtconfig.h +++ b/bsp/stm32f7-disco/rtconfig.h @@ -114,7 +114,7 @@ //
// -#define RT_USING_NEWLIB +#define RT_USING_LIBC // //#define RT_USING_PTHREADS //
From 1079727afbe7c0f0afa9eff629b8afe7d7266fda Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Wed, 2 Sep 2015 12:07:58 +0800 Subject: [PATCH 5/6] [finsh] Add .name section for exported cmd and variables. --- components/finsh/finsh.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/finsh/finsh.h b/components/finsh/finsh.h index d134422aa9..4f3a887bc3 100644 --- a/components/finsh/finsh.h +++ b/components/finsh/finsh.h @@ -229,8 +229,8 @@ struct finsh_sysvar* finsh_sysvar_lookup(const char* name); #else #define FINSH_FUNCTION_EXPORT_CMD(name, cmd, desc) \ - const char __fsym_##cmd##_name[] = #cmd; \ - const char __fsym_##cmd##_desc[] = #desc; \ + const char __fsym_##cmd##_name[] SECTION(".name") = #cmd; \ + const char __fsym_##cmd##_desc[] SECTION(".name") = #desc; \ const struct finsh_syscall __fsym_##cmd SECTION("FSymTab")= \ { \ __fsym_##cmd##_name, \ @@ -239,8 +239,8 @@ struct finsh_sysvar* finsh_sysvar_lookup(const char* name); }; #define FINSH_VAR_EXPORT(name, type, desc) \ - const char __vsym_##name##_name[] = #name; \ - const char __vsym_##name##_desc[] = #desc; \ + const char __vsym_##name##_name[] SECTION(".name") = #name; \ + const char __vsym_##name##_desc[] SECTION(".name") = #desc; \ const struct finsh_sysvar __vsym_##name SECTION("VSymTab")= \ { \ __vsym_##name##_name, \ From dc194cd7b6ff8a0c4ac91ab76b32e3581b67f1f3 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Wed, 2 Sep 2015 12:09:46 +0800 Subject: [PATCH 6/6] [Kernel] Add .name section for exported symbols. --- include/rtm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rtm.h b/include/rtm.h index 6df77cfc5a..e888153a14 100644 --- a/include/rtm.h +++ b/include/rtm.h @@ -42,7 +42,7 @@ __declspec(allocate("RTMSymTab$f"))const char __rtmsym_##symbol##_name[] = "__vs #else #define RTM_EXPORT(symbol) \ -const char __rtmsym_##symbol##_name[] = #symbol; \ +const char __rtmsym_##symbol##_name[] SECTION(".name") = #symbol; \ const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \ { \ (void *)&symbol, \