From efe4523132169a4f28b84b1820a1a71d35118965 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Thu, 30 Aug 2018 20:27:45 +0800 Subject: [Kernel] move module tolibc/libdl. --- include/rtthread.h | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'include/rtthread.h') diff --git a/include/rtthread.h b/include/rtthread.h index 86a1664f83..4114866f6f 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -442,44 +442,6 @@ rt_err_t rt_device_control(rt_device_t dev, int cmd, void *arg); /**@}*/ #endif -#ifdef RT_USING_MODULE -/** - * @addtogroup Module - */ - -/**@{*/ - -/* - * module interface - */ -rt_module_t rt_module_load(const char *name, void *module_ptr); -rt_err_t rt_module_unload(rt_module_t module); -#ifdef RT_USING_DFS -rt_module_t rt_module_open(const char *filename); -rt_module_t rt_module_exec_cmd(const char *path, const char *cmd_line, int size); -#endif -void *rt_module_malloc(rt_size_t size); -void *rt_module_realloc(void *ptr, rt_size_t size); -void rt_module_free(rt_module_t module, void *addr); -rt_module_t rt_module_self(void); -rt_module_t rt_module_find(const char *name); - -#ifdef RT_USING_HOOK -void rt_module_load_sethook(void (*hook)(rt_module_t module)); -void rt_module_unload_sethook(void (*hook)(rt_module_t module)); -#endif - -void rt_module_init_object_container(struct rt_module *module); -rt_err_t rt_module_destroy(rt_module_t module); - -/* - * application module system initialization - */ -int rt_system_module_init(void); - -/**@}*/ -#endif - /* * interrupt service */ -- cgit v1.3.1 From 41f7f2c28411472cf99cdedf0abaaab823ba185f Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Fri, 14 Sep 2018 22:37:43 +0800 Subject: [Kernel] Update to Apache License v2.0 Update license for RT-Thread kernel. --- include/libc/libc_dirent.h | 6 ++++++ include/libc/libc_errno.h | 22 ++++++---------------- include/libc/libc_fcntl.h | 22 ++++++---------------- include/libc/libc_fdset.h | 22 ++++++---------------- include/libc/libc_ioctl.h | 22 ++++++---------------- include/libc/libc_signal.h | 22 ++++++---------------- include/libc/libc_stat.h | 6 ++++++ include/rtdbg.h | 22 ++++++---------------- include/rtdebug.h | 22 ++++++---------------- include/rtdef.h | 23 +++++++---------------- include/rthw.h | 22 ++++++---------------- include/rtlibc.h | 22 ++++++---------------- include/rtm.h | 22 ++++++---------------- include/rtservice.h | 22 ++++++---------------- include/rtthread.h | 22 ++++++---------------- src/clock.c | 21 ++++++--------------- src/components.c | 22 ++++++---------------- src/device.c | 22 ++++++---------------- src/idle.c | 22 ++++++---------------- src/ipc.c | 22 ++++++---------------- src/irq.c | 22 ++++++---------------- src/kservice.c | 22 ++++++---------------- src/mem.c | 22 ++++++---------------- src/memheap.c | 22 ++++++---------------- src/mempool.c | 22 ++++++---------------- src/object.c | 22 ++++++---------------- src/scheduler.c | 22 ++++++---------------- src/signal.c | 22 ++++++---------------- src/slab.c | 22 ++++++---------------- src/thread.c | 22 ++++++---------------- src/timer.c | 22 ++++++---------------- 31 files changed, 187 insertions(+), 463 deletions(-) (limited to 'include/rtthread.h') diff --git a/include/libc/libc_dirent.h b/include/libc/libc_dirent.h index 5bcbc32478..c3a19878ec 100644 --- a/include/libc/libc_dirent.h +++ b/include/libc/libc_dirent.h @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef LIBC_DIRENT_H__ #define LIBC_DIRENT_H__ diff --git a/include/libc/libc_errno.h b/include/libc/libc_errno.h index b4f4410595..82ae8cf943 100644 --- a/include/libc/libc_errno.h +++ b/include/libc/libc_errno.h @@ -1,21 +1,11 @@ /* - * File : libc_errno.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2017, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : libc_errno.h * * Change Logs: * Date Author Notes diff --git a/include/libc/libc_fcntl.h b/include/libc/libc_fcntl.h index 7c5a075a97..1b7c69b1f4 100644 --- a/include/libc/libc_fcntl.h +++ b/include/libc/libc_fcntl.h @@ -1,21 +1,11 @@ /* - * File : libc_fcntl.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2017 - 2018, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : libc_fcntl.h * * Change Logs: * Date Author Notes diff --git a/include/libc/libc_fdset.h b/include/libc/libc_fdset.h index 74c4ba1cb2..ecd965cd22 100644 --- a/include/libc/libc_fdset.h +++ b/include/libc/libc_fdset.h @@ -1,21 +1,11 @@ /* - * File : libc_errno.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2017, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : libc_errno.h * * Change Logs: * Date Author Notes diff --git a/include/libc/libc_ioctl.h b/include/libc/libc_ioctl.h index b61866a524..ef5a5257a8 100644 --- a/include/libc/libc_ioctl.h +++ b/include/libc/libc_ioctl.h @@ -1,21 +1,11 @@ /* - * File : libc_ioctl.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2017, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : libc_ioctl.h * * Change Logs: * Date Author Notes diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index d3050bfb54..5db43eb35e 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -1,21 +1,11 @@ /* - * File : libc_signal.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2017, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : libc_signal.h * * Change Logs: * Date Author Notes diff --git a/include/libc/libc_stat.h b/include/libc/libc_stat.h index 26752393db..9079d1ef15 100644 --- a/include/libc/libc_stat.h +++ b/include/libc/libc_stat.h @@ -1,3 +1,9 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + */ + #ifndef LIBC_STAT_H__ #define LIBC_STAT_H__ diff --git a/include/rtdbg.h b/include/rtdbg.h index 911a0d8fc9..da4eb48303 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -1,21 +1,11 @@ /* - * File : rtdbg.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2016, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtdbg.h * * Change Logs: * Date Author Notes diff --git a/include/rtdebug.h b/include/rtdebug.h index e403d51e06..48f8d2392a 100644 --- a/include/rtdebug.h +++ b/include/rtdebug.h @@ -1,21 +1,11 @@ /* - * File : rtdebug.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2018, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtdebug.h */ #ifndef __RTDEBUG_H__ diff --git a/include/rtdef.h b/include/rtdef.h index 03871d1fcc..9379a7db44 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -1,21 +1,11 @@ /* - * File : rtdef.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2018, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtdef.h * * Change Logs: * Date Author Notes @@ -37,6 +27,7 @@ * 2018-04-25 Bernard change version number to v3.0.4 * 2018-05-31 Bernard change version number to v3.1.0 * 2018-09-04 Bernard change version number to v3.1.1 + * 2018-09-14 Bernard apply Apache License v2.0 to RT-Thread Kernel */ #ifndef __RT_DEF_H__ diff --git a/include/rthw.h b/include/rthw.h index d517228083..8473854538 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -1,21 +1,11 @@ /* - * File : rthw.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rthw.h * * Change Logs: * Date Author Notes diff --git a/include/rtlibc.h b/include/rtlibc.h index db5236edb1..385d57500e 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -1,21 +1,11 @@ /* - * File : rtlibc.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2017, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtlibc.h * * Change Logs: * Date Author Notes diff --git a/include/rtm.h b/include/rtm.h index 05419e4420..08ad721baf 100644 --- a/include/rtm.h +++ b/include/rtm.h @@ -1,21 +1,11 @@ /* - * File : rtm.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtm.h */ #ifndef __RTM_H__ diff --git a/include/rtservice.h b/include/rtservice.h index 77a21d1f97..145a225ace 100644 --- a/include/rtservice.h +++ b/include/rtservice.h @@ -1,21 +1,11 @@ /* - * File : rtservice.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtservice.h * * Change Logs: * Date Author Notes diff --git a/include/rtthread.h b/include/rtthread.h index 4114866f6f..82d975d648 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -1,21 +1,11 @@ /* - * File : rtthread.h - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : rtthread.h * * Change Logs: * Date Author Notes diff --git a/src/clock.c b/src/clock.c index 734c0d5014..9834f0f95c 100644 --- a/src/clock.c +++ b/src/clock.c @@ -1,21 +1,12 @@ /* - * File : clock.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 * - * 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. + */ + +/* + * File : clock.c * * Change Logs: * Date Author Notes diff --git a/src/components.c b/src/components.c index 818e570b3c..410b20be93 100644 --- a/src/components.c +++ b/src/components.c @@ -1,21 +1,11 @@ /* - * File : init.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2012 - 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : init.c * * Change Logs: * Date Author Notes diff --git a/src/device.c b/src/device.c index 0b662ae620..94f550d682 100644 --- a/src/device.c +++ b/src/device.c @@ -1,21 +1,11 @@ /* - * File : device.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2013, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : device.c * * Change Logs: * Date Author Notes diff --git a/src/idle.c b/src/idle.c index 1aca33d3e4..8a4734ab49 100644 --- a/src/idle.c +++ b/src/idle.c @@ -1,21 +1,11 @@ /* - * File : idle.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : idle.c * * Change Logs: * Date Author Notes diff --git a/src/ipc.c b/src/ipc.c index b1a5dbe402..d2a3ba766c 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -1,21 +1,11 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + */ + /* * File : ipc.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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 diff --git a/src/irq.c b/src/irq.c index 9b933e3960..98a6fd3a04 100644 --- a/src/irq.c +++ b/src/irq.c @@ -1,21 +1,11 @@ /* - * File : irq.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : irq.c * * Change Logs: * Date Author Notes diff --git a/src/kservice.c b/src/kservice.c index 35444aa248..a31e5a6f93 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -1,21 +1,11 @@ /* - * File : kservice.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : kservice.c * * Change Logs: * Date Author Notes diff --git a/src/mem.c b/src/mem.c index 324a5f8f64..03e6f34eb4 100644 --- a/src/mem.c +++ b/src/mem.c @@ -1,21 +1,11 @@ /* - * File : mem.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2008 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : mem.c * * Change Logs: * Date Author Notes diff --git a/src/memheap.c b/src/memheap.c index de637f2685..946f163b64 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -1,21 +1,11 @@ /* - * File : memheap.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : memheap.c * * Change Logs: * Date Author Notes diff --git a/src/mempool.c b/src/mempool.c index cd98e8c14e..e1af7d9e42 100644 --- a/src/mempool.c +++ b/src/mempool.c @@ -1,21 +1,11 @@ /* - * File : mempool.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : mempool.c * * Change Logs: * Date Author Notes diff --git a/src/object.c b/src/object.c index e9a2b99246..8dcfb2e57e 100644 --- a/src/object.c +++ b/src/object.c @@ -1,21 +1,11 @@ /* - * File : object.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : object.c * * Change Logs: * Date Author Notes diff --git a/src/scheduler.c b/src/scheduler.c index 1be1816bc2..8b5ffc9f4c 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -1,21 +1,11 @@ /* - * File : scheduler.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : scheduler.c * * Change Logs: * Date Author Notes diff --git a/src/signal.c b/src/signal.c index b2193957bc..6499d05a97 100644 --- a/src/signal.c +++ b/src/signal.c @@ -1,21 +1,11 @@ /* - * File : signal.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2017, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : signal.c * * Change Logs: * Date Author Notes diff --git a/src/slab.c b/src/slab.c index 16c68a2408..bf26c84cca 100644 --- a/src/slab.c +++ b/src/slab.c @@ -1,21 +1,11 @@ /* - * File : slab.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2008 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : slab.c * * Change Logs: * Date Author Notes diff --git a/src/thread.c b/src/thread.c index 7febf32082..249219b8aa 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1,21 +1,11 @@ +/* + * Copyright (c) 2006-2018, RT-Thread Development Team + * + * SPDX-License-Identifier: Apache-2.0 + */ + /* * File : thread.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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 diff --git a/src/timer.c b/src/timer.c index 042826f41b..01e6211e04 100644 --- a/src/timer.c +++ b/src/timer.c @@ -1,21 +1,11 @@ /* - * File : timer.c - * This file is part of RT-Thread RTOS - * COPYRIGHT (C) 2006 - 2012, 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. + * Copyright (c) 2006-2018, RT-Thread Development Team * - * 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. + * SPDX-License-Identifier: Apache-2.0 + */ + +/* + * File : timer.c * * Change Logs: * Date Author Notes -- cgit v1.3.1 From b98a0ba804f388f531106ff9602eb22ee66fe751 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 23 Sep 2018 12:08:44 +0800 Subject: [Kernel] Add ARMCC 6.x support. --- components/finsh/shell.c | 8 +++----- components/libc/compilers/armlibc/mem_std.c | 3 +++ components/libc/compilers/armlibc/stubs.c | 4 ++++ components/net/lwip-2.0.2/src/arch/include/arch/cc.h | 2 +- include/libc/libc_signal.h | 2 +- include/rtdef.h | 9 +++++++-- include/rtlibc.h | 2 +- include/rtthread.h | 2 +- libcpu/arm/cortex-m4/cpuport.c | 11 ++++++++--- libcpu/arm/cortex-m7/cpuport.c | 11 ++++++++--- src/components.c | 4 ++-- src/kservice.c | 2 +- 12 files changed, 40 insertions(+), 20 deletions(-) (limited to 'include/rtthread.h') diff --git a/components/finsh/shell.c b/components/finsh/shell.c index ccd5b97306..441f6c3241 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -55,7 +55,9 @@ static struct rt_thread finsh_thread; ALIGN(RT_ALIGN_SIZE) static char finsh_thread_stack[FINSH_THREAD_STACK_SIZE]; +struct finsh_shell _shell; #endif + struct finsh_shell *shell; static char *finsh_prompt_custom = RT_NULL; @@ -473,9 +475,6 @@ static void shell_push_history(struct finsh_shell *shell) } #endif -#ifndef RT_USING_HEAP -struct finsh_shell _shell; -#endif void finsh_thread_entry(void *parameter) { char ch; @@ -792,7 +791,7 @@ int finsh_system_init(void) rt_thread_t tid; #ifdef FINSH_USING_SYMTAB -#ifdef __CC_ARM /* ARM C Compiler */ +#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM C Compiler */ extern const int FSymTab$$Base; extern const int FSymTab$$Limit; extern const int VSymTab$$Base; @@ -867,4 +866,3 @@ int finsh_system_init(void) return 0; } INIT_APP_EXPORT(finsh_system_init); - diff --git a/components/libc/compilers/armlibc/mem_std.c b/components/libc/compilers/armlibc/mem_std.c index 138ebe9773..4393b5f2af 100644 --- a/components/libc/compilers/armlibc/mem_std.c +++ b/components/libc/compilers/armlibc/mem_std.c @@ -16,8 +16,11 @@ #include "rtthread.h" #ifdef RT_USING_HEAP + +#ifdef __CC_ARM /* avoid the heap and heap-using library functions supplied by arm */ #pragma import(__use_no_heap) +#endif void *malloc(size_t n) { diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index b292cd7629..c826c8a0ec 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -37,7 +37,11 @@ #include "dfs_posix.h" #endif +#ifdef __CLANG_ARM +__asm(".global __use_no_semihosting\n\t"); +#else #pragma import(__use_no_semihosting_swi) +#endif /* Standard IO device handles. */ #define STDIN 0 diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h index 1875d9ab00..77a589276a 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h @@ -46,7 +46,7 @@ #define X32_F "lx" #ifdef RT_USING_LIBC -#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) #include #else #include diff --git a/include/libc/libc_signal.h b/include/libc/libc_signal.h index 5db43eb35e..b592b8227e 100644 --- a/include/libc/libc_signal.h +++ b/include/libc/libc_signal.h @@ -71,7 +71,7 @@ typedef struct siginfo siginfo_t; #include #endif -#ifdef __CC_ARM +#if defined(__CC_ARM) || defined(__CLANG_ARM) #include typedef unsigned long sigset_t; diff --git a/include/rtdef.h b/include/rtdef.h index 9379a7db44..92b997151d 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -88,14 +88,19 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ #define RT_UINT32_MAX 0xffffffff /**< Maxium number of UINT32 */ #define RT_TICK_MAX RT_UINT32_MAX /**< Maxium number of tick */ +#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) +#define __CLANG_ARM +#endif + /* Compiler Related Definitions */ -#ifdef __CC_ARM /* ARM Compiler */ +#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM Compiler */ #include #define SECTION(x) __attribute__((section(x))) #define RT_UNUSED __attribute__((unused)) #define RT_USED __attribute__((used)) #define ALIGN(n) __attribute__((aligned(n))) - #define RT_WEAK __weak + + #define RT_WEAK __attribute__((weak)) #define rt_inline static __inline /* module compiling */ #ifdef RT_USING_MODULE diff --git a/include/rtlibc.h b/include/rtlibc.h index 385d57500e..020c34764e 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -25,7 +25,7 @@ #include "libc/libc_signal.h" #include "libc/libc_fdset.h" -#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) typedef signed long off_t; typedef int mode_t; #endif diff --git a/include/rtthread.h b/include/rtthread.h index 82d975d648..f8da2d46bf 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -501,7 +501,7 @@ rt_int32_t rt_strncmp(const char *cs, const char *ct, rt_ubase_t count); rt_int32_t rt_strcmp(const char *cs, const char *ct); rt_size_t rt_strlen(const char *src); char *rt_strdup(const char *s); -#ifdef __CC_ARM +#if defined(__CC_ARM) || defined(__CLANG_ARM) /* leak strdup interface */ char* strdup(const char* str); #endif diff --git a/libcpu/arm/cortex-m4/cpuport.c b/libcpu/arm/cortex-m4/cpuport.c index ed7102f844..1d2184c2d7 100644 --- a/libcpu/arm/cortex-m4/cpuport.c +++ b/libcpu/arm/cortex-m4/cpuport.c @@ -22,9 +22,14 @@ #include -#define USE_FPU /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ - /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ +#if /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* Clang */ || (defined ( __CLANG_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ /* GNU */ || (defined ( __GNUC__ ) && defined ( __VFP_FP__ ) && !defined(__SOFTFP__)) ) +#define USE_FPU 1 +#else +#define USE_FPU 0 +#endif /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread; @@ -452,7 +457,7 @@ RT_WEAK void rt_hw_cpu_reset(void) * @return return the index of the first bit set. If value is 0, then this function * shall return 0. */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || defined(__CLANG_ARM) __asm int __rt_ffs(int value) { CMP r0, #0x00 diff --git a/libcpu/arm/cortex-m7/cpuport.c b/libcpu/arm/cortex-m7/cpuport.c index ed7102f844..1d2184c2d7 100644 --- a/libcpu/arm/cortex-m7/cpuport.c +++ b/libcpu/arm/cortex-m7/cpuport.c @@ -22,9 +22,14 @@ #include -#define USE_FPU /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ - /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ +#if /* ARMCC */ ( (defined ( __CC_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* Clang */ || (defined ( __CLANG_ARM ) && defined ( __TARGET_FPU_VFP )) \ + /* IAR */ || (defined ( __ICCARM__ ) && defined ( __ARMVFP__ )) \ /* GNU */ || (defined ( __GNUC__ ) && defined ( __VFP_FP__ ) && !defined(__SOFTFP__)) ) +#define USE_FPU 1 +#else +#define USE_FPU 0 +#endif /* exception and interrupt handler table */ rt_uint32_t rt_interrupt_from_thread; @@ -452,7 +457,7 @@ RT_WEAK void rt_hw_cpu_reset(void) * @return return the index of the first bit set. If value is 0, then this function * shall return 0. */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || defined(__CLANG_ARM) __asm int __rt_ffs(int value) { CMP r0, #0x00 diff --git a/src/components.c b/src/components.c index 410b20be93..09f0680b55 100644 --- a/src/components.c +++ b/src/components.c @@ -136,7 +136,7 @@ void rt_application_init(void); void rt_hw_board_init(void); int rtthread_startup(void); -#if defined (__CC_ARM) +#if defined(__CC_ARM) || defined(__CLANG_ARM) extern int $Super$$main(void); /* re-define main function */ int $Sub$$main(void) @@ -185,7 +185,7 @@ void main_thread_entry(void *parameter) rt_components_init(); /* invoke system main function */ -#if defined (__CC_ARM) +#if defined(__CC_ARM) || defined(__CLANG_ARM) $Super$$main(); /* for ARMCC. */ #elif defined(__ICCARM__) || defined(__GNUC__) main(); diff --git a/src/kservice.c b/src/kservice.c index a31e5a6f93..e10c093c70 100644 --- a/src/kservice.c +++ b/src/kservice.c @@ -525,7 +525,7 @@ char *rt_strdup(const char *s) return tmp; } RTM_EXPORT(rt_strdup); -#ifdef __CC_ARM +#if defined(__CC_ARM) || defined(__CLANG_ARM) char *strdup(const char *s) __attribute__((alias("rt_strdup"))); #endif #endif -- cgit v1.3.1 From 20bc91d25fd97b3136d26aa6339c6648db0e9e1c Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 14 Oct 2018 19:38:52 +0800 Subject: [license] Change license to Apache. --- include/rtdbg.h | 4 ---- include/rtdebug.h | 4 ---- include/rtdef.h | 4 ---- include/rthw.h | 4 ---- include/rtlibc.h | 4 ---- include/rtm.h | 4 ---- include/rtservice.h | 4 ---- include/rtthread.h | 4 ---- 8 files changed, 32 deletions(-) (limited to 'include/rtthread.h') diff --git a/include/rtdbg.h b/include/rtdbg.h index da4eb48303..d19a191227 100644 --- a/include/rtdbg.h +++ b/include/rtdbg.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : rtdbg.h * * Change Logs: * Date Author Notes diff --git a/include/rtdebug.h b/include/rtdebug.h index 48f8d2392a..b66cd6fc69 100644 --- a/include/rtdebug.h +++ b/include/rtdebug.h @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * File : rtdebug.h - */ - #ifndef __RTDEBUG_H__ #define __RTDEBUG_H__ diff --git a/include/rtdef.h b/include/rtdef.h index 92b997151d..deb3295e27 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : rtdef.h * * Change Logs: * Date Author Notes diff --git a/include/rthw.h b/include/rthw.h index 8473854538..c6af392e62 100644 --- a/include/rthw.h +++ b/include/rthw.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : rthw.h * * Change Logs: * Date Author Notes diff --git a/include/rtlibc.h b/include/rtlibc.h index 020c34764e..b3a548beb1 100644 --- a/include/rtlibc.h +++ b/include/rtlibc.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : rtlibc.h * * Change Logs: * Date Author Notes diff --git a/include/rtm.h b/include/rtm.h index 08ad721baf..7e07a2239c 100644 --- a/include/rtm.h +++ b/include/rtm.h @@ -4,10 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ -/* - * File : rtm.h - */ - #ifndef __RTM_H__ #define __RTM_H__ diff --git a/include/rtservice.h b/include/rtservice.h index 145a225ace..3b6fc94c92 100644 --- a/include/rtservice.h +++ b/include/rtservice.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : rtservice.h * * Change Logs: * Date Author Notes diff --git a/include/rtthread.h b/include/rtthread.h index f8da2d46bf..fc5029a220 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -2,10 +2,6 @@ * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * File : rtthread.h * * Change Logs: * Date Author Notes -- cgit v1.3.1 From d343c6578a0c12c4bdc98e7634907fb9779ba0d7 Mon Sep 17 00:00:00 2001 From: guozhanxin Date: Tue, 13 Nov 2018 11:32:01 +0800 Subject: [kernel]Change 'rt_timer_timeout_hook' function to 'rt_timer_enter_hook' and add 'rt_timer_exit_hook' hook function. --- include/rtthread.h | 3 ++- src/timer.c | 28 +++++++++++++++++++++------- 2 files changed, 23 insertions(+), 8 deletions(-) (limited to 'include/rtthread.h') diff --git a/include/rtthread.h b/include/rtthread.h index fc5029a220..96ebe1940a 100644 --- a/include/rtthread.h +++ b/include/rtthread.h @@ -100,7 +100,8 @@ rt_tick_t rt_timer_next_timeout_tick(void); void rt_timer_check(void); #ifdef RT_USING_HOOK -void rt_timer_timeout_sethook(void (*hook)(struct rt_timer *timer)); +void rt_timer_enter_sethook(void (*hook)(struct rt_timer *timer)); +void rt_timer_exit_sethook(void (*hook)(struct rt_timer *timer)); #endif /**@}*/ diff --git a/src/timer.c b/src/timer.c index dc489a2d0d..fd938065db 100644 --- a/src/timer.c +++ b/src/timer.c @@ -43,7 +43,8 @@ static rt_uint8_t timer_thread_stack[RT_TIMER_THREAD_STACK_SIZE]; #ifdef RT_USING_HOOK extern void (*rt_object_take_hook)(struct rt_object *object); extern void (*rt_object_put_hook)(struct rt_object *object); -static void (*rt_timer_timeout_hook)(struct rt_timer *timer); +static void (*rt_timer_enter_hook)(struct rt_timer *timer); +static void (*rt_timer_exit_hook)(struct rt_timer *timer); /** * @addtogroup Hook @@ -52,14 +53,25 @@ static void (*rt_timer_timeout_hook)(struct rt_timer *timer); /**@{*/ /** - * This function will set a hook function, which will be invoked when timer - * is timeout. + * This function will set a hook function, which will be invoked when enter + * timer timeout callback function. * * @param hook the hook function */ -void rt_timer_timeout_sethook(void (*hook)(struct rt_timer *timer)) +void rt_timer_enter_sethook(void (*hook)(struct rt_timer *timer)) { - rt_timer_timeout_hook = hook; + rt_timer_enter_hook = hook; +} + +/** + * This function will set a hook function, which will be invoked when exit + * timer timeout callback function. + * + * @param hook the hook function + */ +void rt_timer_exit_sethook(void (*hook)(struct rt_timer *timer)) +{ + rt_timer_exit_hook = hook; } /**@}*/ @@ -503,7 +515,7 @@ void rt_timer_check(void) */ if ((current_tick - t->timeout_tick) < RT_TICK_MAX / 2) { - RT_OBJECT_HOOK_CALL(rt_timer_timeout_hook, (t)); + RT_OBJECT_HOOK_CALL(rt_timer_enter_hook, (t)); /* remove timer from timer list firstly */ _rt_timer_remove(t); @@ -514,6 +526,7 @@ void rt_timer_check(void) /* re-get tick */ current_tick = rt_tick_get(); + RT_OBJECT_HOOK_CALL(rt_timer_exit_hook, (t)); RT_DEBUG_LOG(RT_DEBUG_TIMER, ("current tick: %d\n", current_tick)); if ((t->parent.flag & RT_TIMER_FLAG_PERIODIC) && @@ -578,7 +591,7 @@ void rt_soft_timer_check(void) */ if ((current_tick - t->timeout_tick) < RT_TICK_MAX / 2) { - RT_OBJECT_HOOK_CALL(rt_timer_timeout_hook, (t)); + RT_OBJECT_HOOK_CALL(rt_timer_enter_hook, (t)); /* move node to the next */ n = n->next; @@ -594,6 +607,7 @@ void rt_soft_timer_check(void) /* re-get tick */ current_tick = rt_tick_get(); + RT_OBJECT_HOOK_CALL(rt_timer_exit_hook, (t)); RT_DEBUG_LOG(RT_DEBUG_TIMER, ("current tick: %d\n", current_tick)); /* lock scheduler */ -- cgit v1.3.1