summaryrefslogtreecommitdiff
path: root/ports/cortex_m23/gnu
diff options
context:
space:
mode:
authorScott Larson <[email protected]>2021-01-07 18:16:40 -0800
committerScott Larson <[email protected]>2021-01-07 18:16:40 -0800
commit699d64dc5e4ef6cedd42401bc10cf9f3be0b476b (patch)
treed0e31ccb944f81f30b83184b49f19dd337cc5adc /ports/cortex_m23/gnu
parentf66451ca193a96b5734e9a99d6d0ed9de44c9ac5 (diff)
update to v6.1.3
Diffstat (limited to 'ports/cortex_m23/gnu')
-rw-r--r--ports/cortex_m23/gnu/inc/nx_port.h199
1 files changed, 199 insertions, 0 deletions
diff --git a/ports/cortex_m23/gnu/inc/nx_port.h b/ports/cortex_m23/gnu/inc/nx_port.h
new file mode 100644
index 00000000..f7b75879
--- /dev/null
+++ b/ports/cortex_m23/gnu/inc/nx_port.h
@@ -0,0 +1,199 @@
+/**************************************************************************/
+/* */
+/* 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-M23/GNU */
+/* 6.1.3 */
+/* */
+/* 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 */
+/* */
+/* DATE NAME DESCRIPTION */
+/* */
+/* 12-31-2020 Yuxin Zhou Initial Version 6.1.3 */
+/* */
+/**************************************************************************/
+
+#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
+
+
+/* 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. */
+
+#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-M23/GNU Version 6.1.3 *";
+#else
+extern CHAR _nx_version_id[];
+#endif
+
+#endif
+