Merge pull request #4793 from mysterywolf/lwipcc

[bug][lwip] 修复lwip临界区保护的bug
This commit is contained in:
guo 2021-06-20 11:27:52 +08:00 committed by GitHub
commit b032f9a6e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 22 deletions

View File

@ -11,11 +11,10 @@
* 2019-09-03 xiaofan optimize link change detection process * 2019-09-03 xiaofan optimize link change detection process
*/ */
#include "board.h"
#include "drv_config.h" #include "drv_config.h"
#include <netif/ethernetif.h>
#include "lwipopts.h"
#include "drv_eth.h" #include "drv_eth.h"
#include <netif/ethernetif.h>
#include <lwipopts.h>
/* /*
* Emac driver uses CubeMX tool to generate emac and phy's configuration, * Emac driver uses CubeMX tool to generate emac and phy's configuration,

View File

@ -37,8 +37,9 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
#include <string.h>
#include <stdint.h> #include <stdint.h>
typedef uint8_t u8_t; typedef uint8_t u8_t;
typedef int8_t s8_t; typedef int8_t s8_t;
typedef uint16_t u16_t; typedef uint16_t u16_t;
@ -99,11 +100,8 @@ 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> #define SYS_ARCH_DECL_PROTECT(level) register rt_base_t level
#define SYS_ARCH_PROTECT(level) do {level = rt_hw_interrupt_disable();} while(0)
#define SYS_ARCH_DECL_PROTECT(level) #define SYS_ARCH_UNPROTECT(level) do {rt_hw_interrupt_enable(level);} while(0)
#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

@ -37,6 +37,7 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
#include <string.h>
#define U16_F "hu" #define U16_F "hu"
#define S16_F "hd" #define S16_F "hd"
@ -90,11 +91,8 @@ 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> #define SYS_ARCH_DECL_PROTECT(level) register rt_base_t level
#define SYS_ARCH_PROTECT(level) do {level = rt_hw_interrupt_disable();} while(0)
#define SYS_ARCH_DECL_PROTECT(level) #define SYS_ARCH_UNPROTECT(level) do {rt_hw_interrupt_enable(level);} while(0)
#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

@ -37,6 +37,7 @@
#include <rthw.h> #include <rthw.h>
#include <rtthread.h> #include <rtthread.h>
#include <string.h>
#define U16_F "hu" #define U16_F "hu"
#define S16_F "hd" #define S16_F "hd"
@ -90,11 +91,8 @@ 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" #define SYS_ARCH_DECL_PROTECT(level) register rt_base_t level
#define SYS_ARCH_PROTECT(level) do {level = rt_hw_interrupt_disable();} while(0)
#define SYS_ARCH_DECL_PROTECT(level) #define SYS_ARCH_UNPROTECT(level) do {rt_hw_interrupt_enable(level);} while(0)
#define SYS_ARCH_PROTECT(level) rt_enter_critical()
#define SYS_ARCH_UNPROTECT(level) rt_exit_critical()
#endif /* __ARCH_CC_H__ */ #endif /* __ARCH_CC_H__ */