Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Kernel Liteos M
提交
49be4058
K
Kernel Liteos M
项目概览
OpenHarmony
/
Kernel Liteos M
大约 1 年 前同步成功
通知
20
Star
28
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel Liteos M
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49be4058
编写于
4月 16, 2021
作者:
Z
zhushengle
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master' into HEAD
Change-Id: I9a1458b1344f89ca04cab96c3599c9cfea757929
上级
57f6e1f1
530b738d
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
316 addition
and
170 deletion
+316
-170
components/fs/fatfs/fs.c
components/fs/fatfs/fs.c
+1
-0
components/net/lwip-2.1/porting/include/arch/cc.h
components/net/lwip-2.1/porting/include/arch/cc.h
+27
-5
components/net/lwip-2.1/porting/include/arch/sys_arch.h
components/net/lwip-2.1/porting/include/arch/sys_arch.h
+0
-2
components/net/lwip-2.1/porting/include/lwip/inet.h
components/net/lwip-2.1/porting/include/lwip/inet.h
+65
-0
components/net/lwip-2.1/porting/include/lwip/lwipopts.h
components/net/lwip-2.1/porting/include/lwip/lwipopts.h
+1
-2
components/net/lwip-2.1/porting/include/lwip/netdb.h
components/net/lwip-2.1/porting/include/lwip/netdb.h
+38
-39
components/net/lwip-2.1/porting/include/lwip/netif.h
components/net/lwip-2.1/porting/include/lwip/netif.h
+7
-5
components/net/lwip-2.1/porting/include/lwip/sockets.h
components/net/lwip-2.1/porting/include/lwip/sockets.h
+83
-79
components/net/lwip-2.1/porting/src/netdb_porting.c
components/net/lwip-2.1/porting/src/netdb_porting.c
+1
-1
components/net/test/lwip_test.h
components/net/test/lwip_test.h
+3
-1
components/net/test/net_socket_test_002.c
components/net/test/net_socket_test_002.c
+13
-2
components/net/test/net_socket_test_003.c
components/net/test/net_socket_test_003.c
+0
-1
components/net/test/net_socket_test_007.c
components/net/test/net_socket_test_007.c
+0
-1
components/net/test/net_socket_test_008.c
components/net/test/net_socket_test_008.c
+0
-2
components/net/test/net_socket_test_009.c
components/net/test/net_socket_test_009.c
+0
-2
components/net/test/net_socket_test_010.c
components/net/test/net_socket_test_010.c
+0
-2
components/net/test/net_socket_test_011.c
components/net/test/net_socket_test_011.c
+11
-2
components/net/test/net_socket_test_012.c
components/net/test/net_socket_test_012.c
+0
-1
components/net/test/net_socket_test_013.c
components/net/test/net_socket_test_013.c
+0
-2
components/net/test/test_main.c
components/net/test/test_main.c
+1
-1
kal/cmsis/cmsis_liteos2.c
kal/cmsis/cmsis_liteos2.c
+20
-16
kal/posix/include/limits.h
kal/posix/include/limits.h
+2
-0
kal/posix/musl_src/network/h_errno.c
kal/posix/musl_src/network/h_errno.c
+9
-0
kernel/arch/arm/cortex-m3/keil/los_interrupt.c
kernel/arch/arm/cortex-m3/keil/los_interrupt.c
+5
-0
kernel/arch/arm/cortex-m33/gcc/los_interrupt.c
kernel/arch/arm/cortex-m33/gcc/los_interrupt.c
+5
-0
kernel/arch/arm/cortex-m4/gcc/los_interrupt.c
kernel/arch/arm/cortex-m4/gcc/los_interrupt.c
+5
-0
kernel/arch/arm/cortex-m4/iar/los_interrupt.c
kernel/arch/arm/cortex-m4/iar/los_interrupt.c
+2
-2
kernel/arch/arm/cortex-m7/gcc/los_interrupt.c
kernel/arch/arm/cortex-m7/gcc/los_interrupt.c
+5
-0
kernel/arch/arm/cortex-m7/iar/los_interrupt.c
kernel/arch/arm/cortex-m7/iar/los_interrupt.c
+2
-2
kernel/arch/risc-v/riscv32/gcc/los_interrupt.c
kernel/arch/risc-v/riscv32/gcc/los_interrupt.c
+5
-0
targets/cortex-m3_stm32f103_simulator_keil/project/los_demo.uvproj
...ortex-m3_stm32f103_simulator_keil/project/los_demo.uvproj
+5
-0
未找到文件。
components/fs/fatfs/fs.c
浏览文件 @
49be4058
...
@@ -44,6 +44,7 @@
...
@@ -44,6 +44,7 @@
#ifdef LOSCFG_NET_LWIP_SACK
#ifdef LOSCFG_NET_LWIP_SACK
#include "lwip/lwipopts.h"
#include "lwip/lwipopts.h"
#include "lwip/sockets.h"
#define CONFIG_NSOCKET_DESCRIPTORS LWIP_CONFIG_NUM_SOCKETS
#define CONFIG_NSOCKET_DESCRIPTORS LWIP_CONFIG_NUM_SOCKETS
#else
#else
#define CONFIG_NSOCKET_DESCRIPTORS 0
#define CONFIG_NSOCKET_DESCRIPTORS 0
...
...
components/net/lwip-2.1/porting/include/arch/cc.h
浏览文件 @
49be4058
...
@@ -32,19 +32,42 @@
...
@@ -32,19 +32,42 @@
#ifndef _LWIP_PORTING_CC_H_
#ifndef _LWIP_PORTING_CC_H_
#define _LWIP_PORTING_CC_H_
#define _LWIP_PORTING_CC_H_
#ifdef LITTLE_ENDIAN
#undef LITTLE_ENDIAN
#endif
#ifdef BIG_ENDIAN
#undef BIG_ENDIAN
#endif
#include <endian.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include "securec.h"
#include "securec.h"
#include "
log
.h"
#include "
memory_pool
.h"
#ifdef htons
#ifdef htons
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
#define LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
#endif
#endif
#define LWIP_PROVIDE_ERRNO 1
#define SOCKLEN_T_DEFINED
#define __SIZEOF_POINTER__ 4 // 32位系统
#define SA_FAMILY_T_DEFINED
#define IN_PORT_T_DEFINED
#define LWIP_TIMEVAL_PRIVATE 0
#define LWIP_ERRNO_STDINCLUDE
#define LWIP_SOCKET_STDINCLUDE
#define LWIP_DNS_API_DEFINE_ERRORS 0
#define LWIP_DNS_API_DEFINE_FLAGS 0
#define LWIP_DNS_API_DECLARE_STRUCTS 0
#define LWIP_DNS_API_DECLARE_H_ERRNO 0
#ifndef __SIZEOF_POINTER__
#define __SIZEOF_POINTER__ 4 // 32 bit system
#endif
#define LOS_TASK_STATUS_DETACHED 0x0100 //
预留字段
#define LOS_TASK_STATUS_DETACHED 0x0100 //
reserved
#if defined(__arm__) && defined(__ARMCC_VERSION)
#if defined(__arm__) && defined(__ARMCC_VERSION)
/* Keil uVision4 tools */
/* Keil uVision4 tools */
...
@@ -96,7 +119,6 @@ extern void HilogPrintf(const char *fmt, ...);
...
@@ -96,7 +119,6 @@ extern void HilogPrintf(const char *fmt, ...);
#define init_waitqueue_head(...)
#define init_waitqueue_head(...)
#define poll_check_waiters(...)
#define poll_check_waiters(...)
#define IOCTL_CMD_CASE_HANDLER()
#define IOCTL_CMD_CASE_HANDLER()
#define DF_NADDR(addr)
#define DNS_SERVER_ADDRESS(ipaddr) (ip4_addr_set_u32(ipaddr, ipaddr_addr("114.114.114.114")))
#define DNS_SERVER_ADDRESS(ipaddr) (ip4_addr_set_u32(ipaddr, ipaddr_addr("114.114.114.114")))
#define DNS_SERVER_ADDRESS_SECONDARY(ipaddr) (ip4_addr_set_u32(ipaddr, ipaddr_addr("114.114.115.115")))
#define DNS_SERVER_ADDRESS_SECONDARY(ipaddr) (ip4_addr_set_u32(ipaddr, ipaddr_addr("114.114.115.115")))
...
...
components/net/lwip-2.1/porting/include/arch/sys_arch.h
浏览文件 @
49be4058
...
@@ -33,8 +33,6 @@
...
@@ -33,8 +33,6 @@
#define _LWIP_PORTING_SYS_ARCH_H_
#define _LWIP_PORTING_SYS_ARCH_H_
#include <stdint.h>
#include <stdint.h>
#include "memory_pool.h"
#include "los_mux.h"
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
...
components/net/lwip-2.1/porting/include/lwip/inet.h
0 → 100644
浏览文件 @
49be4058
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _LWIP_PORTING_INET_H_
#define _LWIP_PORTING_INET_H_
#include <arpa/inet.h>
#include <netinet/in.h>
#include_next <lwip/inet.h>
#if LWIP_IPV4
#define inet_addr_from_ip4addr(target_inaddr, source_ipaddr) \
((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr))
#define inet_addr_to_ip4addr(target_ipaddr, source_inaddr) \
(ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr))
/* directly map this to the lwip internal functions */
#define inet_addr(cp) ipaddr_addr(cp)
#define inet_aton(cp, addr) ip4addr_aton(cp, (ip4_addr_t*)addr)
#define inet_ntoa(addr) ip4addr_ntoa((const ip4_addr_t*)&(addr))
#define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen)
#endif
/* LWIP_IPV4 */
#if LWIP_IPV6
#define inet6_addr_from_ip6addr(target_in6addr, source_ip6addr) \
{(target_in6addr)->s6_addr32[0] = (source_ip6addr)->addr[0]; \
(target_in6addr)->s6_addr32[1] = (source_ip6addr)->addr[1]; \
(target_in6addr)->s6_addr32[2] = (source_ip6addr)->addr[2]; \
(target_in6addr)->s6_addr32[3] = (source_ip6addr)->addr[3];}
#define inet6_addr_to_ip6addr(target_ip6addr, source_in6addr) \
{(target_ip6addr)->addr[0] = (source_in6addr)->s6_addr32[0]; \
(target_ip6addr)->addr[1] = (source_in6addr)->s6_addr32[1]; \
(target_ip6addr)->addr[2] = (source_in6addr)->s6_addr32[2]; \
(target_ip6addr)->addr[3] = (source_in6addr)->s6_addr32[3]; \
ip6_addr_clear_zone(target_ip6addr);}
#endif
/* LWIP_IPV6 */
#endif
/* _LWIP_PORTING_INET_H_ */
components/net/lwip-2.1/porting/include/lwip/lwipopts.h
浏览文件 @
49be4058
...
@@ -134,8 +134,7 @@
...
@@ -134,8 +134,7 @@
#define LWIP_NETIF_LOOPBACK 1
#define LWIP_NETIF_LOOPBACK 1
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
#define LWIP_POSIX_SOCKETS_IO_NAMES 0
#define LWIP_RAW 1
#define LWIP_RAW 1
#define CONFIG_NFILE_DESCRIPTORS 1
#define LWIP_SOCKET_OFFSET FAT_MAX_OPEN_FILES
#define LWIP_SOCKET_OFFSET CONFIG_NFILE_DESCRIPTORS
#define LWIP_SO_RCVBUF 1
#define LWIP_SO_RCVBUF 1
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_SNDTIMEO 1
#define LWIP_SO_SNDTIMEO 1
...
...
components/net/lwip-2.1/porting/include/netdb.h
→
components/net/lwip-2.1/porting/include/
lwip/
netdb.h
浏览文件 @
49be4058
/*
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* provided with the distribution.
*
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* to endorse or promote products derived from this software without specific prior written
* permission.
* permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
#ifndef __LITEOS_NETDB_PORTING_H__
#ifndef _LWIP_PORTING_NETDB_H_
#define __LITEOS_NETDB_PORTING_H__
#define _LWIP_PORTING_NETDB_H_
#include "lwip/netdb.h"
#include <netdb.h>
#include_next <lwip/netdb.h>
struct
hostent
*
gethostbyname
(
const
char
*
name
);
#endif
/* _LWIP_PORTING_NETDB_H_ */
#endif // __LITEOS_NETDB_PORTING_H__
\ No newline at end of file
components/net/lwip-2.1/porting/include/lwip/netif.h
浏览文件 @
49be4058
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
#ifndef _LWIP_PORTING_NETIF_H_
#ifndef _LWIP_PORTING_NETIF_H_
#define _LWIP_PORTING_NETIF_H_
#define _LWIP_PORTING_NETIF_H_
#include <net/if.h>
#include <netinet/ip.h>
#define netif_find netifapi_netif_find_by_name
#define netif_find netifapi_netif_find_by_name
#if LWIP_DHCPS
#if LWIP_DHCPS
...
@@ -39,12 +42,11 @@
...
@@ -39,12 +42,11 @@
LWIP_NETIF_CLIENT_DATA_INDEX_DHCPS
LWIP_NETIF_CLIENT_DATA_INDEX_DHCPS
#endif
#endif
#define LWIP_NETIF_FULLNAME 16
#define linkoutput linkoutput; \
#define linkoutput linkoutput; \
void
(
*
drv_send
)(
struct
netif
*
netif
,
struct
pbuf
*
p
);
\
void
(
*
drv_send
)(
struct
netif
*
netif
,
struct
pbuf
*
p
);
\
u8_t
(
*
drv_set_hwaddr
)(
struct
netif
*
netif
,
u8_t
*
addr
,
u8_t
len
);
\
u8_t
(
*
drv_set_hwaddr
)(
struct
netif
*
netif
,
u8_t
*
addr
,
u8_t
len
);
\
void
(
*
drv_config
)(
struct
netif
*
netif
,
u32_t
config_flags
,
u8_t
setBit
);
\
void
(
*
drv_config
)(
struct
netif
*
netif
,
u32_t
config_flags
,
u8_t
setBit
);
\
char
full_name
[
LWIP_NETIF_FULLNAME
];
\
char
full_name
[
IFNAMSIZ
];
\
u16_t
link_layer_type
u16_t
link_layer_type
#include_next <lwip/netif.h>
#include_next <lwip/netif.h>
#undef linkoutput
#undef linkoutput
...
@@ -52,7 +54,7 @@
...
@@ -52,7 +54,7 @@
#undef LWIP_NETIF_CLIENT_DATA_INDEX_DHCP
#undef LWIP_NETIF_CLIENT_DATA_INDEX_DHCP
#endif
#endif
#include <lwip/etharp.h>
// For ETHARP_HWADDR_LEN, by `hieth-sf src/interface.c' and `wal/wal_net.c'
#include <lwip/etharp.h>
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -60,9 +62,9 @@ extern "C" {
...
@@ -60,9 +62,9 @@ extern "C" {
// redefine NETIF_NAMESIZE which was defined in netif.h
// redefine NETIF_NAMESIZE which was defined in netif.h
#undef NETIF_NAMESIZE
#undef NETIF_NAMESIZE
#define NETIF_NAMESIZE
LWIP_NETIF_FULLNAME
#define NETIF_NAMESIZE
IFNAMSIZ
#define LOOPBACK_IF 0
// 772
#define LOOPBACK_IF 0
#define ETHERNET_DRIVER_IF 1
#define ETHERNET_DRIVER_IF 1
#define WIFI_DRIVER_IF 801
#define WIFI_DRIVER_IF 801
#define BT_PROXY_IF 802
#define BT_PROXY_IF 802
...
...
components/net/lwip-2.1/porting/include/
sys/socket
.h
→
components/net/lwip-2.1/porting/include/
lwip/sockets
.h
浏览文件 @
49be4058
/*
/*
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2013-2019 Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
* Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without modification,
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* are permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* provided with the distribution.
*
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* 3. Neither the name of the copyright holder nor the names of its contributors may be used
* to endorse or promote products derived from this software without specific prior written
* to endorse or promote products derived from this software without specific prior written
* permission.
* permission.
*
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
#ifndef _SYS_SOCKET_PORTING_H
#ifndef _LWIP_PORTING_SOCKETS_H_
#define _SYS_SOCKET_PORTING_H
#define _LWIP_PORTING_SOCKETS_H_
#include "lwip/sockets.h"
#include <sys/socket.h>
#include <poll.h>
#ifdef __cplusplus
#include <netinet/tcp.h>
extern
"C"
{
#include <netinet/in.h>
#endif
#include <sys/ioctl.h>
#include <sys/select.h>
int
socket
(
int
,
int
,
int
);
#include <limits.h>
#include <fcntl.h>
int
bind
(
int
,
const
struct
sockaddr
*
,
socklen_t
);
#include_next <lwip/sockets.h>
int
connect
(
int
,
const
struct
sockaddr
*
,
socklen_t
);
#include <fatfs.h>
int
listen
(
int
,
int
);
int
accept
(
int
,
struct
sockaddr
*
__restrict
,
socklen_t
*
__restrict
);
#ifdef __cplusplus
extern
"C"
{
int
getsockname
(
int
,
struct
sockaddr
*
__restrict
,
socklen_t
*
__restrict
);
#endif
int
getpeername
(
int
,
struct
sockaddr
*
__restrict
,
socklen_t
*
__restrict
);
#if FD_SETSIZE < (LWIP_SOCKET_OFFSET + MEMP_NUM_NETCONN)
ssize_t
send
(
int
,
const
void
*
,
size_t
,
int
);
#error "external FD_SETSIZE too small for number of sockets"
ssize_t
recv
(
int
,
void
*
,
size_t
,
int
);
#else
ssize_t
sendto
(
int
,
const
void
*
,
size_t
,
int
,
const
struct
sockaddr
*
,
socklen_t
);
#define LWIP_SELECT_MAXNFDS FD_SETSIZE
ssize_t
recvfrom
(
int
,
void
*
__restrict
,
size_t
,
int
,
struct
sockaddr
*
__restrict
,
socklen_t
*
__restrict
);
#endif
ssize_t
sendmsg
(
int
,
const
struct
msghdr
*
,
int
);
ssize_t
recvmsg
(
int
,
struct
msghdr
*
,
int
);
#if IOV_MAX > 0xFFFF
#error "IOV_MAX larger than supported by LwIP"
int
getsockopt
(
int
,
int
,
int
,
void
*
__restrict
,
socklen_t
*
__restrict
);
#endif
int
setsockopt
(
int
,
int
,
int
,
const
void
*
,
socklen_t
);
#if LWIP_UDP && LWIP_UDPLITE
const
char
*
inet_ntop
(
int
af
,
const
void
*
src
,
char
*
dst
,
socklen_t
size
);
#define UDPLITE_SEND_CSCOV 0x01
/* sender checksum coverage */
int
inet_pton
(
int
af
,
const
char
*
src
,
void
*
dst
);
#define UDPLITE_RECV_CSCOV 0x02
/* minimal receiver checksum coverage */
#endif
int
shutdown
(
int
,
int
);
int
closesocket
(
int
sockfd
);
// For BSD 4.4 socket sa_len compatibility
#define DF_NADDR(addr)
int
ioctlsocket
(
int
s
,
long
cmd
,
void
*
argp
);
#define SA_LEN(addr, _) (IP_IS_V4_VAL(addr) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6))
#define sa_len sa_data[0] * 0 + SA_LEN(naddr, _)
#if LWIP_SOCKET_SELECT
#define sin_len sin_zero[0]
int
select
(
int
maxfdp1
,
fd_set
*
readset
,
fd_set
*
writeset
,
fd_set
*
exceptset
,
struct
timeval
*
timeout
);
#define sin6_len sin6_addr.s6_addr[0]
#endif
#if LWIP_SOCKET_POLL
// for sockets.c, TCP_KEEPALIVE is not supported currently
int
poll
(
struct
pollfd
*
fds
,
nfds_t
nfds
,
int
timeout
);
#define TCP_KEEPALIVE 0xFF
#endif
#define SIN_ZERO_LEN 8
#ifdef __cplusplus
int
closesocket
(
int
sockfd
);
}
int
ioctlsocket
(
int
s
,
long
cmd
,
void
*
argp
);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
/* _LWIP_PORTING_SOCKETS_H_ */
components/net/lwip-2.1/porting/src/netdb_porting.c
浏览文件 @
49be4058
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
*/
#include "netdb.h"
#include "
lwip/
netdb.h"
struct
hostent
*
gethostbyname
(
const
char
*
name
)
struct
hostent
*
gethostbyname
(
const
char
*
name
)
{
{
...
...
components/net/test/lwip_test.h
浏览文件 @
49be4058
...
@@ -32,8 +32,10 @@
...
@@ -32,8 +32,10 @@
#ifndef LWIP_TEST_H
#ifndef LWIP_TEST_H
#define LWIP_TEST_H
#define LWIP_TEST_H
#include "lwip/arch.h"
#include "lwip/sockets.h"
#include <sys/socket.h>
#include <sys/socket.h>
#include
"log.h"
#include
<arpa/inet.h>
#include "securec.h"
#include "securec.h"
#ifdef __cplusplus
#ifdef __cplusplus
...
...
components/net/test/net_socket_test_002.c
浏览文件 @
49be4058
...
@@ -30,14 +30,18 @@
...
@@ -30,14 +30,18 @@
*/
*/
#include "lwip_test.h"
#include "lwip_test.h"
#include "lwipopts.h"
#include <arch/sys_arch.h>
#include <lwip/sys.h>
#define MSG "Hi, I am UDP"
#define MSG "Hi, I am UDP"
#define TEST_CASE 120
#define TEST_CASE 120
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
int
UdpTest
(
void
)
void
UdpTestTask
(
void
*
p
)
{
{
(
void
)
p
;
LogPrintln
(
"net_socket_test_002.c enter"
);
LogPrintln
(
"net_socket_test_002.c enter"
);
g_testCase
=
TEST_CASE
;
g_testCase
=
TEST_CASE
;
int
sfd
;
int
sfd
;
...
@@ -111,6 +115,13 @@ int UdpTest(void)
...
@@ -111,6 +115,13 @@ int UdpTest(void)
/* close socket */
/* close socket */
ret
=
closesocket
(
sfd
);
ret
=
closesocket
(
sfd
);
LWIP_ASSERT
(
"socket invalid param."
,
ret
!=
-
1
);
LWIP_ASSERT
(
"socket invalid param."
,
ret
!=
-
1
);
return
LWIP_TEST_RET_OK
;
return
;
}
}
int
UdpTest
()
{
int
ret
=
sys_thread_new
(
"udp_test"
,
UdpTestTask
,
NULL
,
STACK_TEST_SIZE
,
TCPIP_THREAD_PRIO
);
ICUNIT_ASSERT_NOT_EQUAL
(
ret
,
-
1
,
23
);
return
ret
;
}
components/net/test/net_socket_test_003.c
浏览文件 @
49be4058
...
@@ -39,7 +39,6 @@
...
@@ -39,7 +39,6 @@
#define TEST_CASE 130
#define TEST_CASE 130
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
int
SampleTcpServer
()
static
int
SampleTcpServer
()
{
{
...
...
components/net/test/net_socket_test_007.c
浏览文件 @
49be4058
...
@@ -40,7 +40,6 @@ static char g_buf_temp[BUF_SIZE + 1] = { 0 };
...
@@ -40,7 +40,6 @@ static char g_buf_temp[BUF_SIZE + 1] = { 0 };
#define SEND_UDP_COUNT 10000 // send count
#define SEND_UDP_COUNT 10000 // send count
#define TEST_CASE 170
#define TEST_CASE 170
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
void
UdpTestMoreTask
(
void
*
p
)
static
void
UdpTestMoreTask
(
void
*
p
)
{
{
(
void
)
p
;
(
void
)
p
;
...
...
components/net/test/net_socket_test_008.c
浏览文件 @
49be4058
...
@@ -41,8 +41,6 @@
...
@@ -41,8 +41,6 @@
static
char
g_serverSendBuf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_serverSendBuf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_clientRecvBuf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_clientRecvBuf
[
BUF_SIZE
+
1
]
=
{
0
};
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
void
InitMsgBuf
()
static
void
InitMsgBuf
()
{
{
int
i
;
int
i
;
...
...
components/net/test/net_socket_test_009.c
浏览文件 @
49be4058
...
@@ -43,8 +43,6 @@
...
@@ -43,8 +43,6 @@
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
int
SampleTcpServer
()
static
int
SampleTcpServer
()
{
{
#if LWIP_SOCKET_SELECT
#if LWIP_SOCKET_SELECT
...
...
components/net/test/net_socket_test_010.c
浏览文件 @
49be4058
...
@@ -43,8 +43,6 @@
...
@@ -43,8 +43,6 @@
#define TIME_OUT (1000 * 10) // timeout 10s
#define TIME_OUT (1000 * 10) // timeout 10s
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_buf
[
BUF_SIZE
+
1
]
=
{
0
};
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
int
SampleTcpServer
()
static
int
SampleTcpServer
()
{
{
#if LWIP_SOCKET_POLL
#if LWIP_SOCKET_POLL
...
...
components/net/test/net_socket_test_011.c
浏览文件 @
49be4058
...
@@ -310,8 +310,9 @@ static struct netif *CreateBtNetIf()
...
@@ -310,8 +310,9 @@ static struct netif *CreateBtNetIf()
return
btNetif
;
return
btNetif
;
}
}
int
UdpTestNetif
(
void
)
static
void
UdpTestNetifTask
(
void
*
p
)
{
{
(
void
)
p
;
LogPrintln
(
"net_socket_test_011.c enter"
);
LogPrintln
(
"net_socket_test_011.c enter"
);
g_testCase
=
TEST_CASE
;
g_testCase
=
TEST_CASE
;
int
sfd
;
int
sfd
;
...
@@ -363,7 +364,15 @@ int UdpTestNetif(void)
...
@@ -363,7 +364,15 @@ int UdpTestNetif(void)
/* close socket */
/* close socket */
ret
=
closesocket
(
sfd
);
ret
=
closesocket
(
sfd
);
LWIP_ASSERT
(
"socket invalid param."
,
ret
!=
-
1
);
LWIP_ASSERT
(
"socket invalid param."
,
ret
!=
-
1
);
return
LWIP_TEST_RET_OK
;
return
;
}
int
UdpTestNetif
()
{
int
ret
=
sys_thread_new
(
"udp_test_netif"
,
UdpTestNetifTask
,
NULL
,
STACK_TEST_SIZE
,
TCPIP_THREAD_PRIO
);
ICUNIT_ASSERT_NOT_EQUAL
(
ret
,
-
1
,
23
);
return
ret
;
}
}
static
void
ArpPackageProc
(
struct
netif
*
netif
,
struct
pbuf
*
p
)
static
void
ArpPackageProc
(
struct
netif
*
netif
,
struct
pbuf
*
p
)
...
...
components/net/test/net_socket_test_012.c
浏览文件 @
49be4058
...
@@ -45,7 +45,6 @@ static int g_portClient = STACK_PORT_TCP_DUP_START;
...
@@ -45,7 +45,6 @@ static int g_portClient = STACK_PORT_TCP_DUP_START;
static
char
g_bufServer
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_bufServer
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_bufClient
[
BUF_SIZE
+
1
]
=
{
0
};
static
char
g_bufClient
[
BUF_SIZE
+
1
]
=
{
0
};
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
int
SampleTcpServer
()
static
int
SampleTcpServer
()
{
{
...
...
components/net/test/net_socket_test_013.c
浏览文件 @
49be4058
...
@@ -38,8 +38,6 @@
...
@@ -38,8 +38,6 @@
#define STACK_PORT_TCP_LONG 2231
#define STACK_PORT_TCP_LONG 2231
#define TCP_LONG_BUF_SIZE (2 * 1024)
#define TCP_LONG_BUF_SIZE (2 * 1024)
extern
sys_thread_t
sys_thread_new
(
const
char
*
name
,
lwip_thread_fn
thread
,
void
*
arg
,
int
stackSize
,
int
prio
);
static
int
SampleTcpServer
()
static
int
SampleTcpServer
()
{
{
int
sfd
,
lsfd
;
int
sfd
,
lsfd
;
...
...
components/net/test/test_main.c
浏览文件 @
49be4058
...
@@ -119,7 +119,7 @@ static void LwipTestTimeoutCallback(void const *argument)
...
@@ -119,7 +119,7 @@ static void LwipTestTimeoutCallback(void const *argument)
osTimerId_t
g_lwipTestTimerId
=
NULL
;
osTimerId_t
g_lwipTestTimerId
=
NULL
;
void
LwipTestStartTimer
(
uint32
timeout
)
void
LwipTestStartTimer
(
uint32
_t
timeout
)
{
{
osStatus_t
status
;
osStatus_t
status
;
if
(
g_lwipTestTimerId
!=
NULL
)
{
if
(
g_lwipTestTimerId
!=
NULL
)
{
...
...
kal/cmsis/cmsis_liteos2.c
浏览文件 @
49be4058
...
@@ -58,7 +58,12 @@ static osKernelState_t g_kernelState;
...
@@ -58,7 +58,12 @@ static osKernelState_t g_kernelState;
extern
BOOL
g_taskScheduled
;
extern
BOOL
g_taskScheduled
;
#define LOS_PRIORITY_WIN 8
/* LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO <---> osPriorityNormal */
#define LOS_PRIORITY(cmsisPriority) (LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO - ((cmsisPriority) - osPriorityNormal))
#define CMSIS_PRIORITY(losPriority) (osPriorityNormal + (LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO - (losPriority)))
/* OS_TASK_PRIORITY_HIGHEST and OS_TASK_PRIORITY_LOWEST is reserved for internal TIMER and IDLE task use only. */
#define ISVALID_LOS_PRIORITY(losPrio) ((losPrio) > OS_TASK_PRIORITY_HIGHEST && (losPrio) < OS_TASK_PRIORITY_LOWEST)
const
osVersion_t
g_stLosVersion
=
{
001
,
001
};
const
osVersion_t
g_stLosVersion
=
{
001
,
001
};
...
@@ -74,8 +79,6 @@ const osVersion_t g_stLosVersion = { 001, 001 };
...
@@ -74,8 +79,6 @@ const osVersion_t g_stLosVersion = { 001, 001 };
#define KERNEL_ID "HUAWEI-LiteOS"
#define KERNEL_ID "HUAWEI-LiteOS"
// ==== Kernel Management Functions ====
// ==== Kernel Management Functions ====
uint32_t
osTaskStackWaterMarkGet
(
UINT32
taskID
);
osStatus_t
osKernelInitialize
(
void
)
osStatus_t
osKernelInitialize
(
void
)
{
{
...
@@ -285,23 +288,24 @@ osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr
...
@@ -285,23 +288,24 @@ osThreadId_t osThreadNew(osThreadFunc_t func, void *argument, const osThreadAttr
UINT32
uwTid
;
UINT32
uwTid
;
UINT32
uwRet
;
UINT32
uwRet
;
LosTaskCB
*
pstTaskCB
=
NULL
;
LosTaskCB
*
pstTaskCB
=
NULL
;
TSK_INIT_PARAM_S
stTskInitParam
;
TSK_INIT_PARAM_S
stTskInitParam
=
{
NULL
};
UINT16
usPriority
;
if
(
OS_INT_ACTIVE
)
{
if
(
OS_INT_ACTIVE
||
(
func
==
NULL
)
)
{
return
NULL
;
return
(
osThreadId_t
)
NULL
;
}
}
if
((
attr
==
NULL
)
||
(
func
==
NULL
)
||
(
attr
->
priority
<
osPriorityLow1
)
||
usPriority
=
attr
?
LOS_PRIORITY
(
attr
->
priority
)
:
LOSCFG_BASE_CORE_TSK_DEFAULT_PRIO
;
(
attr
->
priority
>
osPriorityAboveNormal6
))
{
if
(
!
ISVALID_LOS_PRIORITY
(
usPriority
))
{
/* unsupported priority */
return
(
osThreadId_t
)
NULL
;
return
(
osThreadId_t
)
NULL
;
}
}
(
void
)
memset_s
(
&
stTskInitParam
,
sizeof
(
TSK_INIT_PARAM_S
),
0
,
sizeof
(
TSK_INIT_PARAM_S
));
stTskInitParam
.
pfnTaskEntry
=
(
TSK_ENTRY_FUNC
)
func
;
stTskInitParam
.
pfnTaskEntry
=
(
TSK_ENTRY_FUNC
)
func
;
stTskInitParam
.
uwArg
=
(
UINT32
)
argument
;
stTskInitParam
.
uwArg
=
(
UINT32
)
argument
;
stTskInitParam
.
uwStackSize
=
attr
->
stack_size
;
stTskInitParam
.
uwStackSize
=
attr
?
attr
->
stack_size
:
LOSCFG_BASE_CORE_TSK_DEFAULT_STACK_SIZE
;
stTskInitParam
.
pcName
=
(
CHAR
*
)
attr
->
name
;
stTskInitParam
.
pcName
=
(
CHAR
*
)
(
attr
?
attr
->
name
:
"[NULL]"
)
;
stTskInitParam
.
usTaskPrio
=
OS_TASK_PRIORITY_LOWEST
-
((
UINT16
)(
attr
->
priority
)
-
LOS_PRIORITY_WIN
);
/* 0~31 */
stTskInitParam
.
usTaskPrio
=
usPriority
;
uwRet
=
LOS_TaskCreate
(
&
uwTid
,
&
stTskInitParam
);
uwRet
=
LOS_TaskCreate
(
&
uwTid
,
&
stTskInitParam
);
...
@@ -457,12 +461,12 @@ osStatus_t osThreadSetPriority(osThreadId_t thread_id, osPriority_t priority)
...
@@ -457,12 +461,12 @@ osStatus_t osThreadSetPriority(osThreadId_t thread_id, osPriority_t priority)
return
osErrorParameter
;
return
osErrorParameter
;
}
}
if
(
priority
<
osPriorityLow1
||
priority
>
osPriorityAboveNormal6
)
{
usPriority
=
LOS_PRIORITY
(
priority
);
if
(
!
ISVALID_LOS_PRIORITY
(
usPriority
))
{
return
osErrorParameter
;
return
osErrorParameter
;
}
}
pstTaskCB
=
(
LosTaskCB
*
)
thread_id
;
pstTaskCB
=
(
LosTaskCB
*
)
thread_id
;
usPriority
=
OS_TASK_PRIORITY_LOWEST
-
((
UINT16
)
priority
-
LOS_PRIORITY_WIN
);
uwRet
=
LOS_TaskPriSet
(
pstTaskCB
->
taskID
,
usPriority
);
uwRet
=
LOS_TaskPriSet
(
pstTaskCB
->
taskID
,
usPriority
);
switch
(
uwRet
)
{
switch
(
uwRet
)
{
case
LOS_ERRNO_TSK_PRIOR_ERROR
:
case
LOS_ERRNO_TSK_PRIOR_ERROR
:
...
@@ -495,7 +499,7 @@ osPriority_t osThreadGetPriority(osThreadId_t thread_id)
...
@@ -495,7 +499,7 @@ osPriority_t osThreadGetPriority(osThreadId_t thread_id)
return
osPriorityError
;
return
osPriorityError
;
}
}
return
(
osPriority_t
)
(
OS_TASK_PRIORITY_LOWEST
-
(
usRet
-
LOS_PRIORITY_WIN
)
);
return
(
osPriority_t
)
CMSIS_PRIORITY
(
usRet
);
}
}
...
@@ -865,7 +869,7 @@ uint32_t osEventFlagsGet(osEventFlagsId_t ef_id)
...
@@ -865,7 +869,7 @@ uint32_t osEventFlagsGet(osEventFlagsId_t ef_id)
uint32_t
rflags
;
uint32_t
rflags
;
if
(
pstEventCB
==
NULL
)
{
if
(
pstEventCB
==
NULL
)
{
return
(
uint32_t
)
osFlagsErrorParameter
;
return
0
;
}
}
uwIntSave
=
LOS_IntLock
();
uwIntSave
=
LOS_IntLock
();
...
...
kal/posix/include/limits.h
浏览文件 @
49be4058
...
@@ -7,6 +7,8 @@
...
@@ -7,6 +7,8 @@
#define PATH_MAX 256
#define PATH_MAX 256
#define MQ_PRIO_MAX 1
#define MQ_PRIO_MAX 1
#define PTHREAD_STACK_MIN LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
#define PTHREAD_STACK_MIN LOSCFG_BASE_CORE_TSK_MIN_STACK_SIZE
#define IOV_MAX 1024
#define SSIZE_MAX LONG_MAX
#include_next <limits.h>
#include_next <limits.h>
#else
#else
...
...
kal/posix/musl_src/network/h_errno.c
0 → 100644
浏览文件 @
49be4058
#include <netdb.h>
#undef h_errno
int
h_errno
;
int
*
__h_errno_location
(
void
)
{
return
&
h_errno
;
}
kernel/arch/arm/cortex-m3/keil/los_interrupt.c
浏览文件 @
49be4058
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
#include "los_context.h"
#include "los_context.h"
#include "los_arch_interrupt.h"
#include "los_arch_interrupt.h"
#include "los_debug.h"
#include "los_debug.h"
#include "los_hook.h"
#include "los_task.h"
#include "los_task.h"
#include "los_sched.h"
#include "los_sched.h"
#include "los_memory.h"
#include "los_memory.h"
...
@@ -180,6 +181,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -180,6 +181,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
hwiIndex
=
HalIntNumGet
();
hwiIndex
=
HalIntNumGet
();
OsHookCall
(
LOS_HOOK_TYPE_ISR_ENTER
,
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
#if (OS_HWI_WITH_ARG == 1)
#if (OS_HWI_WITH_ARG == 1)
...
@@ -194,6 +197,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -194,6 +197,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
HalAftInterruptHandler
(
hwiIndex
);
HalAftInterruptHandler
(
hwiIndex
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
intSave
=
LOS_IntLock
();
intSave
=
LOS_IntLock
();
g_intCount
--
;
g_intCount
--
;
LOS_IntRestore
(
intSave
);
LOS_IntRestore
(
intSave
);
...
...
kernel/arch/arm/cortex-m33/gcc/los_interrupt.c
浏览文件 @
49be4058
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "los_context.h"
#include "los_context.h"
#include "los_arch_interrupt.h"
#include "los_arch_interrupt.h"
#include "los_debug.h"
#include "los_debug.h"
#include "los_hook.h"
#include "los_task.h"
#include "los_task.h"
#include "los_sched.h"
#include "los_sched.h"
#include "los_memory.h"
#include "los_memory.h"
...
@@ -169,6 +170,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -169,6 +170,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
hwiIndex
=
HalIntNumGet
();
hwiIndex
=
HalIntNumGet
();
OsHookCall
(
LOS_HOOK_TYPE_ISR_ENTER
,
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
#if (OS_HWI_WITH_ARG == 1)
#if (OS_HWI_WITH_ARG == 1)
...
@@ -183,6 +186,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -183,6 +186,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
HalAftInterruptHandler
(
hwiIndex
);
HalAftInterruptHandler
(
hwiIndex
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
intSave
=
LOS_IntLock
();
intSave
=
LOS_IntLock
();
g_intCount
--
;
g_intCount
--
;
LOS_IntRestore
(
intSave
);
LOS_IntRestore
(
intSave
);
...
...
kernel/arch/arm/cortex-m4/gcc/los_interrupt.c
浏览文件 @
49be4058
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "los_context.h"
#include "los_context.h"
#include "los_arch_interrupt.h"
#include "los_arch_interrupt.h"
#include "los_debug.h"
#include "los_debug.h"
#include "los_hook.h"
#include "los_task.h"
#include "los_task.h"
#include "los_sched.h"
#include "los_sched.h"
#include "los_memory.h"
#include "los_memory.h"
...
@@ -179,6 +180,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -179,6 +180,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
hwiIndex
=
HalIntNumGet
();
hwiIndex
=
HalIntNumGet
();
OsHookCall
(
LOS_HOOK_TYPE_ISR_ENTER
,
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
#if (OS_HWI_WITH_ARG == 1)
#if (OS_HWI_WITH_ARG == 1)
...
@@ -193,6 +196,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -193,6 +196,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
HalAftInterruptHandler
(
hwiIndex
);
HalAftInterruptHandler
(
hwiIndex
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
intSave
=
LOS_IntLock
();
intSave
=
LOS_IntLock
();
g_intCount
--
;
g_intCount
--
;
LOS_IntRestore
(
intSave
);
LOS_IntRestore
(
intSave
);
...
...
kernel/arch/arm/cortex-m4/iar/los_interrupt.c
浏览文件 @
49be4058
...
@@ -199,11 +199,11 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -199,11 +199,11 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
HalAftInterruptHandler
(
hwiIndex
);
HalAftInterruptHandler
(
hwiIndex
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
intSave
=
LOS_IntLock
();
intSave
=
LOS_IntLock
();
g_intCount
--
;
g_intCount
--
;
LOS_IntRestore
(
intSave
);
LOS_IntRestore
(
intSave
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
}
}
/* ****************************************************************************
/* ****************************************************************************
...
...
kernel/arch/arm/cortex-m7/gcc/los_interrupt.c
浏览文件 @
49be4058
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
#include "los_context.h"
#include "los_context.h"
#include "los_arch_interrupt.h"
#include "los_arch_interrupt.h"
#include "los_debug.h"
#include "los_debug.h"
#include "los_hook.h"
#include "los_task.h"
#include "los_task.h"
#include "los_sched.h"
#include "los_sched.h"
#include "los_memory.h"
#include "los_memory.h"
...
@@ -169,6 +170,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -169,6 +170,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
hwiIndex
=
HalIntNumGet
();
hwiIndex
=
HalIntNumGet
();
OsHookCall
(
LOS_HOOK_TYPE_ISR_ENTER
,
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
HalPreInterruptHandler
(
hwiIndex
);
#if (OS_HWI_WITH_ARG == 1)
#if (OS_HWI_WITH_ARG == 1)
...
@@ -183,6 +186,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -183,6 +186,8 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
HalAftInterruptHandler
(
hwiIndex
);
HalAftInterruptHandler
(
hwiIndex
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
intSave
=
LOS_IntLock
();
intSave
=
LOS_IntLock
();
g_intCount
--
;
g_intCount
--
;
LOS_IntRestore
(
intSave
);
LOS_IntRestore
(
intSave
);
...
...
kernel/arch/arm/cortex-m7/iar/los_interrupt.c
浏览文件 @
49be4058
...
@@ -195,11 +195,11 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
...
@@ -195,11 +195,11 @@ LITE_OS_SEC_TEXT VOID HalInterrupt(VOID)
HalAftInterruptHandler
(
hwiIndex
);
HalAftInterruptHandler
(
hwiIndex
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
intSave
=
LOS_IntLock
();
intSave
=
LOS_IntLock
();
g_intCount
--
;
g_intCount
--
;
LOS_IntRestore
(
intSave
);
LOS_IntRestore
(
intSave
);
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiIndex
);
}
}
/* ****************************************************************************
/* ****************************************************************************
...
...
kernel/arch/risc-v/riscv32/gcc/los_interrupt.c
浏览文件 @
49be4058
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "los_task.h"
#include "los_task.h"
#include "los_sched.h"
#include "los_sched.h"
#include "los_debug.h"
#include "los_debug.h"
#include "los_hook.h"
#include "riscv_hal.h"
#include "riscv_hal.h"
#ifdef __cplusplus
#ifdef __cplusplus
...
@@ -121,12 +122,16 @@ __attribute__((section(".interrupt.text"))) VOID HalHwiInterruptDone(HWI_HANDLE_
...
@@ -121,12 +122,16 @@ __attribute__((section(".interrupt.text"))) VOID HalHwiInterruptDone(HWI_HANDLE_
{
{
g_intCount
++
;
g_intCount
++
;
OsHookCall
(
LOS_HOOK_TYPE_ISR_ENTER
,
hwiNum
);
HWI_HANDLE_FORM_S
*
hwiForm
=
&
g_hwiForm
[
hwiNum
];
HWI_HANDLE_FORM_S
*
hwiForm
=
&
g_hwiForm
[
hwiNum
];
HwiProcFunc
func
=
(
HwiProcFunc
)(
hwiForm
->
pfnHook
);
HwiProcFunc
func
=
(
HwiProcFunc
)(
hwiForm
->
pfnHook
);
func
(
hwiForm
->
uwParam
);
func
(
hwiForm
->
uwParam
);
++
g_hwiFormCnt
[
hwiNum
];
++
g_hwiFormCnt
[
hwiNum
];
OsHookCall
(
LOS_HOOK_TYPE_ISR_EXIT
,
hwiNum
);
g_intCount
--
;
g_intCount
--
;
}
}
...
...
targets/cortex-m3_stm32f103_simulator_keil/project/los_demo.uvproj
浏览文件 @
49be4058
...
@@ -512,6 +512,11 @@
...
@@ -512,6 +512,11 @@
<FileType>
1
</FileType>
<FileType>
1
</FileType>
<FilePath>
..\..\..\utils\los_error.c
</FilePath>
<FilePath>
..\..\..\utils\los_error.c
</FilePath>
</File>
</File>
<File>
<FileName>
los_hook.c
</FileName>
<FileType>
1
</FileType>
<FilePath>
..\..\..\utils\los_hook.c
</FilePath>
</File>
<File>
<File>
<FileName>
los_context.c
</FileName>
<FileName>
los_context.c
</FileName>
<FileType>
1
</FileType>
<FileType>
1
</FileType>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录