1
10
13
14
20
21
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
155
156
159
160
161
163
164
167
168
169
170
171
172
173
174
175
176
179
180
182
183
185
186
189
190
191
192
193
194
195
196
198
199
200
201
202
203
...
...
...
...
...
#ifndef NX_PORT_H
#define NX_PORT_H
#ifdef NX_INCLUDE_USER_DEFINE_FILE
/* ... */
#include "nx_user.h"
/* ... */#endif
#define NX_LITTLE_ENDIAN 1
#ifndef FEATURE_NX_IPV6
#define FEATURE_NX_IPV6
#endif
#ifdef NX_DISABLE_IPV6
#undef FEATURE_NX_IPV6
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#ifndef NX_IP_PERIODIC_RATE
#define NX_IP_PERIODIC_RATE 100
/* ... */
/* ... */#endif
#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
#ifndef ntohl
#define ntohl(val) __builtin_bswap32(val)
#endif
#ifndef htons
#define htons(val) __builtin_bswap16(val)
#endif
#ifndef ntohs
#define ntohs(val) __builtin_bswap16(val)
#endif
/* ... */
#else
#define NX_CHANGE_ULONG_ENDIAN(a)
#define NX_CHANGE_USHORT_ENDIAN(a)
#ifndef htons
#define htons(val) (val)
#endif
#ifndef ntohs
#define ntohs(val) (val)
#endif
#ifndef ntohl
#define ntohl(val) (val)
#endif
#ifndef htonl
#define htonl(val) (val)
#endif /* ... */
#endif
#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);...
5 defines
/* ... */
#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);...
5 defines
/* ... */#endif
#ifdef NX_SYSTEM_INIT
CHAR _nx_version_id[] =
"Copyright (c) Microsoft Corporation. All rights reserved. * NetX Duo Cortex-M4/GNU Version 6.1.10 *";/* ... */
#else
extern CHAR _nx_version_id[];
#endif
/* ... */
#endif...