[lwIP] Use lock scheduler instead of disable interrupt for lwIP porting.

This commit is contained in:
Bernard Xiong 2015-05-04 20:37:41 +08:00
parent 1f52f79d0b
commit dcc6e39816
2 changed files with 18 additions and 29 deletions

View File

@ -53,7 +53,10 @@ typedef rt_uint32_t mem_ptr_t;
#define S32_F "ld" #define S32_F "ld"
#define X32_F "lx" #define X32_F "lx"
#ifdef RT_USING_NEWLIB #ifdef RT_USING_LIBC
#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
#include <sys/errno.h>
#else
#include <errno.h> #include <errno.h>
/* some errno not defined in newlib */ /* some errno not defined in newlib */
#define ENSRNOTFOUND 163 /* Domain name not found */ #define ENSRNOTFOUND 163 /* Domain name not found */
@ -61,16 +64,20 @@ typedef rt_uint32_t mem_ptr_t;
180 here because the number "108" which is used 180 here because the number "108" which is used
in arch.h has been assigned to another error code. */ in arch.h has been assigned to another error code. */
#define ESHUTDOWN 180 #define ESHUTDOWN 180
#elif RT_USING_MINILIBC #endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */
#include <errno.h>
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
#else #else
#define LWIP_PROVIDE_ERRNO #define LWIP_PROVIDE_ERRNO
#endif #endif
#ifdef RT_USING_MINILIBC #ifdef RT_USING_LIBC
#include <time.h> #include <sys/time.h>
#define LWIP_TIMEVAL_PRIVATE 0 #define LWIP_TIMEVAL_PRIVATE 0
#else
#define LWIP_TIMEVAL_PRIVATE 1
#endif
#if defined(RT_USING_DFS_LWIP)
#define LWIP_COMPAT_SOCKETS 0
#endif #endif
#if defined(__CC_ARM) /* ARMCC compiler */ #if defined(__CC_ARM) /* ARMCC compiler */
@ -100,8 +107,11 @@ void sys_arch_assert(const char* file, int line);
#define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0) #define LWIP_PLATFORM_DIAG(x) do {rt_kprintf x;} while(0)
#define LWIP_PLATFORM_ASSERT(x) do {rt_kprintf(x); sys_arch_assert(__FILE__, __LINE__);}while(0) #define LWIP_PLATFORM_ASSERT(x) do {rt_kprintf(x); sys_arch_assert(__FILE__, __LINE__);}while(0)
#include "string.h" #include "string.h"
#define SYS_ARCH_DECL_PROTECT(level)
#define SYS_ARCH_PROTECT(level) rt_enter_critical()
#define SYS_ARCH_UNPROTECT(level) rt_exit_critical()
#endif /* __ARCH_CC_H__ */ #endif /* __ARCH_CC_H__ */

View File

@ -353,25 +353,4 @@
#define LWIP_RAND rand #define LWIP_RAND rand
#endif #endif
#if defined(RT_USING_DFS_LWIP)
#define LWIP_COMPAT_SOCKETS 0
#endif
#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
#if defined(RT_USING_PTHREADS)
#define LWIP_TIMEVAL_PRIVATE 0
#include <posix_types.h>
#else
/* there is no timeval in CC_ARM and IAR */
#define LWIP_TIMEVAL_PRIVATE 1
#endif /* RT_USING_PTHREADS */
#elif defined (__GNUC__)
#define LWIP_TIMEVAL_PRIVATE 0
#include <sys/time.h>
#endif
#endif /* __LWIPOPTS_H__ */ #endif /* __LWIPOPTS_H__ */