diff options
| author | Tiejun Zhou <[email protected]> | 2022-12-16 08:18:00 +0000 |
|---|---|---|
| committer | Tiejun Zhou <[email protected]> | 2022-12-16 08:18:00 +0000 |
| commit | a2f77b468f03e0f407f0f6cd1a88d09e6cf5ca28 (patch) | |
| tree | 36d3162662f66c3f339a0a0de8d5d7313475ff4a | |
| parent | 5fcaeaa42c8efa29562f209e514c1b2298723ef0 (diff) | |
Update on 16 Dec 2022. Expand to see details.
d9cb7cecd Removed the invalid check which would disable the function of clearing tcp_re...
0bea4ec98 [CLOUD]Fixed event clear function.
c6efa9ff5 Update link in Azure IoT readme.md
6937eb06e [Telnet Server] Correct the processing of disconnection.
a54496588 add new ports (M55 and M85) to NetX Duo
f4db567a0 Fix the build issue caused by the macros of NetX Duo be defined in nx_port.h...
d1951f19b add cmakelists file for m33 gnu
f7b967807 fix whitespace
f4bd13119 Fixed the issue which caused by driver entry pointer is NULL.
606e89cde Update compatibility in update manifest for ADU test case
16e54e1f2 Correct compatibility property name to match the values in import manifest
1c69327b1 Cleared the client ID to fix the issue of creating FTP client after deletion.
37 files changed, 2034 insertions, 265 deletions
diff --git a/addons/cloud/nx_cloud.c b/addons/cloud/nx_cloud.c index 703e7e27..928fde05 100644 --- a/addons/cloud/nx_cloud.c +++ b/addons/cloud/nx_cloud.c @@ -892,7 +892,7 @@ ULONG registered_event; /* FUNCTION RELEASE */ /* */ /* _nxe_cloud_module_event_clear PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ @@ -914,7 +914,7 @@ ULONG registered_event; /* */ /* CALLS */ /* */ -/* _nx_cloud_module_event_set Actual cloud module event */ +/* _nx_cloud_module_event_clear Actual cloud module event */ /* clear function */ /* */ /* CALLED BY */ @@ -926,6 +926,9 @@ ULONG registered_event; /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 Yuxin Zhou Initial Version 6.1 */ +/* xx-xx-xxxx Bo Chen Modified comment(s), fixed */ +/* event clear function, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _nxe_cloud_module_event_clear(NX_CLOUD_MODULE *cloud_module, ULONG module_own_event) @@ -945,8 +948,8 @@ UINT status; return(NX_CLOUD_MODULE_EVENT_INVALID); } - /* Call actual cloud module event set function. */ - status = _nx_cloud_module_event_set(cloud_module, module_own_event); + /* Call actual cloud module event clear function. */ + status = _nx_cloud_module_event_clear(cloud_module, module_own_event); /* Return completion status. */ return(status); diff --git a/addons/ftp/nxd_ftp_client.c b/addons/ftp/nxd_ftp_client.c index 3198edb3..989c567a 100644 --- a/addons/ftp/nxd_ftp_client.c +++ b/addons/ftp/nxd_ftp_client.c @@ -1106,7 +1106,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _nx_ftp_client_delete PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ @@ -1140,6 +1140,9 @@ UINT status; /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ /* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Wenhui Xie Modified comment(s), */ +/* cleared the client ID, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _nx_ftp_client_delete(NX_FTP_CLIENT *ftp_client_ptr) @@ -1153,6 +1156,9 @@ UINT _nx_ftp_client_delete(NX_FTP_CLIENT *ftp_client_ptr) return(NX_FTP_NOT_DISCONNECTED); } + /* Clear the client ID . */ + ftp_client_ptr -> nx_ftp_client_id = 0; + /* Delete the control and data sockets. */ nx_tcp_socket_delete(&(ftp_client_ptr -> nx_ftp_client_control_socket)); nx_tcp_socket_delete(&(ftp_client_ptr -> nx_ftp_client_data_socket)); diff --git a/addons/telnet/nxd_telnet_server.c b/addons/telnet/nxd_telnet_server.c index 8d24600c..b72a1ea7 100644 --- a/addons/telnet/nxd_telnet_server.c +++ b/addons/telnet/nxd_telnet_server.c @@ -595,7 +595,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _nx_telnet_server_disconnect PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ @@ -631,6 +631,10 @@ UINT status; /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ /* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Wenhui Xie Modified comment(s), and */ +/* corrected the processing of */ +/* disconnection, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _nx_telnet_server_disconnect(NX_TELNET_SERVER *server_ptr, UINT logical_connection) @@ -650,14 +654,6 @@ NX_TELNET_CLIENT_REQUEST *client_ptr; /* Disconnect the socket. */ nx_tcp_socket_disconnect(&(client_ptr -> nx_telnet_client_request_socket), NX_TELNET_SERVER_TIMEOUT); - /* Call the application's end connection callback routine. */ - if (server_ptr -> nx_telnet_connection_end) - { - - /* Yes, there is a connection end callback routine - call it! */ - (server_ptr -> nx_telnet_connection_end)(server_ptr, client_ptr -> nx_telnet_client_request_connection); - } - /* Unaccept this socket. */ nx_tcp_server_socket_unaccept(&(client_ptr -> nx_telnet_client_request_socket)); @@ -667,6 +663,14 @@ NX_TELNET_CLIENT_REQUEST *client_ptr; /* Clear the client request activity timeout. */ client_ptr -> nx_telnet_client_request_activity_timeout = 0; + + /* Call the application's end connection callback routine. */ + if (server_ptr -> nx_telnet_connection_end) + { + + /* Yes, there is a connection end callback routine - call it! */ + (server_ptr -> nx_telnet_connection_end)(server_ptr, client_ptr -> nx_telnet_client_request_connection); + } } else { diff --git a/common/src/nx_ip_interface_status_check.c b/common/src/nx_ip_interface_status_check.c index 1edfc816..e45731c7 100644 --- a/common/src/nx_ip_interface_status_check.c +++ b/common/src/nx_ip_interface_status_check.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _nx_ip_interface_status_check PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ @@ -79,6 +79,9 @@ /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ /* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* added driver entry check, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _nx_ip_interface_status_check(NX_IP *ip_ptr, UINT interface_index, ULONG needed_status, @@ -185,6 +188,14 @@ ULONG trace_timestamp; NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS, ip_ptr, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0); /* Call link level driver. */ + if(ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry == NX_NULL) + { + + /* Release mutex protection. */ + tx_mutex_put(&(ip_ptr -> nx_ip_protection)); + + return(NX_NOT_SUCCESSFUL); + } (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry)(&driver_request); /* If the driver does not recognize this keyword, we fall back to reading the IP link status.*/ @@ -254,6 +265,14 @@ ULONG trace_timestamp; NX_TRACE_IN_LINE_INSERT(NX_TRACE_INTERNAL_IO_DRIVER_GET_STATUS, ip_ptr, 0, 0, 0, NX_TRACE_INTERNAL_EVENTS, 0, 0); /* Call link level driver. */ + if(ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry == NX_NULL) + { + + /* Release mutex protection. */ + tx_mutex_put(&(ip_ptr -> nx_ip_protection)); + + return(NX_NOT_SUCCESSFUL); + } (ip_ptr -> nx_ip_interface[interface_index].nx_interface_link_driver_entry)(&driver_request); /* If the driver does not recognize this keyword, we fall back to reading the IP link status.*/ diff --git a/common/src/nxe_tcp_socket_receive_notify.c b/common/src/nxe_tcp_socket_receive_notify.c index e145110c..936efece 100644 --- a/common/src/nxe_tcp_socket_receive_notify.c +++ b/common/src/nxe_tcp_socket_receive_notify.c @@ -38,7 +38,7 @@ NX_CALLER_CHECKING_EXTERNS /* FUNCTION RELEASE */ /* */ /* _nxe_tcp_socket_receive_notify PORTABLE C */ -/* 6.1 */ +/* 6.x */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ @@ -75,6 +75,9 @@ NX_CALLER_CHECKING_EXTERNS /* 05-19-2020 Yuxin Zhou Initial Version 6.0 */ /* 09-30-2020 Yuxin Zhou Modified comment(s), */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed invalid check, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ UINT _nxe_tcp_socket_receive_notify(NX_TCP_SOCKET *socket_ptr, @@ -89,12 +92,6 @@ UINT status; return(NX_PTR_ERROR); } - /* Check for invalid input pointers. */ - if (tcp_receive_notify == NX_NULL) - { - return(NX_PTR_ERROR); - } - /* Check to see if TCP is enabled. */ if (!(socket_ptr -> nx_tcp_socket_ip_ptr) -> nx_ip_tcp_packet_receive) { diff --git a/ports/cortex_m0/gnu/inc/nx_port.h b/ports/cortex_m0/gnu/inc/nx_port.h index c464b0e8..228408ba 100644 --- a/ports/cortex_m0/gnu/inc/nx_port.h +++ b/ports/cortex_m0/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-M0/GNU */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -47,6 +47,9 @@ /* corrected the code of */ /* getting system state, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -70,16 +73,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_m0/iar/CMakeLists.txt b/ports/cortex_m0/iar/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m0/iar/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m23/gnu/inc/nx_port.h b/ports/cortex_m23/gnu/inc/nx_port.h index 276ea396..a9768ffe 100644 --- a/ports/cortex_m23/gnu/inc/nx_port.h +++ b/ports/cortex_m23/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-M23/GNU */ -/* 6.1.3 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -43,6 +43,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 12-31-2020 Yuxin Zhou Initial Version 6.1.3 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -66,16 +69,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_m3/gnu/inc/nx_port.h b/ports/cortex_m3/gnu/inc/nx_port.h index 9626ac2d..adf0b46c 100644 --- a/ports/cortex_m3/gnu/inc/nx_port.h +++ b/ports/cortex_m3/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-M3/GNU */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -47,6 +47,9 @@ /* corrected the code of */ /* getting system state, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -70,16 +73,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_m3/iar/CMakeLists.txt b/ports/cortex_m3/iar/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m3/iar/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m33/ac5/inc/nx_port.h b/ports/cortex_m33/ac5/inc/nx_port.h index 48780686..ba75cf0a 100644 --- a/ports/cortex_m33/ac5/inc/nx_port.h +++ b/ports/cortex_m33/ac5/inc/nx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** NetX Component */ /** */ /** Port Specific */ @@ -21,31 +21,34 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* nx_port.h Cortex-M33/AC5 */ -/* 6.1.11 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M33/AC5 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ -/* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the NetX */ -/* real-time TCP/IP function identically on a variety of different */ -/* processor architectures. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 12-31-2020 Yuxin Zhou Initial Version 6.1.3 */ /* 04-25-2022 Yuxin Zhou Modified comment(s), and */ /* renamed temporary variable, */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Scott Larson Modified comment(s), and */ +/* fixed whitespace, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -57,7 +60,7 @@ #ifdef NX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in nx_user.h. The defines in this file may +/* Yes, include the user defines in nx_user.h. The defines in this file may alternately be defined on the command line. */ #include "nx_user.h" @@ -74,12 +77,12 @@ #include <stdlib.h> -/* Define various constants for the port. */ +/* Define various constants for the port. */ #ifndef NX_IP_PERIODIC_RATE -#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for - ports with 10ms timer interrupts. This - value may be defined instead at the +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the command line and this value will not be used. */ #endif @@ -107,7 +110,7 @@ #define __SWAP32__(val) ((((val) & 0xFF000000) >> 24 ) | (((val) & 0x00FF0000) >> 8) \ - | (((val) & 0x0000FF00) << 8) | (((val) & 0x000000FF) << 24)) + | (((val) & 0x0000FF00) << 8) | (((val) & 0x000000FF) << 24)) #define __SWAP16__(val) ((((val) & 0xFF00) >> 8) | (((val) & 0x00FF) << 8)) @@ -203,8 +206,8 @@ /* Define the version ID of NetX. This may be utilized by the application. */ #ifdef NX_SYSTEM_INIT -CHAR _nx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/AC5 Version 6.2.0 *"; +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/AC5 Version 6.x *"; #else extern CHAR _nx_version_id[]; #endif diff --git a/ports/cortex_m33/ac6/CMakeLists.txt b/ports/cortex_m33/ac6/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m33/ac6/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m33/ac6/inc/nx_port.h b/ports/cortex_m33/ac6/inc/nx_port.h new file mode 100644 index 00000000..f85fdbb9 --- /dev/null +++ b/ports/cortex_m33/ac6/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M33/AC6 */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __builtin_bswap32(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __builtin_bswap16(arg) + + +#ifndef htonl +#define htonl(val) __builtin_bswap32(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __builtin_bswap32(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __builtin_bswap16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __builtin_bswap16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/AC6 Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m33/gnu/CMakeLists.txt b/ports/cortex_m33/gnu/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m33/gnu/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m33/gnu/inc/nx_port.h b/ports/cortex_m33/gnu/inc/nx_port.h index 506f1434..d71635c3 100644 --- a/ports/cortex_m33/gnu/inc/nx_port.h +++ b/ports/cortex_m33/gnu/inc/nx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** NetX Component */ /** */ /** Port Specific */ @@ -21,28 +21,32 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* nx_port.h Cortex-M33/GNU */ -/* 6.1.3 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M33/GNU */ +/* 6.x */ /* */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ -/* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the NetX */ -/* real-time TCP/IP function identically on a variety of different */ -/* processor architectures. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 12-31-2020 Yuxin Zhou Initial Version 6.1.3 */ +/* xx-xx-xxxx Scott Larson Modified comment(s), and */ +/* fixed whitespace, */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -54,7 +58,7 @@ #ifdef NX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in nx_user.h. The defines in this file may +/* Yes, include the user defines in nx_user.h. The defines in this file may alternately be defined on the command line. */ #include "nx_user.h" @@ -66,27 +70,17 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> -/* Define various constants for the port. */ +/* Define various constants for the port. */ #ifndef NX_IP_PERIODIC_RATE -#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for - ports with 10ms timer interrupts. This - value may be defined instead at the +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the command line and this value will not be used. */ #endif @@ -189,8 +183,8 @@ /* Define the version ID of NetX. This may be utilized by the application. */ #ifdef NX_SYSTEM_INIT -CHAR _nx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/GNU Version 6.2.0 *"; +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/GNU Version 6.x *"; #else extern CHAR _nx_version_id[]; #endif diff --git a/ports/cortex_m33/iar/inc/nx_port.h b/ports/cortex_m33/iar/inc/nx_port.h index c4c14ec6..82fa52d7 100644 --- a/ports/cortex_m33/iar/inc/nx_port.h +++ b/ports/cortex_m33/iar/inc/nx_port.h @@ -12,7 +12,7 @@ /**************************************************************************/ /**************************************************************************/ -/** */ +/** */ /** NetX Component */ /** */ /** Port Specific */ @@ -21,28 +21,31 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* PORT SPECIFIC C INFORMATION RELEASE */ -/* */ -/* nx_port.h Cortex-M33/IAR */ -/* 6.1.3 */ +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M33/IAR */ +/* 6.x */ /* */ /* AUTHOR */ /* */ /* Yuxin Zhou, Microsoft Corporation */ /* */ -/* DESCRIPTION */ -/* */ -/* This file contains data type definitions that make the NetX */ -/* real-time TCP/IP function identically on a variety of different */ -/* processor architectures. */ -/* */ -/* RELEASE HISTORY */ -/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ /* DATE NAME DESCRIPTION */ /* */ /* 12-31-2020 Yuxin Zhou Initial Version 6.1.3 */ +/* xx-xx-xxxx Scott Larson Modified comment(s), and */ +/* fixed whitespace, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -54,7 +57,7 @@ #ifdef NX_INCLUDE_USER_DEFINE_FILE -/* Yes, include the user defines in nx_user.h. The defines in this file may +/* Yes, include the user defines in nx_user.h. The defines in this file may alternately be defined on the command line. */ #include "nx_user.h" @@ -71,12 +74,12 @@ #include <stdlib.h> -/* Define various constants for the port. */ +/* Define various constants for the port. */ #ifndef NX_IP_PERIODIC_RATE -#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for - ports with 10ms timer interrupts. This - value may be defined instead at the +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the command line and this value will not be used. */ #endif @@ -180,8 +183,8 @@ /* Define the version ID of NetX. This may be utilized by the application. */ #ifdef NX_SYSTEM_INIT -CHAR _nx_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/IAR Version 6.2.0 *"; +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M33/IAR Version 6.x *"; #else extern CHAR _nx_version_id[]; #endif diff --git a/ports/cortex_m4/gnu/inc/nx_port.h b/ports/cortex_m4/gnu/inc/nx_port.h index 5ff46357..cc8de360 100644 --- a/ports/cortex_m4/gnu/inc/nx_port.h +++ b/ports/cortex_m4/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-M4/GNU */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -47,6 +47,9 @@ /* corrected the code of */ /* getting system state, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -70,16 +73,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_m4/iar/CMakeLists.txt b/ports/cortex_m4/iar/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m4/iar/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m55/ac5/inc/nx_port.h b/ports/cortex_m55/ac5/inc/nx_port.h new file mode 100644 index 00000000..1db6bfcd --- /dev/null +++ b/ports/cortex_m55/ac5/inc/nx_port.h @@ -0,0 +1,209 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M55/AC5 */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) \ + { \ + ULONG _i; \ + ULONG _tmp; \ + _i = (UINT)arg; \ + /* _i = A, B, C, D */ \ + _tmp = _i ^ (((_i) >> 16) | (_i << 16)); \ + /* _tmp = _i ^ (_i ROR 16) = A^C, B^D, C^A, D^B */ \ + _tmp &= 0xff00ffff; \ + /* _tmp = A^C, 0, C^A, D^B */ \ + _i = ((_i) >> 8) | (_i<<24); \ + /* _i = D, A, B, C */ \ + _i = _i ^ ((_tmp) >> 8); \ + /* _i = D, C, B, A */ \ + arg = _i; \ + } +#define NX_CHANGE_USHORT_ENDIAN(a) a = (((a >> 8) | (a << 8)) & 0xFFFF) + + +#define __SWAP32__(val) ((((val) & 0xFF000000) >> 24 ) | (((val) & 0x00FF0000) >> 8) \ + | (((val) & 0x0000FF00) << 8) | (((val) & 0x000000FF) << 24)) + +#define __SWAP16__(val) ((((val) & 0xFF00) >> 8) | (((val) & 0x00FF) << 8)) + + +#ifndef htonl +#define htonl(val) __SWAP32__(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __SWAP32__(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __SWAP16__(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __SWAP16__(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M55/AC5 Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m55/ac6/CMakeLists.txt b/ports/cortex_m55/ac6/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m55/ac6/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m55/ac6/inc/nx_port.h b/ports/cortex_m55/ac6/inc/nx_port.h new file mode 100644 index 00000000..415f6f13 --- /dev/null +++ b/ports/cortex_m55/ac6/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M55/AC6 */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __builtin_bswap32(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __builtin_bswap16(arg) + + +#ifndef htonl +#define htonl(val) __builtin_bswap32(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __builtin_bswap32(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __builtin_bswap16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __builtin_bswap16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M55/AC6 Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m55/gnu/CMakeLists.txt b/ports/cortex_m55/gnu/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m55/gnu/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m55/gnu/inc/nx_port.h b/ports/cortex_m55/gnu/inc/nx_port.h new file mode 100644 index 00000000..a1202357 --- /dev/null +++ b/ports/cortex_m55/gnu/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M55/GNU */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __builtin_bswap32(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __builtin_bswap16(arg) + + +#ifndef htonl +#define htonl(val) __builtin_bswap32(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __builtin_bswap32(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __builtin_bswap16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __builtin_bswap16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M55/GNU Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m55/iar/inc/nx_port.h b/ports/cortex_m55/iar/inc/nx_port.h new file mode 100644 index 00000000..bfc7a599 --- /dev/null +++ b/ports/cortex_m55/iar/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M55/IAR */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __REV(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __REV16(arg) + + +#ifndef htonl +#define htonl(val) __REV(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __REV(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __REV16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __REV16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M55/IAR Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m7/gnu/inc/nx_port.h b/ports/cortex_m7/gnu/inc/nx_port.h index bf2645ce..bc7c9a79 100644 --- a/ports/cortex_m7/gnu/inc/nx_port.h +++ b/ports/cortex_m7/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-M7/GNU */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -47,6 +47,9 @@ /* corrected the code of */ /* getting system state, */ /* resulting in version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -70,16 +73,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_m7/iar/CMakeLists.txt b/ports/cortex_m7/iar/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m7/iar/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m85/ac5/inc/nx_port.h b/ports/cortex_m85/ac5/inc/nx_port.h new file mode 100644 index 00000000..93269270 --- /dev/null +++ b/ports/cortex_m85/ac5/inc/nx_port.h @@ -0,0 +1,209 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M85/AC5 */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) \ + { \ + ULONG _i; \ + ULONG _tmp; \ + _i = (UINT)arg; \ + /* _i = A, B, C, D */ \ + _tmp = _i ^ (((_i) >> 16) | (_i << 16)); \ + /* _tmp = _i ^ (_i ROR 16) = A^C, B^D, C^A, D^B */ \ + _tmp &= 0xff00ffff; \ + /* _tmp = A^C, 0, C^A, D^B */ \ + _i = ((_i) >> 8) | (_i<<24); \ + /* _i = D, A, B, C */ \ + _i = _i ^ ((_tmp) >> 8); \ + /* _i = D, C, B, A */ \ + arg = _i; \ + } +#define NX_CHANGE_USHORT_ENDIAN(a) a = (((a >> 8) | (a << 8)) & 0xFFFF) + + +#define __SWAP32__(val) ((((val) & 0xFF000000) >> 24 ) | (((val) & 0x00FF0000) >> 8) \ + | (((val) & 0x0000FF00) << 8) | (((val) & 0x000000FF) << 24)) + +#define __SWAP16__(val) ((((val) & 0xFF00) >> 8) | (((val) & 0x00FF) << 8)) + + +#ifndef htonl +#define htonl(val) __SWAP32__(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __SWAP32__(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __SWAP16__(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __SWAP16__(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M85/AC5 Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m85/ac6/CMakeLists.txt b/ports/cortex_m85/ac6/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m85/ac6/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m85/ac6/inc/nx_port.h b/ports/cortex_m85/ac6/inc/nx_port.h new file mode 100644 index 00000000..07a826c5 --- /dev/null +++ b/ports/cortex_m85/ac6/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M85/AC6 */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __builtin_bswap32(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __builtin_bswap16(arg) + + +#ifndef htonl +#define htonl(val) __builtin_bswap32(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __builtin_bswap32(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __builtin_bswap16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __builtin_bswap16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M85/AC6 Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m85/gnu/CMakeLists.txt b/ports/cortex_m85/gnu/CMakeLists.txt new file mode 100644 index 00000000..75c79531 --- /dev/null +++ b/ports/cortex_m85/gnu/CMakeLists.txt @@ -0,0 +1,9 @@ +target_sources(${PROJECT_NAME} PRIVATE + # {{BEGIN_TARGET_SOURCES}} + + # {{END_TARGET_SOURCES}} +) + +target_include_directories(${PROJECT_NAME} PUBLIC + ${CMAKE_CURRENT_LIST_DIR}/inc +) diff --git a/ports/cortex_m85/gnu/inc/nx_port.h b/ports/cortex_m85/gnu/inc/nx_port.h new file mode 100644 index 00000000..a0f8a268 --- /dev/null +++ b/ports/cortex_m85/gnu/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M85/GNU */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __builtin_bswap32(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __builtin_bswap16(arg) + + +#ifndef htonl +#define htonl(val) __builtin_bswap32(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __builtin_bswap32(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __builtin_bswap16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __builtin_bswap16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M85/GNU Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_m85/iar/inc/nx_port.h b/ports/cortex_m85/iar/inc/nx_port.h new file mode 100644 index 00000000..25257594 --- /dev/null +++ b/ports/cortex_m85/iar/inc/nx_port.h @@ -0,0 +1,188 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** NetX Component */ +/** */ +/** Port Specific */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/**************************************************************************/ +/* */ +/* PORT SPECIFIC C INFORMATION RELEASE */ +/* */ +/* nx_port.h Cortex-M85/IAR */ +/* 6.x */ +/* */ +/* AUTHOR */ +/* */ +/* Scott Larson, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This file contains data type definitions that make the NetX */ +/* real-time TCP/IP function identically on a variety of different */ +/* processor architectures. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* xx-xx-xxxx Scott Larson Initial Version 6.x */ +/* */ +/**************************************************************************/ + +#ifndef NX_PORT_H +#define NX_PORT_H + +/* Determine if the optional NetX user define file should be used. */ + +#ifdef NX_INCLUDE_USER_DEFINE_FILE + + +/* Yes, include the user defines in nx_user.h. The defines in this file may + alternately be defined on the command line. */ + +#include "nx_user.h" +#endif + + +/* Default to little endian, since this is what most ARM targets are. */ + +#define NX_LITTLE_ENDIAN 1 + + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + + +/* Define various constants for the port. */ + +#ifndef NX_IP_PERIODIC_RATE +#define NX_IP_PERIODIC_RATE 100 /* Default IP periodic rate of 1 second for + ports with 10ms timer interrupts. This + value may be defined instead at the + command line and this value will not be + used. */ +#endif + + +/* Define macros that swap the endian for little endian ports. */ +#ifdef NX_LITTLE_ENDIAN +#define NX_CHANGE_ULONG_ENDIAN(arg) (arg) = __REV(arg) +#define NX_CHANGE_USHORT_ENDIAN(arg) (arg) = __REV16(arg) + + +#ifndef htonl +#define htonl(val) __REV(val) +#endif /* htonl */ +#ifndef ntohl +#define ntohl(val) __REV(val) +#endif /* htonl */ + +#ifndef htons +#define htons(val) __REV16(val) +#endif /*htons */ + +#ifndef ntohs +#define ntohs(val) __REV16(val) +#endif /*htons */ + + +#else +#define NX_CHANGE_ULONG_ENDIAN(a) +#define NX_CHANGE_USHORT_ENDIAN(a) + +#ifndef htons +#define htons(val) (val) +#endif /* htons */ + +#ifndef ntohs +#define ntohs(val) (val) +#endif /* ntohs */ + +#ifndef ntohl +#define ntohl(val) (val) +#endif + +#ifndef htonl +#define htonl(val) (val) +#endif /* htonl */ +#endif + + +/* Define several macros for the error checking shell in NetX. */ + +#ifndef TX_TIMER_PROCESS_IN_ISR + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern TX_THREAD _tx_timer_thread; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) || \ + (_tx_thread_current_ptr == &_tx_timer_thread)) \ + return(NX_CALLER_ERROR); + + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()) || (_tx_thread_current_ptr == &_tx_timer_thread))) \ + return(NX_CALLER_ERROR); + + +#else + + + +#define NX_CALLER_CHECKING_EXTERNS extern TX_THREAD *_tx_thread_current_ptr; \ + extern volatile ULONG _tx_thread_system_state; + +#define NX_THREADS_ONLY_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) || \ + (_tx_thread_current_ptr == TX_NULL)) \ + return(NX_CALLER_ERROR); + +#define NX_INIT_AND_THREADS_CALLER_CHECKING if (((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0)))) \ + return(NX_CALLER_ERROR); + +#define NX_NOT_ISR_CALLER_CHECKING if ((TX_THREAD_GET_SYSTEM_STATE()) && (TX_THREAD_GET_SYSTEM_STATE() < ((ULONG) 0xF0F0F0F0))) \ + return(NX_CALLER_ERROR); + +#define NX_THREAD_WAIT_CALLER_CHECKING if ((wait_option) && \ + ((_tx_thread_current_ptr == NX_NULL) || (TX_THREAD_GET_SYSTEM_STATE()))) \ + return(NX_CALLER_ERROR); + +#endif + + +/* Define the version ID of NetX. This may be utilized by the application. */ + +#ifdef NX_SYSTEM_INIT +CHAR _nx_version_id[] = + "Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M85/IAR Version 6.x *"; +#else +extern CHAR _nx_version_id[]; +#endif + +#endif diff --git a/ports/cortex_r4/ac6/inc/nx_port.h b/ports/cortex_r4/ac6/inc/nx_port.h index cd6f5acb..31c473ab 100644 --- a/ports/cortex_r4/ac6/inc/nx_port.h +++ b/ports/cortex_r4/ac6/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-R4/AC6 */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -43,6 +43,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 Yuxin Zhou Initial Version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -66,16 +69,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_r4/gnu/inc/nx_port.h b/ports/cortex_r4/gnu/inc/nx_port.h index a34f5cc3..b9041395 100644 --- a/ports/cortex_r4/gnu/inc/nx_port.h +++ b/ports/cortex_r4/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-R4/GNU */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -43,6 +43,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 Yuxin Zhou Initial Version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -66,16 +69,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/cortex_r5/gnu/inc/nx_port.h b/ports/cortex_r5/gnu/inc/nx_port.h index b8b2c8d9..b3560b8e 100644 --- a/ports/cortex_r5/gnu/inc/nx_port.h +++ b/ports/cortex_r5/gnu/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h Cortex-R5/GNU */ -/* 6.1 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -43,6 +43,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 09-30-2020 Yuxin Zhou Initial Version 6.1 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -66,16 +69,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/ports/rxv2/ccrx/inc/nx_port.h b/ports/rxv2/ccrx/inc/nx_port.h index 2e257b46..348707dc 100644 --- a/ports/rxv2/ccrx/inc/nx_port.h +++ b/ports/rxv2/ccrx/inc/nx_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* nx_port.h RXv2/CCRX */ -/* 6.1.11 */ +/* 6.x */ /* */ /* AUTHOR */ /* */ @@ -46,6 +46,9 @@ /* 04-25-2022 Yuxin Zhou Modified comment(s), and */ /* renamed temporary variable, */ /* resulting in version 6.1.11 */ +/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* removed duplicated macros, */ +/* resulting in version 6.x */ /* */ /**************************************************************************/ @@ -69,16 +72,6 @@ #define NX_LITTLE_ENDIAN 1 -/* By default IPv6 is enabled. */ - -#ifndef FEATURE_NX_IPV6 -#define FEATURE_NX_IPV6 -#endif /* FEATURE_NX_IPV6 */ - -#ifdef NX_DISABLE_IPV6 -#undef FEATURE_NX_IPV6 -#endif /* !NX_DISABLE_IPV6 */ - #include <stdio.h> #include <string.h> #include <stdlib.h> diff --git a/utility/iperf/nx_iperf.c b/utility/iperf/nx_iperf.c index d94e10cf..907b5ad8 100644 --- a/utility/iperf/nx_iperf.c +++ b/utility/iperf/nx_iperf.c @@ -115,6 +115,50 @@ void nx_iperf_entry(NX_PACKET_POOL *pool_ptr, NX_IP *ip_ptr, UCHAR *http_stac { UINT status; + /* Create a TCP server socket. */ + status = nx_tcp_socket_create(nx_iperf_test_ip, &tcp_server_socket, "TCP Server Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 32 * 1024, + NX_NULL, nx_iperf_tcp_rx_disconnect_received); + + /* Check for error. */ + if (status) + { + nx_iperf_test_error_counter++; + return; + } + + /* Create a TCP client socket. */ + status = nx_tcp_socket_create(nx_iperf_test_ip, &tcp_client_socket, "TCP Client Socket", + NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 32 * 1024, + NX_NULL, NX_NULL); + + /* Check for error. */ + if (status) + { + nx_iperf_test_error_counter++; + return; + } + + /* Create a UDP server socket. */ + status = nx_udp_socket_create(nx_iperf_test_ip, &udp_server_socket, "UDP Server Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + nx_iperf_test_error_counter++; + return; + } + + /* Create a UDP client socket. */ + status = nx_udp_socket_create(nx_iperf_test_ip, &udp_client_socket, "UDP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); + + /* Check status. */ + if (status) + { + nx_iperf_test_error_counter++; + return; + } + /* Create the HTTP Server. */ status = nx_web_http_server_create(&nx_iperf_web_server, "My HTTP Server", ip_ptr, NX_WEB_HTTP_SERVER_PORT, &nx_iperf_ram_disk, http_stack, http_stack_size, pool_ptr, nx_iperf_authentication_check, nx_iperf_get_notify); @@ -1580,25 +1624,12 @@ ULONG port; return; } - /* Create a socket. */ - status = nx_tcp_socket_create(nx_iperf_test_ip, &tcp_server_socket, "TCP Server Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 32 * 1024, - NX_NULL, nx_iperf_tcp_rx_disconnect_received); - - /* Check for error. */ - if (status) - { - error_counter++; - return; - } - /* Setup this thread to listen. */ status = nx_tcp_server_socket_listen(nx_iperf_test_ip, NX_IPERF_TCP_RX_PORT, &tcp_server_socket, 5, nx_iperf_tcp_rx_connect_received); /* Check for error. */ if (status) { - nx_tcp_socket_delete(&tcp_server_socket); error_counter++; return; } @@ -1613,7 +1644,6 @@ ULONG port; if (status) { nx_tcp_server_socket_unlisten(nx_iperf_test_ip, NX_IPERF_TCP_RX_PORT); - nx_tcp_socket_delete(&tcp_server_socket); error_counter++; return; } @@ -1624,7 +1654,6 @@ ULONG port; { nx_tcp_server_socket_unaccept(&tcp_server_socket); nx_tcp_server_socket_unlisten(nx_iperf_test_ip, NX_IPERF_TCP_RX_PORT); - nx_tcp_socket_delete(&tcp_server_socket); error_counter++; return; } @@ -1710,9 +1739,6 @@ ULONG port; { ctrlInfo_ptr -> ErrorCode = error_counter; } - - /* Delete the socket. */ - nx_tcp_socket_delete(&tcp_server_socket); } void nx_iperf_tcp_rx_connect_received(NX_TCP_SOCKET *socket_ptr, UINT port) @@ -1738,7 +1764,6 @@ void nx_iperf_tcp_rx_cleanup(void) nx_tcp_socket_disconnect(&tcp_server_socket, NX_NO_WAIT); nx_tcp_server_socket_unaccept(&tcp_server_socket); nx_tcp_server_socket_unlisten(nx_iperf_test_ip, NX_IPERF_TCP_RX_PORT); - nx_tcp_socket_delete(&tcp_server_socket); tx_thread_terminate(&thread_tcp_rx_iperf); tx_thread_delete(&thread_tcp_rx_iperf); @@ -1814,25 +1839,12 @@ NXD_ADDRESS server_ip; /* TCP Transmit Test Starts in 2 seconds. */ tx_thread_sleep(200); - /* Create the socket. */ - status = nx_tcp_socket_create(nx_iperf_test_ip, &tcp_client_socket, "TCP Client Socket", - NX_IP_NORMAL, NX_FRAGMENT_OKAY, NX_IP_TIME_TO_LIVE, 32 * 1024, - NX_NULL, NX_NULL); - - /* Check for error. */ - if (status) - { - error_counter++; - return; - } - /* Bind the socket. */ status = nx_tcp_client_socket_bind(&tcp_client_socket, NX_ANY_PORT, NX_WAIT_FOREVER); /* Check for error. */ if (status) { - nx_tcp_socket_delete(&tcp_client_socket); error_counter++; return; } @@ -1844,7 +1856,6 @@ NXD_ADDRESS server_ip; if (status) { nx_tcp_client_socket_unbind(&tcp_client_socket); - nx_tcp_socket_delete(&tcp_client_socket); error_counter++; return; } @@ -1867,7 +1878,6 @@ NXD_ADDRESS server_ip; { nx_tcp_socket_disconnect(&tcp_client_socket, NX_NO_WAIT); nx_tcp_client_socket_unbind(&tcp_client_socket); - nx_tcp_socket_delete(&tcp_client_socket); error_counter++; return; } @@ -1995,16 +2005,12 @@ NXD_ADDRESS server_ip; { ctrlInfo_ptr -> ErrorCode = error_counter; } - - /* Delete the socket. */ - nx_tcp_socket_delete(&tcp_client_socket); } void nx_iperf_tcp_tx_cleanup(void) { nx_tcp_socket_disconnect(&tcp_client_socket, NX_NO_WAIT); nx_tcp_client_socket_unbind(&tcp_client_socket); - nx_tcp_socket_delete(&tcp_client_socket); tx_thread_terminate(&thread_tcp_tx_iperf); tx_thread_delete(&thread_tcp_tx_iperf); @@ -2056,23 +2062,12 @@ NXD_ADDRESS source_ip_address; ctrlInfo_ptr -> RunTime = 0; ctrlInfo_ptr -> ErrorCode = 0; - /* Create a UDP socket. */ - status = nx_udp_socket_create(nx_iperf_test_ip, &udp_server_socket, "UDP Server Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); - - /* Check status. */ - if (status) - { - error_counter++; - return; - } - /* Bind the UDP socket to the IP port. */ status = nx_udp_socket_bind(&udp_server_socket, NX_IPERF_UDP_RX_PORT, TX_WAIT_FOREVER); /* Check status. */ if (status) { - nx_udp_socket_delete(&udp_server_socket); error_counter++; return; } @@ -2087,7 +2082,6 @@ NXD_ADDRESS source_ip_address; if (status) { nx_udp_socket_unbind(&udp_server_socket); - nx_udp_socket_delete(&udp_server_socket); error_counter++; return; } @@ -2236,9 +2230,8 @@ NXD_ADDRESS source_ip_address; ctrlInfo_ptr -> idleTime = (ULONG)((unsigned long long)idle_time * 100 / ((unsigned long long)thread_time + (unsigned long long)isr_time + (unsigned long long)idle_time)); #endif - /* Unbind and Delete the socket. */ + /* Unbind the socket. */ nx_udp_socket_unbind(&udp_server_socket); - nx_udp_socket_delete(&udp_server_socket); /* Check error counter. */ if (error_counter) @@ -2250,7 +2243,6 @@ NXD_ADDRESS source_ip_address; void nx_iperf_udp_rx_cleanup(void) { nx_udp_socket_unbind(&udp_server_socket); - nx_udp_socket_delete(&udp_server_socket); tx_thread_terminate(&thread_udp_rx_iperf); tx_thread_delete(&thread_udp_rx_iperf); @@ -2362,23 +2354,12 @@ long udp_id; /* UDP Transmit Test Starts in 2 seconds. */ tx_thread_sleep(200); - /* Create a UDP socket. */ - status = nx_udp_socket_create(nx_iperf_test_ip, &udp_client_socket, "UDP Client Socket", NX_IP_NORMAL, NX_FRAGMENT_OKAY, 0x80, 5); - - /* Check status. */ - if (status) - { - error_counter++; - return; - } - /* Bind the UDP socket to the IP port. */ status = nx_udp_socket_bind(&udp_client_socket, NX_ANY_PORT, TX_WAIT_FOREVER); /* Check status. */ if (status) { - nx_udp_socket_delete(&udp_client_socket); error_counter++; return; } @@ -2443,15 +2424,13 @@ long udp_id; } } - /* Unbind and Delete the socket. */ + /* Unbind the socket. */ nx_udp_socket_unbind(&udp_client_socket); - nx_udp_socket_delete(&udp_client_socket); } void nx_iperf_udp_tx_cleanup(void) { nx_udp_socket_unbind(&udp_client_socket); - nx_udp_socket_delete(&udp_client_socket); tx_thread_terminate(&thread_udp_tx_iperf); tx_thread_delete(&thread_udp_tx_iperf); } |
