提交 7a6a1e11 编写于 作者: armink_ztl's avatar armink_ztl

[Kernel] Sync to latest version.

上级 506866e8
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2018, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/
/*
* File : libc_errno.h
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
...@@ -17,145 +13,194 @@ ...@@ -17,145 +13,194 @@
#include <rtconfig.h> #include <rtconfig.h>
#if defined(RT_USING_NEWLIB) || defined(_WIN32) #if defined(RT_USING_NEWLIB) || defined(_WIN32) || defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
/* use errno.h file in newlib */ /* use errno.h file in toolchains */
#include <errno.h> #include <errno.h>
#endif
#if defined(__CC_ARM)
/*
defined in armcc/errno.h
#define EDOM 1
#define ERANGE 2
#define EILSEQ 4
#define ESIGNUM 3
#define EINVAL 5
#define ENOMEM 6
*/
#define ERROR_BASE_NO 7
#elif defined(__IAR_SYSTEMS_ICC__)
/* defined in iar/errno.h
#define EDOM 33
#define ERANGE 34
#define EFPOS 35
#define EILSEQ 36
*/
#define ERROR_BASE_NO 36
#else #else
/* define errno self. */
#define EPERM 1 #define ERROR_BASE_NO 0
#define ENOENT 2 #endif
#define ESRCH 3
#define EINTR 4 #if !defined(RT_USING_NEWLIB) && !defined(_WIN32)
#define EIO 5
#define ENXIO 6 #define EPERM (ERROR_BASE_NO + 1)
#define E2BIG 7 #define ENOENT (ERROR_BASE_NO + 2)
#define ENOEXEC 8 #define ESRCH (ERROR_BASE_NO + 3)
#define EBADF 9 #define EINTR (ERROR_BASE_NO + 4)
#define ECHILD 10 #define EIO (ERROR_BASE_NO + 5)
#define EAGAIN 11 #define ENXIO (ERROR_BASE_NO + 6)
#define ENOMEM 12 #define E2BIG (ERROR_BASE_NO + 7)
#define EACCES 13 #define ENOEXEC (ERROR_BASE_NO + 8)
#define EFAULT 14 #define EBADF (ERROR_BASE_NO + 9)
#define ENOTBLK 15 #define ECHILD (ERROR_BASE_NO + 10)
#define EBUSY 16 #define EAGAIN (ERROR_BASE_NO + 11)
#define EEXIST 17
#define EXDEV 18 #ifndef ENOMEM
#define ENODEV 19 #define ENOMEM (ERROR_BASE_NO + 12)
#define ENOTDIR 20 #endif
#define EISDIR 21
#define EINVAL 22 #define EACCES (ERROR_BASE_NO + 13)
#define ENFILE 23 #define EFAULT (ERROR_BASE_NO + 14)
#define EMFILE 24 #define ENOTBLK (ERROR_BASE_NO + 15)
#define ENOTTY 25 #define EBUSY (ERROR_BASE_NO + 16)
#define ETXTBSY 26 #define EEXIST (ERROR_BASE_NO + 17)
#define EFBIG 27 #define EXDEV (ERROR_BASE_NO + 18)
#define ENOSPC 28 #define ENODEV (ERROR_BASE_NO + 19)
#define ESPIPE 29 #define ENOTDIR (ERROR_BASE_NO + 20)
#define EROFS 30 #define EISDIR (ERROR_BASE_NO + 21)
#define EMLINK 31
#define EPIPE 32 #ifndef EINVAL
#define EDOM 33 #define EINVAL (ERROR_BASE_NO + 22)
#define ERANGE 34 #endif
#define EDEADLK 35
#define ENAMETOOLONG 36 #define ENFILE (ERROR_BASE_NO + 23)
#define ENOLCK 37 #define EMFILE (ERROR_BASE_NO + 24)
#define ENOSYS 38 #define ENOTTY (ERROR_BASE_NO + 25)
#define ENOTEMPTY 39 #define ETXTBSY (ERROR_BASE_NO + 26)
#define ELOOP 40 #define EFBIG (ERROR_BASE_NO + 27)
#define ENOSPC (ERROR_BASE_NO + 28)
#define ESPIPE (ERROR_BASE_NO + 29)
#define EROFS (ERROR_BASE_NO + 30)
#define EMLINK (ERROR_BASE_NO + 31)
#define EPIPE (ERROR_BASE_NO + 32)
#ifndef EDOM
#define EDOM (ERROR_BASE_NO + 33)
#endif
#ifndef ERANGE
#define ERANGE (ERROR_BASE_NO + 34)
#endif
#define EDEADLK (ERROR_BASE_NO + 35)
#define ENAMETOOLONG (ERROR_BASE_NO + 36)
#define ENOLCK (ERROR_BASE_NO + 37)
#define ENOSYS (ERROR_BASE_NO + 38)
#define ENOTEMPTY (ERROR_BASE_NO + 39)
#define ELOOP (ERROR_BASE_NO + 40)
#define EWOULDBLOCK EAGAIN #define EWOULDBLOCK EAGAIN
#define ENOMSG 42 #define ENOMSG (ERROR_BASE_NO + 42)
#define EIDRM 43 #define EIDRM (ERROR_BASE_NO + 43)
#define ECHRNG 44 #define ECHRNG (ERROR_BASE_NO + 44)
#define EL2NSYNC 45 #define EL2NSYNC (ERROR_BASE_NO + 45)
#define EL3HLT 46 #define EL3HLT (ERROR_BASE_NO + 46)
#define EL3RST 47 #define EL3RST (ERROR_BASE_NO + 47)
#define ELNRNG 48 #define ELNRNG (ERROR_BASE_NO + 48)
#define EUNATCH 49 #define EUNATCH (ERROR_BASE_NO + 49)
#define ENOCSI 50 #define ENOCSI (ERROR_BASE_NO + 50)
#define EL2HLT 51 #define EL2HLT (ERROR_BASE_NO + 51)
#define EBADE 52 #define EBADE (ERROR_BASE_NO + 52)
#define EBADR 53 #define EBADR (ERROR_BASE_NO + 53)
#define EXFULL 54 #define EXFULL (ERROR_BASE_NO + 54)
#define ENOANO 55 #define ENOANO (ERROR_BASE_NO + 55)
#define EBADRQC 56 #define EBADRQC (ERROR_BASE_NO + 56)
#define EBADSLT 57 #define EBADSLT (ERROR_BASE_NO + 57)
#define EDEADLOCK EDEADLK #define EDEADLOCK EDEADLK
#define EBFONT 59 #define EBFONT (ERROR_BASE_NO + 59)
#define ENOSTR 60 #define ENOSTR (ERROR_BASE_NO + 60)
#define ENODATA 61 #define ENODATA (ERROR_BASE_NO + 61)
#define ETIME 62 #define ETIME (ERROR_BASE_NO + 62)
#define ENOSR 63 #define ENOSR (ERROR_BASE_NO + 63)
#define ENONET 64 #define ENONET (ERROR_BASE_NO + 64)
#define ENOPKG 65 #define ENOPKG (ERROR_BASE_NO + 65)
#define EREMOTE 66 #define EREMOTE (ERROR_BASE_NO + 66)
#define ENOLINK 67 #define ENOLINK (ERROR_BASE_NO + 67)
#define EADV 68 #define EADV (ERROR_BASE_NO + 68)
#define ESRMNT 69 #define ESRMNT (ERROR_BASE_NO + 69)
#define ECOMM 70 #define ECOMM (ERROR_BASE_NO + 70)
#define EPROTO 71 #define EPROTO (ERROR_BASE_NO + 71)
#define EMULTIHOP 72 #define EMULTIHOP (ERROR_BASE_NO + 72)
#define EDOTDOT 73 #define EDOTDOT (ERROR_BASE_NO + 73)
#define EBADMSG 74 #define EBADMSG (ERROR_BASE_NO + 74)
#define EOVERFLOW 75 #define EOVERFLOW (ERROR_BASE_NO + 75)
#define ENOTUNIQ 76 #define ENOTUNIQ (ERROR_BASE_NO + 76)
#define EBADFD 77 #define EBADFD (ERROR_BASE_NO + 77)
#define EREMCHG 78 #define EREMCHG (ERROR_BASE_NO + 78)
#define ELIBACC 79 #define ELIBACC (ERROR_BASE_NO + 79)
#define ELIBBAD 80 #define ELIBBAD (ERROR_BASE_NO + 80)
#define ELIBSCN 81 #define ELIBSCN (ERROR_BASE_NO + 81)
#define ELIBMAX 82 #define ELIBMAX (ERROR_BASE_NO + 82)
#define ELIBEXEC 83 #define ELIBEXEC (ERROR_BASE_NO + 83)
#define EILSEQ 84
#define ERESTART 85 #ifndef EILSEQ
#define ESTRPIPE 86 #define EILSEQ (ERROR_BASE_NO + 84)
#define EUSERS 87 #endif
#define ENOTSOCK 88
#define EDESTADDRREQ 89 #define ERESTART (ERROR_BASE_NO + 85)
#define EMSGSIZE 90 #define ESTRPIPE (ERROR_BASE_NO + 86)
#define EPROTOTYPE 91 #define EUSERS (ERROR_BASE_NO + 87)
#define ENOPROTOOPT 92 #define ENOTSOCK (ERROR_BASE_NO + 88)
#define EPROTONOSUPPORT 93 #define EDESTADDRREQ (ERROR_BASE_NO + 89)
#define ESOCKTNOSUPPORT 94 #define EMSGSIZE (ERROR_BASE_NO + 90)
#define EOPNOTSUPP 95 #define EPROTOTYPE (ERROR_BASE_NO + 91)
#define ENOTSUP EOPNOTSUPP #define ENOPROTOOPT (ERROR_BASE_NO + 92)
#define EPFNOSUPPORT 96 #define EPROTONOSUPPORT (ERROR_BASE_NO + 93)
#define EAFNOSUPPORT 97 #define ESOCKTNOSUPPORT (ERROR_BASE_NO + 94)
#define EADDRINUSE 98 #define EOPNOTSUPP (ERROR_BASE_NO + 95)
#define EADDRNOTAVAIL 99 #define ENOTSUP EOPNOTSUPP )
#define ENETDOWN 100 #define EPFNOSUPPORT (ERROR_BASE_NO + 96)
#define ENETUNREACH 101 #define EAFNOSUPPORT (ERROR_BASE_NO + 97)
#define ENETRESET 102 #define EADDRINUSE (ERROR_BASE_NO + 98)
#define ECONNABORTED 103 #define EADDRNOTAVAIL (ERROR_BASE_NO + 99)
#define ECONNRESET 104 #define ENETDOWN (ERROR_BASE_NO + 100)
#define ENOBUFS 105 #define ENETUNREACH (ERROR_BASE_NO + 101)
#define EISCONN 106 #define ENETRESET (ERROR_BASE_NO + 102)
#define ENOTCONN 107 #define ECONNABORTED (ERROR_BASE_NO + 103)
#define ESHUTDOWN 108 #define ECONNRESET (ERROR_BASE_NO + 104)
#define ETOOMANYREFS 109 #define ENOBUFS (ERROR_BASE_NO + 105)
#define ETIMEDOUT 110 #define EISCONN (ERROR_BASE_NO + 106)
#define ECONNREFUSED 111 #define ENOTCONN (ERROR_BASE_NO + 107)
#define EHOSTDOWN 112 #define ESHUTDOWN (ERROR_BASE_NO + 108)
#define EHOSTUNREACH 113 #define ETOOMANYREFS (ERROR_BASE_NO + 109)
#define EALREADY 114 #define ETIMEDOUT (ERROR_BASE_NO + 110)
#define EINPROGRESS 115 #define ECONNREFUSED (ERROR_BASE_NO + 111)
#define ESTALE 116 #define EHOSTDOWN (ERROR_BASE_NO + 112)
#define EUCLEAN 117 #define EHOSTUNREACH (ERROR_BASE_NO + 113)
#define ENOTNAM 118 #define EALREADY (ERROR_BASE_NO + 114)
#define ENAVAIL 119 #define EINPROGRESS (ERROR_BASE_NO + 115)
#define EISNAM 120 #define ESTALE (ERROR_BASE_NO + 116)
#define EREMOTEIO 121 #define EUCLEAN (ERROR_BASE_NO + 117)
#define EDQUOT 122 #define ENOTNAM (ERROR_BASE_NO + 118)
#define ENOMEDIUM 123 #define ENAVAIL (ERROR_BASE_NO + 119)
#define EMEDIUMTYPE 124 #define EISNAM (ERROR_BASE_NO + 120)
#define ECANCELED 125 #define EREMOTEIO (ERROR_BASE_NO + 121)
#define ENOKEY 126 #define EDQUOT (ERROR_BASE_NO + 122)
#define EKEYEXPIRED 127 #define ENOMEDIUM (ERROR_BASE_NO + 123)
#define EKEYREVOKED 128 #define EMEDIUMTYPE (ERROR_BASE_NO + 124)
#define EKEYREJECTED 129 #define ECANCELED (ERROR_BASE_NO + 125)
#define EOWNERDEAD 130 #define ENOKEY (ERROR_BASE_NO + 126)
#define ENOTRECOVERABLE 131 #define EKEYEXPIRED (ERROR_BASE_NO + 127)
#define ERFKILL 132 #define EKEYREVOKED (ERROR_BASE_NO + 128)
#define EHWPOISON 133 #define EKEYREJECTED (ERROR_BASE_NO + 129)
#define EOWNERDEAD (ERROR_BASE_NO + 130)
#define ENOTRECOVERABLE (ERROR_BASE_NO + 131)
#define ERFKILL (ERROR_BASE_NO + 132)
#define EHWPOISON (ERROR_BASE_NO + 133)
#endif #endif
#endif #endif
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
* Copyright (c) 2006-2018, RT-Thread Development Team * Copyright (c) 2006-2018, RT-Thread Development Team
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/
/*
* File : libc_signal.h
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
......
...@@ -122,11 +122,11 @@ typedef rt_base_t rt_off_t; /**< Type for offset */ ...@@ -122,11 +122,11 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#include <stdarg.h> #include <stdarg.h>
#else #else
/* the version of GNU GCC must be greater than 4.x */ /* the version of GNU GCC must be greater than 4.x */
typedef __builtin_va_list __gnuc_va_list; typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list; typedef __gnuc_va_list va_list;
#define va_start(v,l) __builtin_va_start(v,l) #define va_start(v,l) __builtin_va_start(v,l)
#define va_end(v) __builtin_va_end(v) #define va_end(v) __builtin_va_end(v)
#define va_arg(v,l) __builtin_va_arg(v,l) #define va_arg(v,l) __builtin_va_arg(v,l)
#endif #endif
#define SECTION(x) __attribute__((section(x))) #define SECTION(x) __attribute__((section(x)))
...@@ -248,7 +248,7 @@ typedef int (*init_fn_t)(void); ...@@ -248,7 +248,7 @@ typedef int (*init_fn_t)(void);
* @addtogroup Error * @addtogroup Error
*/ */
/*@{*/ /**@{*/
/* RT-Thread error code definitions */ /* RT-Thread error code definitions */
#define RT_EOK 0 /**< There is no error */ #define RT_EOK 0 /**< There is no error */
...@@ -263,7 +263,7 @@ typedef int (*init_fn_t)(void); ...@@ -263,7 +263,7 @@ typedef int (*init_fn_t)(void);
#define RT_EINTR 9 /**< Interrupted system call */ #define RT_EINTR 9 /**< Interrupted system call */
#define RT_EINVAL 10 /**< Invalid argument */ #define RT_EINVAL 10 /**< Invalid argument */
/*@}*/ /**@}*/
/** /**
* @ingroup BasicDef * @ingroup BasicDef
...@@ -314,7 +314,7 @@ typedef struct rt_slist_node rt_slist_t; /**< Type for single lis ...@@ -314,7 +314,7 @@ typedef struct rt_slist_node rt_slist_t; /**< Type for single lis
* @addtogroup KernelObject * @addtogroup KernelObject
*/ */
/*@{*/ /**@{*/
/* /*
* kernel object macros * kernel object macros
...@@ -391,13 +391,13 @@ struct rt_object_information ...@@ -391,13 +391,13 @@ struct rt_object_information
#define RT_OBJECT_HOOK_CALL(func, argv) #define RT_OBJECT_HOOK_CALL(func, argv)
#endif #endif
/*@}*/ /**@}*/
/** /**
* @addtogroup Clock * @addtogroup Clock
*/ */
/*@{*/ /**@{*/
/** /**
* clock & timer macros * clock & timer macros
...@@ -454,13 +454,13 @@ typedef siginfo_t rt_siginfo_t; ...@@ -454,13 +454,13 @@ typedef siginfo_t rt_siginfo_t;
#define RT_SIG_MAX 32 #define RT_SIG_MAX 32
#endif #endif
/*@}*/ /**@}*/
/** /**
* @addtogroup Thread * @addtogroup Thread
*/ */
/*@{*/ /**@{*/
/* /*
* Thread * Thread
...@@ -559,13 +559,13 @@ struct rt_thread ...@@ -559,13 +559,13 @@ struct rt_thread
}; };
typedef struct rt_thread *rt_thread_t; typedef struct rt_thread *rt_thread_t;
/*@}*/ /**@}*/
/** /**
* @addtogroup IPC * @addtogroup IPC
*/ */
/*@{*/ /**@{*/
/** /**
* IPC flags and control command definitions * IPC flags and control command definitions
...@@ -683,13 +683,13 @@ struct rt_messagequeue ...@@ -683,13 +683,13 @@ struct rt_messagequeue
typedef struct rt_messagequeue *rt_mq_t; typedef struct rt_messagequeue *rt_mq_t;
#endif #endif
/*@}*/ /**@}*/
/** /**
* @addtogroup MM * @addtogroup MM
*/ */
/*@{*/ /**@{*/
/* /*
* memory management * memory management
...@@ -757,14 +757,14 @@ struct rt_mempool ...@@ -757,14 +757,14 @@ struct rt_mempool
typedef struct rt_mempool *rt_mp_t; typedef struct rt_mempool *rt_mp_t;
#endif #endif
/*@}*/ /**@}*/
#ifdef RT_USING_DEVICE #ifdef RT_USING_DEVICE
/** /**
* @addtogroup Device * @addtogroup Device
*/ */
/*@{*/ /**@{*/
/** /**
* device (I/O) class type * device (I/O) class type
...@@ -1009,7 +1009,7 @@ struct rt_device_graphic_ops ...@@ -1009,7 +1009,7 @@ struct rt_device_graphic_ops
}; };
#define rt_graphix_ops(device) ((struct rt_device_graphic_ops *)(device->user_data)) #define rt_graphix_ops(device) ((struct rt_device_graphic_ops *)(device->user_data))
/*@}*/ /**@}*/
#endif #endif
/* definitions for libc */ /* definitions for libc */
......
...@@ -24,7 +24,7 @@ extern "C" { ...@@ -24,7 +24,7 @@ extern "C" {
* @addtogroup KernelService * @addtogroup KernelService
*/ */
/*@{*/ /**@{*/
/** /**
* rt_container_of - return the member address of ptr, if the type of ptr is the * rt_container_of - return the member address of ptr, if the type of ptr is the
...@@ -306,7 +306,7 @@ rt_inline int rt_slist_isempty(rt_slist_t *l) ...@@ -306,7 +306,7 @@ rt_inline int rt_slist_isempty(rt_slist_t *l)
#define rt_slist_tail_entry(ptr, type, member) \ #define rt_slist_tail_entry(ptr, type, member) \
rt_slist_entry(rt_slist_tail(ptr), type, member) rt_slist_entry(rt_slist_tail(ptr), type, member)
/*@}*/ /**@}*/
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -300,4 +300,10 @@ menu "Kernel Device Object" ...@@ -300,4 +300,10 @@ menu "Kernel Device Object"
endmenu endmenu
config RT_VER_NUM
hex
default 0x30102
help
RT-Thread version number
endmenu endmenu
...@@ -221,14 +221,12 @@ void rt_thread_idle_excute(void) ...@@ -221,14 +221,12 @@ void rt_thread_idle_excute(void)
static void rt_thread_idle_entry(void *parameter) static void rt_thread_idle_entry(void *parameter)
{ {
#ifdef RT_USING_IDLE_HOOK
rt_size_t i;
#endif
while (1) while (1)
{ {
#ifdef RT_USING_IDLE_HOOK #ifdef RT_USING_IDLE_HOOK
rt_size_t i;
for (i = 0; i < RT_IDEL_HOOK_LIST_SIZE; i++) for (i = 0; i < RT_IDEL_HOOK_LIST_SIZE; i++)
{ {
if (idle_hook_list[i] != RT_NULL) if (idle_hook_list[i] != RT_NULL)
......
...@@ -535,7 +535,7 @@ void rt_show_version(void) ...@@ -535,7 +535,7 @@ void rt_show_version(void)
rt_kprintf("- RT - Thread Operating System\n"); rt_kprintf("- RT - Thread Operating System\n");
rt_kprintf(" / | \\ %d.%d.%d build %s\n", rt_kprintf(" / | \\ %d.%d.%d build %s\n",
RT_VERSION, RT_SUBVERSION, RT_REVISION, __DATE__); RT_VERSION, RT_SUBVERSION, RT_REVISION, __DATE__);
rt_kprintf(" 2006 - 2018 Copyright by rt-thread team\n"); rt_kprintf(" 2006 - 2019 Copyright by rt-thread team\n");
} }
RTM_EXPORT(rt_show_version); RTM_EXPORT(rt_show_version);
......
...@@ -108,7 +108,7 @@ static void _signal_deliver(rt_thread_t tid) ...@@ -108,7 +108,7 @@ static void _signal_deliver(rt_thread_t tid)
/* do signal action in self thread context */ /* do signal action in self thread context */
rt_thread_handle_sig(RT_TRUE); rt_thread_handle_sig(RT_TRUE);
} }
else if (!((tid->stat & RT_THREAD_STAT_MASK) & RT_THREAD_STAT_SIGNAL)) else if (!((tid->stat & RT_THREAD_STAT_SIGNAL_MASK) & RT_THREAD_STAT_SIGNAL))
{ {
/* add signal state */ /* add signal state */
tid->stat |= RT_THREAD_STAT_SIGNAL; tid->stat |= RT_THREAD_STAT_SIGNAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册