From b85c8731d9024e826d8f65e3de981c6c76518db7 Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Wed, 3 Aug 2016 15:18:28 +0100 Subject: [PATCH 1/6] Replace BIG_ENDIAN with NETMF_TARGET_BIG_ENDIAN and LITTLE_ENDIAN with NETMF_TARGET_LITTLE_ENDIAN Fixes #481 --- Application/TinyBooter/Commands.cpp | 10 +- Application/TinyBooter/Commands.h | 2 +- CLR/Core/CLR_RT_HeapBlock.cpp | 8 +- CLR/Core/CLR_RT_HeapBlock_Array.cpp | 2 +- CLR/Core/Execution.cpp | 2 +- CLR/Core/Serialization/BinaryFormatter.cpp | 2 +- CLR/Core/Streams.cpp | 2 +- CLR/Core/TypeSystem.cpp | 4 +- CLR/Debugger/Debugger.cpp | 4 +- CLR/Include/TinyCLR_Messaging.h | 2 +- CLR/Include/TinyCLR_PlatformDef.h | 23 ++-- CLR/Include/TinyCLR_Runtime__HeapBlock.h | 30 ++--- CLR/Include/TinyCLR_Types.h | 22 ++-- ...untime_CompilerServices_RuntimeHelpers.cpp | 4 +- ...Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp | 6 +- CLR/Messaging/Messaging.cpp | 8 +- CLR/Messaging/Messaging_stub.cpp | 2 +- DeviceCode/include/Sockets_decl.h | 2 +- DeviceCode/include/TinyCLR_Endian.h | 4 +- DeviceCode/pal/graphics/graphics.cpp | 2 +- .../pal/lwip_1_4_1_os/lwip/src/core/def.c | 4 +- .../lwip/src/core/snmp/asn1_dec.c | 4 +- .../lwip/src/include/ipv4/lwip/inet_chksum.h | 6 +- .../lwip/src/include/ipv4/lwip/ip_addr.h | 2 +- .../lwip/src/include/ipv6/lwip/ip.h | 2 +- .../lwip/src/include/lwip/arch.h | 8 +- .../lwip_1_4_1_os/lwip/src/include/lwip/def.h | 8 +- .../lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c | 4 +- .../pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c | 2 +- Support/Include/WireProtocol.h | 2 +- Support/WireProtocol/WireProtocol.cpp | 14 +- tools/DisAsmPE/Include/UnalignedAccess.h | 124 ++++++++++++++++++ .../Targets/Microsoft.Spot.system.gcc.targets | 4 +- .../Targets/Microsoft.Spot.system.mdk.targets | 4 +- 34 files changed, 228 insertions(+), 101 deletions(-) create mode 100644 tools/DisAsmPE/Include/UnalignedAccess.h diff --git a/Application/TinyBooter/Commands.cpp b/Application/TinyBooter/Commands.cpp index 3ad2d595e..4108059e1 100644 --- a/Application/TinyBooter/Commands.cpp +++ b/Application/TinyBooter/Commands.cpp @@ -979,7 +979,7 @@ bool Loader_Engine::ProcessPayload( WP_Message* msg ) LOADER_ENGINE_SETFLAG( this, c_LoaderEngineFlag_ValidConnection ); //--// -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, msg->m_payload, msg->m_header.m_size, false ); #endif size_t num; @@ -1120,7 +1120,7 @@ bool Loader_Engine::TransmitMessage( const WP_Message* msg, bool fQueue ) UINT32 payloadSize; UINT32 flags; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) payloadSize = msg->m_header.m_size; flags = msg->m_header.m_flags; #else @@ -1178,7 +1178,7 @@ void Loader_Engine::ReplyToCommand( WP_Message* msg, bool fSuccess, bool fCritic msgReply.Initialize( &m_controller ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, ptr, size, true ); #endif msgReply.PrepareReply( msg->m_header, flags, size, (UINT8*)ptr ); @@ -1203,7 +1203,7 @@ bool Loader_Engine::Monitor_Ping( WP_Message* msg ) CLR_DBG_Commands::Monitor_Ping::Reply cmdReply; cmdReply.m_source = CLR_DBG_Commands::Monitor_Ping::c_Ping_Source_TinyBooter; -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) cmdReply.m_dbg_flags = CLR_DBG_Commands::Monitor_Ping::c_Ping_DbgFlag_BigEndian; #endif @@ -1566,7 +1566,7 @@ bool Loader_Engine::Monitor_FlashSectorMap( WP_Message* msg ) return true; } -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) UINT32 Loader_Engine::SwapEndianPattern( UINT8* &buffer, UINT32 size, UINT32 count ) { diff --git a/Application/TinyBooter/Commands.h b/Application/TinyBooter/Commands.h index 6ec1d025f..da33d226b 100644 --- a/Application/TinyBooter/Commands.h +++ b/Application/TinyBooter/Commands.h @@ -147,7 +147,7 @@ struct Loader_Engine bool Monitor_SignatureKeyUpdate( WP_Message* msg ); bool EnumerateAndLaunch ( ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) public: void SwapDebuggingValue ( UINT8* &msg, UINT32 size ); void SwapEndian ( WP_Message* msg, void* ptr, int size, bool fReply ); diff --git a/CLR/Core/CLR_RT_HeapBlock.cpp b/CLR/Core/CLR_RT_HeapBlock.cpp index 884917fad..7f80c1e20 100644 --- a/CLR/Core/CLR_RT_HeapBlock.cpp +++ b/CLR/Core/CLR_RT_HeapBlock.cpp @@ -389,7 +389,7 @@ HRESULT CLR_RT_HeapBlock::LoadFromReference( CLR_RT_HeapBlock& ref ) else if(size == 1) { first = ((CLR_UINT8 *)src)[ 0 ]; } else { first = ((CLR_UINT16*)src)[ 0 ]; } -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) ((CLR_UINT32*)&NumericByRef())[ 0 ] = first; ((CLR_UINT32*)&NumericByRef())[ 1 ] = second; #else @@ -403,7 +403,7 @@ HRESULT CLR_RT_HeapBlock::LoadFromReference( CLR_RT_HeapBlock& ref ) ((CLR_UINT32*)&NumericByRef())[ 0 ] = second; ((CLR_UINT32*)&NumericByRef())[ 1 ] = first; } -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN TINYCLR_SET_AND_LEAVE(S_OK); } @@ -531,7 +531,7 @@ HRESULT CLR_RT_HeapBlock::StoreToReference( CLR_RT_HeapBlock& ref, int size ) } } -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 first = ((CLR_UINT32*)&obj->NumericByRef())[ 0 ]; CLR_UINT32 second = ((CLR_UINT32*)&obj->NumericByRef())[ 1 ]; #else @@ -548,7 +548,7 @@ HRESULT CLR_RT_HeapBlock::StoreToReference( CLR_RT_HeapBlock& ref, int size ) first = ((CLR_UINT32*)&obj->NumericByRef())[ 1 ]; second = ((CLR_UINT32*)&obj->NumericByRef())[ 0 ]; } -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN if (sizeArray == 4) { ((CLR_UINT32*)dst)[ 0 ] = (CLR_UINT32)first; } else if(sizeArray == 8) { ((CLR_UINT32*)dst)[ 0 ] = (CLR_UINT32)first; ((CLR_UINT32*)dst)[ 1 ] = (CLR_UINT32)second; } diff --git a/CLR/Core/CLR_RT_HeapBlock_Array.cpp b/CLR/Core/CLR_RT_HeapBlock_Array.cpp index a53098a24..a2e83462c 100644 --- a/CLR/Core/CLR_RT_HeapBlock_Array.cpp +++ b/CLR/Core/CLR_RT_HeapBlock_Array.cpp @@ -206,7 +206,7 @@ HRESULT CLR_RT_HeapBlock_Array::IndexOf( CLR_RT_HeapBlock_Array* array, CLR_RT_H while(true) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) if(memcmp( data, &matchPtr->NumericByRef(), sizeElem ) == 0) { index = pos; diff --git a/CLR/Core/Execution.cpp b/CLR/Core/Execution.cpp index a8e7f81fc..58b7dee7c 100644 --- a/CLR/Core/Execution.cpp +++ b/CLR/Core/Execution.cpp @@ -3066,7 +3066,7 @@ void CLR_RT_ExecutionEngine::StopOnBreakpoint( CLR_DBG_Commands::Debugging_Execu if(m_breakpointsActiveNum == 1) { -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) static CLR_DBG_Commands::Debugging_Execution_BreakpointDef s_breakpoint; CLR_UINT8* data; diff --git a/CLR/Core/Serialization/BinaryFormatter.cpp b/CLR/Core/Serialization/BinaryFormatter.cpp index e70ab3820..71633ecc0 100644 --- a/CLR/Core/Serialization/BinaryFormatter.cpp +++ b/CLR/Core/Serialization/BinaryFormatter.cpp @@ -1635,7 +1635,7 @@ HRESULT CLR_RT_BinaryFormatter::State::AdvanceToTheNextElement() { TINYCLR_CHECK_HRESULT(m_parent->ReadBits( val, bits )); -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( ptr, &val, size ); #else memcpy( ptr, ((unsigned char*)&val)+(sizeof(val)-size), size ); diff --git a/CLR/Core/Streams.cpp b/CLR/Core/Streams.cpp index f09c59a50..c9a818dea 100644 --- a/CLR/Core/Streams.cpp +++ b/CLR/Core/Streams.cpp @@ -165,7 +165,7 @@ HRESULT CLR_RT_HeapBlock_MemoryStream::ReadBits( CLR_UINT64& res, CLR_UINT32 bit CLR_UINT32* ptr = (CLR_UINT32*)&res; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) if(bits > 32) { TINYCLR_CHECK_HRESULT(ReadBits( ptr[ 1 ], bits - 32 )); bits = 32; } else { ptr[ 1 ] = 0; } diff --git a/CLR/Core/TypeSystem.cpp b/CLR/Core/TypeSystem.cpp index 8ec6dd2e6..2aaabbe4b 100644 --- a/CLR/Core/TypeSystem.cpp +++ b/CLR/Core/TypeSystem.cpp @@ -1342,7 +1342,7 @@ bool CLR_RECORD_ASSEMBLY::GoodHeader() const NATIVE_PROFILE_CLR_CORE(); CLR_RECORD_ASSEMBLY header = *this; header.headerCRC = 0; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) if ( (header.flags & CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) == CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) #else if ( (header.flags & CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) != CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) @@ -4430,7 +4430,7 @@ HRESULT CLR_RT_AttributeParser::Next( Value*& res ) CLR_UINT32 size = (dtl.m_sizeInBits + 7) / 8; // FIXME GJS - the numeric values, what is their endiannes??? In the MSTV code there is a BIG endian fix but it looks like it will not work, so was it ever used? -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( &m_lastValue.m_value.NumericByRef(), m_blob, size ); m_blob += size; #else switch(size) diff --git a/CLR/Debugger/Debugger.cpp b/CLR/Debugger/Debugger.cpp index 2cdada787..95ca7847e 100644 --- a/CLR/Debugger/Debugger.cpp +++ b/CLR/Debugger/Debugger.cpp @@ -374,7 +374,7 @@ bool CLR_DBG_Debugger::Monitor_Ping( WP_Message* msg, void* owner ) cmdReply.m_source = CLR_DBG_Commands::Monitor_Ping::c_Ping_Source_TinyCLR; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) cmdReply.m_dbg_flags = CLR_EE_DBG_IS(State_ProgramExited) != 0 ? CLR_DBG_Commands::Monitor_Ping::c_Ping_DbgFlag_AppExit : 0; #else cmdReply.m_dbg_flags = CLR_DBG_Commands::Monitor_Ping::c_Ping_DbgFlag_BigEndian; @@ -1436,7 +1436,7 @@ static bool FillValues( CLR_RT_HeapBlock* ptr, CLR_DBG_Commands::Debugging_Value // Primitives or optimized value types. // -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( dst->m_builtinValue, (void*)&ptr->NumericByRefConst().u1, 8 ); #else { diff --git a/CLR/Include/TinyCLR_Messaging.h b/CLR/Include/TinyCLR_Messaging.h index e8c036a27..a43a22089 100644 --- a/CLR/Include/TinyCLR_Messaging.h +++ b/CLR/Include/TinyCLR_Messaging.h @@ -175,7 +175,7 @@ struct CLR_Messaging static bool Messaging_Send__Reply ( WP_Message* msg, void* owner ); static bool Messaging_Reply ( WP_Message* msg, void* owner ); static bool Messaging_Reply__Reply ( WP_Message* msg, void* owner ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) public: static void SwapDebuggingValue ( UINT8* &msg, UINT32 size ); static void SwapEndian ( WP_Message* msg, void* ptr, int size, bool fReply ); diff --git a/CLR/Include/TinyCLR_PlatformDef.h b/CLR/Include/TinyCLR_PlatformDef.h index 47eea4c9a..5251f8ac1 100644 --- a/CLR/Include/TinyCLR_PlatformDef.h +++ b/CLR/Include/TinyCLR_PlatformDef.h @@ -7,13 +7,16 @@ #include +#ifdef _WIN32 +#define NETMF_TARGET_LITTLE_ENDIAN +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////// // PLATFORMS GENERAL DEFINITIONS #if defined(_WIN32_WCE) #define PLATFORM_WINCE #define TINYCLR_STOP() ::DebugBreak() -#elif defined(_WIN32) || defined(WIN32) -#define PLATFORM_WINDOWS +#elif defined(_WIN32) #define TINYCLR_STOP() ::DebugBreak() #pragma warning( error : 4706 ) // error C4706: assignment within conditional expression #elif defined(arm) || defined(__arm) || defined(__GNUC__) @@ -28,9 +31,9 @@ #define PLATFORM_SH #endif -#if !defined(PLATFORM_WINDOWS) && !defined(PLATFORM_WINCE) -#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) -!ERROR ENDIANNESS NOT DEFINED +#if !defined(PLATFORM_WINDOWS_EMULATOR) && !defined(PLATFORM_WINCE) +#if !defined(NETMF_TARGET_LITTLE_ENDIAN) && !defined(NETMF_TARGET_BIG_ENDIAN) +#error ENDIANNESS NOT DEFINED #endif #endif @@ -89,7 +92,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // WINDOWS -#if defined(PLATFORM_WINDOWS) +#if defined(_WIN32) #define TINYCLR_GC_VERBOSE #define TINYCLR_TRACE_MEMORY_STATS #define TINYCLR_PROFILE_NEW @@ -144,7 +147,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // TRACE DEPENDENCIES -#if defined(TINYCLR_JITTER) || defined(PLATFORM_WINDOWS) +#if defined(TINYCLR_JITTER) || defined(_WIN32) #define TINYCLR_OPCODE_NAMES #define TINYCLR_OPCODE_PARSER #define TINYCLR_OPCODE_STACKCHANGES @@ -166,7 +169,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // LANGUAGE -#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_WINCE) +#if defined(_WIN32) #define PROHIBIT_ALL_CONSTRUCTORS(cls) \ private: \ cls(); \ @@ -216,7 +219,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // INCLUDES -#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_WINCE) +#if defined(_WIN32) #if !defined(PLATFORM_WINCE) #define _WIN32_WINNT 0x0501 @@ -280,7 +283,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -#if defined(PLATFORM_WINCE) +#if defined(_WIN32_WCE) #if (_WIN32_WCE == 0x420) #define ENUMLOGFONTEXW ENUMLOGFONT diff --git a/CLR/Include/TinyCLR_Runtime__HeapBlock.h b/CLR/Include/TinyCLR_Runtime__HeapBlock.h index 27e029d63..9a381d8f0 100644 --- a/CLR/Include/TinyCLR_Runtime__HeapBlock.h +++ b/CLR/Include/TinyCLR_Runtime__HeapBlock.h @@ -11,7 +11,7 @@ #endif //////////////////////////////////////////////////////////////////////////////////////////////////// -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #define CLR_RT_HEAPBLOCK_RAW_ID( dataType, flags, size ) ( (dataType & 0x000000FF) | ((flags & 0x000000FF) << 8) | ((size & 0x0000FFFF) << 16)) #define CLR_RT_HEAPBLOCK_ASSIGN_INTEGER32_SIGNED( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.s4 = (CLR_INT32)num; } @@ -23,7 +23,7 @@ #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT32(dataType,num) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.r4 = num; } #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT64(dataType,num) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.r8 = num; } -#else // BIG_ENDIAN +#else // NETMF_TARGET_BIG_ENDIAN #define CLR_RT_HEAPBLOCK_RAW_ID( dataType, flags, size ) ( (size & 0x0000FFFF) | ((flags & 0x000000FF) << 16) | ((dataType & 0x000000FF) << 24)) #define CLR_RT_HEAPBLOCK_ASSIGN_INTEGER32_SIGNED( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.padS4 = 0; m_data.numeric.s4 = (CLR_INT32)num; } @@ -35,7 +35,7 @@ #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT32( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.padR4 = 0; m_data.numeric.r4 = num; } #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT64( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.r8 = num; } -#endif // BIG_ENDIAN +#endif // NETMF_TARGET_BIG_ENDIAN //////////////////////////////////////////////////////////// @@ -147,7 +147,7 @@ struct CLR_RT_HeapBlock union Numeric { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT8 u1; CLR_UINT16 u2; CLR_UINT32 u4; @@ -158,7 +158,7 @@ struct CLR_RT_HeapBlock #endif struct U8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; //--// @@ -293,7 +293,7 @@ struct CLR_RT_HeapBlock } u8; // -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_INT8 s1; CLR_INT16 s2; CLR_INT32 s4; @@ -304,7 +304,7 @@ struct CLR_RT_HeapBlock #endif struct S8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; //--// @@ -445,14 +445,14 @@ struct CLR_RT_HeapBlock #if !defined(TINYCLR_EMULATED_FLOATINGPOINT) -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) float r4; #else struct { CLR_UINT32 padR4; float r4; }; #endif struct R8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; #else @@ -464,7 +464,7 @@ struct CLR_RT_HeapBlock { double ret_val; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #if defined(__GNUC__) /// /// This code fixes an optimization problem with the gcc compiler. @@ -525,7 +525,7 @@ struct CLR_RT_HeapBlock R8& operator=( const double num ) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #if defined(__GNUC__) /// /// This code fixes an optimization problem with the gcc compiler. @@ -649,7 +649,7 @@ struct CLR_RT_HeapBlock #else /// not using floating point lib, emulated one -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 padR4; #endif @@ -705,7 +705,7 @@ struct CLR_RT_HeapBlock struct R8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; //--// @@ -833,7 +833,7 @@ struct CLR_RT_HeapBlock // MemLE: DDCCBBAA // So for LE DD,Addr 00 is the low byte. // For BE it is certainly not true, hence this check will not work. Will Interop? FIXME GJS - verify interop -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CT_ASSERT_UNIQUE_NAME( offsetof( Numeric, s1 ) == 0, s1 ) CT_ASSERT_UNIQUE_NAME( offsetof( Numeric, s2 ) == 0, s2 ) CT_ASSERT_UNIQUE_NAME( offsetof( Numeric, s4 ) == 0, s4 ) @@ -1078,7 +1078,7 @@ struct CLR_RT_HeapBlock } //--// -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) const CLR_RT_HeapBlock_AtomicData& DataByRefConst() const { return m_data; } #else const CLR_RT_HeapBlock_AtomicData& DataByRefConst() const diff --git a/CLR/Include/TinyCLR_Types.h b/CLR/Include/TinyCLR_Types.h index 01b0dcdc8..b13e8a5ba 100644 --- a/CLR/Include/TinyCLR_Types.h +++ b/CLR/Include/TinyCLR_Types.h @@ -611,7 +611,7 @@ inline CLR_UINT32 CLR_TkFromStream( const CLR_UINT8*& p ) #define TINYCLR_READ_UNALIGNED_UINT8(arg,ip) arg = *(const CLR_UINT8 *)ip; ip += sizeof(CLR_UINT8 ) template __inline void TINYCLR_READ_UNALIGNED_UINT16(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT16)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT16)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); #else @@ -621,7 +621,7 @@ template __inline void TINYCLR_READ_UNALIGNED_UINT16(T& arg, CLR_PME } template __inline void TINYCLR_READ_UNALIGNED_UINT32(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -631,11 +631,11 @@ template __inline void TINYCLR_READ_UNALIGNED_UINT32(T& arg, CLR_PME arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN } template __inline void TINYCLR_READ_UNALIGNED_UINT64(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -653,24 +653,24 @@ template __inline void TINYCLR_READ_UNALIGNED_UINT64(T& arg, CLR_PME arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN } #define TINYCLR_READ_UNALIGNED_INT8(arg,ip) arg = *(const CLR_INT8 * )ip; ip += sizeof(CLR_INT8 ) template __inline void TINYCLR_READ_UNALIGNED_INT16(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT16)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT16)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); #else arg = (CLR_UINT16)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT16)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN arg = (CLR_INT16)arg; } template __inline void TINYCLR_READ_UNALIGNED_INT32(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -680,12 +680,12 @@ template __inline void TINYCLR_READ_UNALIGNED_INT32(T& arg, CLR_PMET arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN arg = (CLR_INT32)arg; } template __inline void TINYCLR_READ_UNALIGNED_INT64(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -703,7 +703,7 @@ template __inline void TINYCLR_READ_UNALIGNED_INT64(T& arg, CLR_PMET arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN arg = (CLR_INT64)arg; } diff --git a/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp b/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp index b1770abe6..da9dd46cc 100644 --- a/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp +++ b/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp @@ -37,7 +37,7 @@ HRESULT Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::In CLR_UINT32 sizeDst = array->m_sizeOfElement; lenSrc /= sizeDst; if(lenSrc > lenDst) lenSrc = lenDst; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( ptrDst, ptrSrc, lenSrc * sizeDst ); #if defined(TINYCLR_EMULATED_FLOATINGPOINT) @@ -165,7 +165,7 @@ HRESULT Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::In break; } #endif -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN } TINYCLR_NOCLEANUP(); diff --git a/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp b/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp index 851d5dfa3..12a5cde1d 100644 --- a/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp +++ b/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp @@ -320,7 +320,7 @@ static bool DeserializeIntrinsicType(CLR_RT_HeapBlock* pObj, CLR_UINT8* serData, while(size--) { -#ifndef BIG_ENDIAN +#ifndef NETMF_TARGET_BIG_ENDIAN tmp[i++ ] = serData[serOffset++]; #else tmp[size] = serData[serOffset++]; @@ -379,7 +379,7 @@ static bool DeserializeObject(CLR_RT_HeapBlock* pObj, CLR_UINT8* serData, CLR_IN while(size--) { -#ifndef BIG_ENDIAN +#ifndef NETMF_TARGET_BIG_ENDIAN pData[i++ ] = serData[serOffset++]; #else pData[size] = serData[serOffset++]; @@ -438,7 +438,7 @@ static bool SerializeIntrinsicType(CLR_DataType type, CLR_UINT8* data, CLR_UINT8 while(size--) { -#ifndef BIG_ENDIAN +#ifndef NETMF_TARGET_BIG_ENDIAN serData[serOffset++] = *tmp++; #else serData[serOffset++] = tmp[size]; diff --git a/CLR/Messaging/Messaging.cpp b/CLR/Messaging/Messaging.cpp index 32e6500d1..c8512d218 100644 --- a/CLR/Messaging/Messaging.cpp +++ b/CLR/Messaging/Messaging.cpp @@ -420,7 +420,7 @@ bool CLR_Messaging::ProcessPayload( WP_Message* msg ) } //--// -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, msg->m_payload, msg->m_header.m_size, false ); #endif const CLR_Messaging_CommandHandlerLookups* tables; @@ -535,7 +535,7 @@ bool CLR_Messaging::TransmitMessage( const WP_Message* msg, bool fQueue ) UINT32 payloadSize; UINT32 flags; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) payloadSize = msg->m_header.m_size; flags = msg->m_header.m_flags; #else @@ -656,7 +656,7 @@ void CLR_Messaging::ReplyToCommand( WP_Message* msg, bool fSuccess, bool fCritic msgReply.Initialize( &m_controller ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, ptr, size, true ); #endif @@ -672,7 +672,7 @@ void CLR_Messaging::ReplyToCommand( WP_Message* msg, bool fSuccess, bool fCritic } //--// -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) UINT32 CLR_Messaging::SwapEndianPattern( UINT8* &buffer, UINT32 size, UINT32 count ) { UINT32 consumed=0; diff --git a/CLR/Messaging/Messaging_stub.cpp b/CLR/Messaging/Messaging_stub.cpp index 18194d137..16e02e033 100644 --- a/CLR/Messaging/Messaging_stub.cpp +++ b/CLR/Messaging/Messaging_stub.cpp @@ -65,7 +65,7 @@ void CLR_Messaging::Cleanup() NATIVE_PROFILE_CLR_MESSAGING(); } -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) UINT32 CLR_Messaging::SwapEndianPattern( UINT8* &buffer, UINT32 size, UINT32 count ) { diff --git a/DeviceCode/include/Sockets_decl.h b/DeviceCode/include/Sockets_decl.h index dda4a4bd3..2f486fdd0 100644 --- a/DeviceCode/include/Sockets_decl.h +++ b/DeviceCode/include/Sockets_decl.h @@ -419,7 +419,7 @@ extern const ConfigurationSector g_ConfigurationSector; //--// -#if defined(LITTLE_ENDIAN) || defined(PLATFORM_WINDOWS) +#if defined(NETMF_TARGET_LITTLE_ENDIAN) #define SOCK_htons(x) ( (((x) & 0x000000FFUL) << 8) | (((x) & 0x0000FF00UL) >> 8) ) #define SOCK_htonl(x) ( (((x) & 0x000000FFUL) << 24) | (((x) & 0x0000FF00UL) << 8) | (((x) & 0x00FF0000UL) >> 8) | (((x) & 0xFF000000UL) >> 24) ) #define SOCK_ntohs(x) SOCK_htons(x) diff --git a/DeviceCode/include/TinyCLR_Endian.h b/DeviceCode/include/TinyCLR_Endian.h index 69bc9dd47..4187d8e71 100644 --- a/DeviceCode/include/TinyCLR_Endian.h +++ b/DeviceCode/include/TinyCLR_Endian.h @@ -3,7 +3,7 @@ // // // Microsoft dotNetMF Project -// Copyright �2001,2002,2009 Microsoft Corporation +// Copyright �2001,2002,2009 Microsoft Corporation // One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. // All rights reserved. // MICROSOFT CONFIDENTIAL @@ -73,7 +73,7 @@ __inline INT64 SwapEndian( INT64 u ) } // These macros only swap the Endiannes on BIG Endian machines -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #define SwapEndianIfBE( a ) a #define SwapEndianIfBEc32( a ) a #define SwapEndianIfBEc16( a ) a diff --git a/DeviceCode/pal/graphics/graphics.cpp b/DeviceCode/pal/graphics/graphics.cpp index 251bb2d50..734dac21c 100644 --- a/DeviceCode/pal/graphics/graphics.cpp +++ b/DeviceCode/pal/graphics/graphics.cpp @@ -1144,7 +1144,7 @@ UINT32* Graphics_Driver::ComputePosition( const PAL_GFX_Bitmap& bitmap, int x, i { NATIVE_PROFILE_PAL_GRAPHICS(); -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) shift = (x % 2) * 16; mask = 0x0000FFFF << shift; #else diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c index 352b55241..ac831fa65 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c @@ -52,7 +52,7 @@ * Note ntohs() and ntohl() are merely references to the htonx counterparts. */ -#if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) +#if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) /** * Convert an u16_t from host- to network byte order. @@ -105,4 +105,4 @@ lwip_ntohl(u32_t n) return lwip_htonl(n); } -#endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) */ +#endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) */ diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c index 1d5658207..96587edc0 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c @@ -334,10 +334,10 @@ snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value) { u16_t plen, base; u8_t *msg_ptr; -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN u8_t *lsb_ptr = (u8_t*)value; #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN u8_t *lsb_ptr = (u8_t*)value + sizeof(s32_t) - 1; #endif u8_t sign; diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h index 79a2d90f2..3e2c1b368 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h @@ -39,13 +39,13 @@ /** Swap the bytes in an u16_t: much like htons() for little-endian */ #ifndef SWAP_BYTES_IN_WORD -#if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) +#if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) /* little endian and PLATFORM_BYTESWAP defined */ #define SWAP_BYTES_IN_WORD(w) LWIP_PLATFORM_HTONS(w) -#else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) */ +#else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) */ /* can't use htons on big endian (or PLATFORM_BYTESWAP not defined)... */ #define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) -#endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN)*/ +#endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN)*/ #endif /* SWAP_BYTES_IN_WORD */ /** Split an u32_t in two u16_ts and add them up */ diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h index 77f84e02c..2193ba3fa 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h @@ -134,7 +134,7 @@ extern const ip_addr_t ip_addr_broadcast; #define IP_LOOPBACKNET 127 /* official! */ -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN /** Set an IP address given by the four byte-parts */ #define IP4_ADDR(ipaddr, a,b,c,d) \ (ipaddr)->addr = ((u32_t)((a) & 0xff) << 24) | \ diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h index a01cfc65b..5f588cd90 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h @@ -82,7 +82,7 @@ extern "C" { /* The IPv6 header. */ struct ip_hdr { -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN u8_t tclass1:4, v:4; u8_t flow1:4, tclass2:4; #else diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h index 4d6df773f..8f074fae0 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h @@ -32,12 +32,12 @@ #ifndef __LWIP_ARCH_H__ #define __LWIP_ARCH_H__ -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 +#ifndef NETMF_TARGET_LITTLE_ENDIAN +#define NETMF_TARGET_LITTLE_ENDIAN 1234 #endif -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 +#ifndef NETMF_TARGET_BIG_ENDIAN +#define NETMF_TARGET_BIG_ENDIAN 4321 #endif #include "arch/cc.h" diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h index 73a1b560b..2c2fba92f 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h @@ -48,7 +48,7 @@ extern "C" { #endif /* Endianess-optimized shifting of two u8_t to create one u16_t */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN #define LWIP_MAKE_U16(a, b) ((a << 8) | b) #else #define LWIP_MAKE_U16(a, b) ((b << 8) | a) @@ -80,7 +80,7 @@ extern "C" { #define ntohl(x) lwip_ntohl(x) #endif /* LWIP_PREFIX_BYTEORDER_FUNCS */ -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN #define lwip_htons(x) (x) #define lwip_ntohs(x) (x) #define lwip_htonl(x) (x) @@ -89,7 +89,7 @@ extern "C" { #define PP_NTOHS(x) (x) #define PP_HTONL(x) (x) #define PP_NTOHL(x) (x) -#else /* BYTE_ORDER != BIG_ENDIAN */ +#else /* BYTE_ORDER != NETMF_TARGET_BIG_ENDIAN */ #if LWIP_PLATFORM_BYTESWAP #define lwip_htons(x) LWIP_PLATFORM_HTONS(x) #define lwip_ntohs(x) LWIP_PLATFORM_HTONS(x) @@ -113,7 +113,7 @@ u32_t lwip_ntohl(u32_t x); (((x) & 0xff000000UL) >> 24)) #define PP_NTOHL(x) PP_HTONL(x) -#endif /* BYTE_ORDER == BIG_ENDIAN */ +#endif /* BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN */ #ifdef __cplusplus } diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c index 8e8fae9f9..325ee46e4 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c @@ -1703,9 +1703,9 @@ pppInput(void *arg) LWIP_ASSERT("pbuf_header failed\n", 0); goto drop; } -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN protocol = htons(protocol); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN */ SMEMCPY(nb->payload, &protocol, sizeof(protocol)); lcp_sprotrej(pd, nb->payload, nb->len); } diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c index 40fdad13d..dcf7ea318 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c @@ -568,7 +568,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) goto bad; } -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN tmp = n0->tot_len - vjlen + cs->cs_hlen; IPH_LEN_SET(&cs->cs_ip, htons((u_short)tmp)); #else diff --git a/Support/Include/WireProtocol.h b/Support/Include/WireProtocol.h index 159370e4d..575aed346 100644 --- a/Support/Include/WireProtocol.h +++ b/Support/Include/WireProtocol.h @@ -127,7 +127,7 @@ struct WP_Message void PrepareReply ( const WP_Packet& req, UINT32 flags, UINT32 payloadSize, UINT8* payload ); void SetPayload ( UINT8* payload ); void Release ( ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) void SwapEndian ( ); #endif diff --git a/Support/WireProtocol/WireProtocol.cpp b/Support/WireProtocol/WireProtocol.cpp index eb0442d1a..58b9ed3f7 100644 --- a/Support/WireProtocol/WireProtocol.cpp +++ b/Support/WireProtocol/WireProtocol.cpp @@ -51,11 +51,11 @@ void WP_Message::PrepareRequest( UINT32 cmd, UINT32 flags, UINT32 payloadSize, U // The CRC for the header is computed setting the CRC field to zero and then running the CRC algorithm. // m_header.m_crcHeader = 0; -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif m_header.m_crcHeader = SUPPORT_ComputeCRC( (UINT8*)&m_header, sizeof(m_header), 0 ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) m_header.m_crcHeader = ::SwapEndian( m_header.m_crcHeader ); #endif @@ -78,11 +78,11 @@ void WP_Message::PrepareReply( const WP_Packet& req, UINT32 flags, UINT32 payloa // The CRC for the header is computed setting the CRC field to zero and then running the CRC algorithm. // m_header.m_crcHeader = 0; -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif m_header.m_crcHeader = SUPPORT_ComputeCRC( (UINT8*)&m_header, sizeof(m_header), 0 ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) m_header.m_crcHeader = ::SwapEndian( m_header.m_crcHeader ); #endif } @@ -107,7 +107,7 @@ bool WP_Message::VerifyHeader() { bool fRes; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) UINT32 crc = m_header.m_crcHeader; #else UINT32 crc = ::SwapEndian( m_header.m_crcHeader ); @@ -212,7 +212,7 @@ bool WP_Message::Process() bool fBadPacket=true; if( VerifyHeader() ) { -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif if ( m_parent->m_app->ProcessHeader( m_parent->m_state, this ) ) @@ -305,7 +305,7 @@ bool WP_Message::Process() } } -#if defined (BIG_ENDIAN) +#if defined (NETMF_TARGET_BIG_ENDIAN) void WP_Message::SwapEndian() { m_header.m_crcHeader = ::SwapEndian( m_header.m_crcHeader ); diff --git a/tools/DisAsmPE/Include/UnalignedAccess.h b/tools/DisAsmPE/Include/UnalignedAccess.h new file mode 100644 index 000000000..0a663bf66 --- /dev/null +++ b/tools/DisAsmPE/Include/UnalignedAccess.h @@ -0,0 +1,124 @@ +#ifndef _UNALIGNED_ACCESS_H_ +#define _UNALIGNED_ACCESS_H_ +//////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) Microsoft, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files +// except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the +// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace Microsoft +{ + namespace Utilities + { + inline uint16_t ReadUnalignedUInt16( uint8_t const*& ip) + { + uint16_t retVal; + #if !defined(NETMF_TARGET_BIG_ENDIAN) + retVal = (uint16_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + retVal |= (uint16_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + #else + retVal = (uint16_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint16_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + #endif + return retVal; + } + + inline uint32_t ReadUnalignedUInt32( uint8_t const*& ip) + { + uint32_t retVal; + #if !defined(NETMF_TARGET_BIG_ENDIAN) + retVal = (uint32_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + #else + retVal = (uint32_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + #endif //NETMF_TARGET_BIG_ENDIAN + return retVal; + } + + inline uint64_t ReadUnalignedUInt64( uint8_t const*& ip) + { + uint64_t retVal; + #if !defined(NETMF_TARGET_BIG_ENDIAN) + retVal = (uint64_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 32; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 40; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 48; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 56; + ip += sizeof(uint8_t); + #else + retVal = (uint64_t)(*(const uint8_t *)ip) << 56; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 48; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 40; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 32; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + #endif //NETMF_TARGET_BIG_ENDIAN + return retVal; + } + + inline int16_t ReadUnalignedInt16( uint8_t const*& ip) + { + return static_cast< int16_t >( ReadUnalignedUInt16( ip ) ); + } + + inline int32_t ReadUnalignedInt32( uint8_t const*& ip) + { + return static_cast< int32_t >( ReadUnalignedUInt32( ip ) ); + } + + inline int64_t ReadUnalignedInt64( uint8_t const*& ip) + { + return static_cast< int64_t >( ReadUnalignedUInt64( ip ) ); + } + } +} +#endif \ No newline at end of file diff --git a/tools/Targets/Microsoft.Spot.system.gcc.targets b/tools/Targets/Microsoft.Spot.system.gcc.targets index 270c6375d..5d649c804 100644 --- a/tools/Targets/Microsoft.Spot.system.gcc.targets +++ b/tools/Targets/Microsoft.Spot.system.gcc.targets @@ -144,8 +144,8 @@ $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_$(TARGETPROCESSOR) -DPLATFORM_ARM_$(TARGETPLATFORM) -DTARGETLOCATION_$(TARGETLOCATION) - $(CC_CPP_COMMON_FLAGS) -DLITTLE_ENDIAN - $(CC_CPP_COMMON_FLAGS) -DBIG_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_LITTLE_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_BIG_ENDIAN $(CC_CPP_COMMON_FLAGS) -DPATCH_BUILD $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_OS_PORT diff --git a/tools/Targets/Microsoft.Spot.system.mdk.targets b/tools/Targets/Microsoft.Spot.system.mdk.targets index a1f896d97..2292907a9 100644 --- a/tools/Targets/Microsoft.Spot.system.mdk.targets +++ b/tools/Targets/Microsoft.Spot.system.mdk.targets @@ -188,8 +188,8 @@ $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_$(TARGETPLATFORM) $(CC_CPP_COMMON_FLAGS) -DTARGETLOCATION_$(TARGETLOCATION) - $(CC_CPP_COMMON_FLAGS) -DLITTLE_ENDIAN - $(CC_CPP_COMMON_FLAGS) -DBIG_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_LITTLE_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_BIG_ENDIAN $(CC_CPP_COMMON_FLAGS) -DPATCH_BUILD $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_OS_PORT From 82491f67ecb342b8f437e8f57a4152649ada6727 Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Wed, 3 Aug 2016 15:18:28 +0100 Subject: [PATCH 2/6] # This is a combination of 8 commits. # The first commit's message is: Replace BIG_ENDIAN with NETMF_TARGET_BIG_ENDIAN and LITTLE_ENDIAN with NETMF_TARGET_LITTLE_ENDIAN Fixes #481 # This is the 2nd commit message: Added CMSIS version check (require 4.3.0) # This is the 3rd commit message: Update CMSIS 4.3.0 (it now includes RTX) # This is the 4th commit message: Cleaned up obsolete CMSIS include paths # This is the 5th commit message: - removed ITM Virtual port support from STM32F4 USART driver code # This is the 6th commit message: Added support for solution level extensibility for communication transports via generic transport interfaces - Added new GENERIC_TRANSPORT - Added new case to all COM redirector APIs to support GENERIC_TRANSPORT handles redirecting to GenericPort_xxx APIS - Added new GenericPort_xxx APIS to lookup an interface in a table based on the port number and then call through the interface 's function pointer. This allows extensibility without requiring the definition of new transport types. - added Common CortexMx ITM trace port channel 0 Generic port implementation - Added support for using ITM0 Generic port to MCBSTM32F400 # This is the 7th commit message: - modified DEBUG_TRACEXX to use debug_printf instead of hal_printf - enabled CPU_InitializeCommunication() for all build configurations so debug and trace messages are available even in boot loaders. # This is the 8th commit message: - added missing cmsis_generic.h header for generic CMSIS library code use. --- .gitignore | 3 +- Application/TinyBooter/Commands.cpp | 10 +- Application/TinyBooter/Commands.h | 2 +- CLR/Core/CLR_RT_HeapBlock.cpp | 8 +- CLR/Core/CLR_RT_HeapBlock_Array.cpp | 2 +- CLR/Core/Execution.cpp | 2 +- CLR/Core/Serialization/BinaryFormatter.cpp | 2 +- CLR/Core/Streams.cpp | 2 +- CLR/Core/TypeSystem.cpp | 4 +- CLR/Debugger/Debugger.cpp | 4 +- CLR/Include/TinyCLR_Messaging.h | 2 +- CLR/Include/TinyCLR_PlatformDef.h | 23 +- CLR/Include/TinyCLR_Runtime__HeapBlock.h | 30 +- CLR/Include/TinyCLR_Types.h | 22 +- ...untime_CompilerServices_RuntimeHelpers.cpp | 4 +- ...Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp | 6 +- CLR/Messaging/Messaging.cpp | 8 +- CLR/Messaging/Messaging_stub.cpp | 2 +- CMSIS/CMSIS-SP-00300-r4p2-00rel0.txt | 2 - .../RTOS/RTX}/dotNetMF.proj | 6 +- CMSIS/ReadMe.md | 2 +- .../CortexMx/GlobalLock/dotNetMF.proj | 4 +- .../Processors/CortexMx/ItmPort/ItmPort.cpp | 49 ++++ .../Processors/CortexMx/ItmPort/dotNetMF.proj | 27 ++ .../arm/Processors/CortexMx/cmsis_generic.h | 20 ++ DeviceCode/Initialization/tinyhal.cpp | 2 - .../STM32F4_USART/STM32F4_usart_functions.cpp | 79 +----- .../Native/STM32F4/processor_selector.h | 8 +- .../Targets/OS/CMSIS_RTOS/CMSIS_RTOS.settings | 16 +- DeviceCode/include/COM_decl.h | 65 ++++- DeviceCode/include/Sockets_decl.h | 2 +- DeviceCode/include/TinyCLR_Endian.h | 4 +- DeviceCode/include/tinyhal.h | 54 ++-- DeviceCode/pal/COM/ComDirector.cpp | 262 +++++++++++------- DeviceCode/pal/COM/GenericPort.cpp | 153 ++++++++++ DeviceCode/pal/COM/dotNetMF.proj | 1 + DeviceCode/pal/graphics/graphics.cpp | 2 +- .../pal/lwip_1_4_1_os/lwip/src/core/def.c | 4 +- .../lwip/src/core/snmp/asn1_dec.c | 4 +- .../lwip/src/include/ipv4/lwip/inet_chksum.h | 6 +- .../lwip/src/include/ipv4/lwip/ip_addr.h | 2 +- .../lwip/src/include/ipv6/lwip/ip.h | 2 +- .../lwip/src/include/lwip/arch.h | 8 +- .../lwip_1_4_1_os/lwip/src/include/lwip/def.h | 8 +- .../lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c | 4 +- .../pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c | 2 +- DeviceCode/pal/tinycrt/tinycrt.cpp | 5 +- .../MCBSTM32F400/DeviceCode/Init/IO_Init.cpp | 5 + .../DeviceCode/Initialization/dotNetMF.proj | 1 - .../Initialization/dotNetMF_loader.proj | 1 - Solutions/MCBSTM32F400/MCBSTM32F400.settings | 1 + .../MCBSTM32F400/TinyBooter/TinyBooter.proj | 4 + Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj | 6 +- .../TinyCLR_NONET/TinyCLR_NONET.proj | 4 + Solutions/MCBSTM32F400/platform_selector.h | 5 +- .../DeviceCode/Initialization/dotNetMF.proj | 1 - .../Initialization/dotNetMF_loader.proj | 1 - Solutions/Windows2/TinyCLR/Various.cpp | 6 +- Support/Include/WireProtocol.h | 2 +- Support/WireProtocol/WireProtocol.cpp | 14 +- tools/DisAsmPE/Include/UnalignedAccess.h | 124 +++++++++ .../Targets/Microsoft.Spot.system.gcc.targets | 4 +- .../Targets/Microsoft.Spot.system.mdk.targets | 4 +- 63 files changed, 791 insertions(+), 331 deletions(-) delete mode 100644 CMSIS/CMSIS-SP-00300-r4p2-00rel0.txt rename CMSIS/{CMSIS_RTX => CMSIS/RTOS/RTX}/dotNetMF.proj (93%) create mode 100644 DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/ItmPort.cpp create mode 100644 DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/dotNetMF.proj create mode 100644 DeviceCode/Cores/arm/Processors/CortexMx/cmsis_generic.h create mode 100644 DeviceCode/pal/COM/GenericPort.cpp create mode 100644 tools/DisAsmPE/Include/UnalignedAccess.h diff --git a/.gitignore b/.gitignore index 5fac61781..40803f7db 100644 --- a/.gitignore +++ b/.gitignore @@ -7,10 +7,9 @@ # CMSIS and CMSIS_RTX /CMSIS/CMSIS/ -/CMSIS/CMSIS_RTX/* /CMSIS/Device/* /CMSIS/ARM.CMSIS.pdsc -!/CMSIS/CMSIS_RTX/dotNetMF.proj +!/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj # Visual Studio *.aps diff --git a/Application/TinyBooter/Commands.cpp b/Application/TinyBooter/Commands.cpp index 3ad2d595e..4108059e1 100644 --- a/Application/TinyBooter/Commands.cpp +++ b/Application/TinyBooter/Commands.cpp @@ -979,7 +979,7 @@ bool Loader_Engine::ProcessPayload( WP_Message* msg ) LOADER_ENGINE_SETFLAG( this, c_LoaderEngineFlag_ValidConnection ); //--// -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, msg->m_payload, msg->m_header.m_size, false ); #endif size_t num; @@ -1120,7 +1120,7 @@ bool Loader_Engine::TransmitMessage( const WP_Message* msg, bool fQueue ) UINT32 payloadSize; UINT32 flags; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) payloadSize = msg->m_header.m_size; flags = msg->m_header.m_flags; #else @@ -1178,7 +1178,7 @@ void Loader_Engine::ReplyToCommand( WP_Message* msg, bool fSuccess, bool fCritic msgReply.Initialize( &m_controller ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, ptr, size, true ); #endif msgReply.PrepareReply( msg->m_header, flags, size, (UINT8*)ptr ); @@ -1203,7 +1203,7 @@ bool Loader_Engine::Monitor_Ping( WP_Message* msg ) CLR_DBG_Commands::Monitor_Ping::Reply cmdReply; cmdReply.m_source = CLR_DBG_Commands::Monitor_Ping::c_Ping_Source_TinyBooter; -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) cmdReply.m_dbg_flags = CLR_DBG_Commands::Monitor_Ping::c_Ping_DbgFlag_BigEndian; #endif @@ -1566,7 +1566,7 @@ bool Loader_Engine::Monitor_FlashSectorMap( WP_Message* msg ) return true; } -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) UINT32 Loader_Engine::SwapEndianPattern( UINT8* &buffer, UINT32 size, UINT32 count ) { diff --git a/Application/TinyBooter/Commands.h b/Application/TinyBooter/Commands.h index 6ec1d025f..da33d226b 100644 --- a/Application/TinyBooter/Commands.h +++ b/Application/TinyBooter/Commands.h @@ -147,7 +147,7 @@ struct Loader_Engine bool Monitor_SignatureKeyUpdate( WP_Message* msg ); bool EnumerateAndLaunch ( ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) public: void SwapDebuggingValue ( UINT8* &msg, UINT32 size ); void SwapEndian ( WP_Message* msg, void* ptr, int size, bool fReply ); diff --git a/CLR/Core/CLR_RT_HeapBlock.cpp b/CLR/Core/CLR_RT_HeapBlock.cpp index 884917fad..7f80c1e20 100644 --- a/CLR/Core/CLR_RT_HeapBlock.cpp +++ b/CLR/Core/CLR_RT_HeapBlock.cpp @@ -389,7 +389,7 @@ HRESULT CLR_RT_HeapBlock::LoadFromReference( CLR_RT_HeapBlock& ref ) else if(size == 1) { first = ((CLR_UINT8 *)src)[ 0 ]; } else { first = ((CLR_UINT16*)src)[ 0 ]; } -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) ((CLR_UINT32*)&NumericByRef())[ 0 ] = first; ((CLR_UINT32*)&NumericByRef())[ 1 ] = second; #else @@ -403,7 +403,7 @@ HRESULT CLR_RT_HeapBlock::LoadFromReference( CLR_RT_HeapBlock& ref ) ((CLR_UINT32*)&NumericByRef())[ 0 ] = second; ((CLR_UINT32*)&NumericByRef())[ 1 ] = first; } -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN TINYCLR_SET_AND_LEAVE(S_OK); } @@ -531,7 +531,7 @@ HRESULT CLR_RT_HeapBlock::StoreToReference( CLR_RT_HeapBlock& ref, int size ) } } -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 first = ((CLR_UINT32*)&obj->NumericByRef())[ 0 ]; CLR_UINT32 second = ((CLR_UINT32*)&obj->NumericByRef())[ 1 ]; #else @@ -548,7 +548,7 @@ HRESULT CLR_RT_HeapBlock::StoreToReference( CLR_RT_HeapBlock& ref, int size ) first = ((CLR_UINT32*)&obj->NumericByRef())[ 1 ]; second = ((CLR_UINT32*)&obj->NumericByRef())[ 0 ]; } -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN if (sizeArray == 4) { ((CLR_UINT32*)dst)[ 0 ] = (CLR_UINT32)first; } else if(sizeArray == 8) { ((CLR_UINT32*)dst)[ 0 ] = (CLR_UINT32)first; ((CLR_UINT32*)dst)[ 1 ] = (CLR_UINT32)second; } diff --git a/CLR/Core/CLR_RT_HeapBlock_Array.cpp b/CLR/Core/CLR_RT_HeapBlock_Array.cpp index a53098a24..a2e83462c 100644 --- a/CLR/Core/CLR_RT_HeapBlock_Array.cpp +++ b/CLR/Core/CLR_RT_HeapBlock_Array.cpp @@ -206,7 +206,7 @@ HRESULT CLR_RT_HeapBlock_Array::IndexOf( CLR_RT_HeapBlock_Array* array, CLR_RT_H while(true) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) if(memcmp( data, &matchPtr->NumericByRef(), sizeElem ) == 0) { index = pos; diff --git a/CLR/Core/Execution.cpp b/CLR/Core/Execution.cpp index a8e7f81fc..58b7dee7c 100644 --- a/CLR/Core/Execution.cpp +++ b/CLR/Core/Execution.cpp @@ -3066,7 +3066,7 @@ void CLR_RT_ExecutionEngine::StopOnBreakpoint( CLR_DBG_Commands::Debugging_Execu if(m_breakpointsActiveNum == 1) { -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) static CLR_DBG_Commands::Debugging_Execution_BreakpointDef s_breakpoint; CLR_UINT8* data; diff --git a/CLR/Core/Serialization/BinaryFormatter.cpp b/CLR/Core/Serialization/BinaryFormatter.cpp index e70ab3820..71633ecc0 100644 --- a/CLR/Core/Serialization/BinaryFormatter.cpp +++ b/CLR/Core/Serialization/BinaryFormatter.cpp @@ -1635,7 +1635,7 @@ HRESULT CLR_RT_BinaryFormatter::State::AdvanceToTheNextElement() { TINYCLR_CHECK_HRESULT(m_parent->ReadBits( val, bits )); -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( ptr, &val, size ); #else memcpy( ptr, ((unsigned char*)&val)+(sizeof(val)-size), size ); diff --git a/CLR/Core/Streams.cpp b/CLR/Core/Streams.cpp index f09c59a50..c9a818dea 100644 --- a/CLR/Core/Streams.cpp +++ b/CLR/Core/Streams.cpp @@ -165,7 +165,7 @@ HRESULT CLR_RT_HeapBlock_MemoryStream::ReadBits( CLR_UINT64& res, CLR_UINT32 bit CLR_UINT32* ptr = (CLR_UINT32*)&res; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) if(bits > 32) { TINYCLR_CHECK_HRESULT(ReadBits( ptr[ 1 ], bits - 32 )); bits = 32; } else { ptr[ 1 ] = 0; } diff --git a/CLR/Core/TypeSystem.cpp b/CLR/Core/TypeSystem.cpp index 8ec6dd2e6..2aaabbe4b 100644 --- a/CLR/Core/TypeSystem.cpp +++ b/CLR/Core/TypeSystem.cpp @@ -1342,7 +1342,7 @@ bool CLR_RECORD_ASSEMBLY::GoodHeader() const NATIVE_PROFILE_CLR_CORE(); CLR_RECORD_ASSEMBLY header = *this; header.headerCRC = 0; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) if ( (header.flags & CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) == CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) #else if ( (header.flags & CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) != CLR_RECORD_ASSEMBLY::c_Flags_BigEndian) @@ -4430,7 +4430,7 @@ HRESULT CLR_RT_AttributeParser::Next( Value*& res ) CLR_UINT32 size = (dtl.m_sizeInBits + 7) / 8; // FIXME GJS - the numeric values, what is their endiannes??? In the MSTV code there is a BIG endian fix but it looks like it will not work, so was it ever used? -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( &m_lastValue.m_value.NumericByRef(), m_blob, size ); m_blob += size; #else switch(size) diff --git a/CLR/Debugger/Debugger.cpp b/CLR/Debugger/Debugger.cpp index 2cdada787..95ca7847e 100644 --- a/CLR/Debugger/Debugger.cpp +++ b/CLR/Debugger/Debugger.cpp @@ -374,7 +374,7 @@ bool CLR_DBG_Debugger::Monitor_Ping( WP_Message* msg, void* owner ) cmdReply.m_source = CLR_DBG_Commands::Monitor_Ping::c_Ping_Source_TinyCLR; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) cmdReply.m_dbg_flags = CLR_EE_DBG_IS(State_ProgramExited) != 0 ? CLR_DBG_Commands::Monitor_Ping::c_Ping_DbgFlag_AppExit : 0; #else cmdReply.m_dbg_flags = CLR_DBG_Commands::Monitor_Ping::c_Ping_DbgFlag_BigEndian; @@ -1436,7 +1436,7 @@ static bool FillValues( CLR_RT_HeapBlock* ptr, CLR_DBG_Commands::Debugging_Value // Primitives or optimized value types. // -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( dst->m_builtinValue, (void*)&ptr->NumericByRefConst().u1, 8 ); #else { diff --git a/CLR/Include/TinyCLR_Messaging.h b/CLR/Include/TinyCLR_Messaging.h index e8c036a27..a43a22089 100644 --- a/CLR/Include/TinyCLR_Messaging.h +++ b/CLR/Include/TinyCLR_Messaging.h @@ -175,7 +175,7 @@ struct CLR_Messaging static bool Messaging_Send__Reply ( WP_Message* msg, void* owner ); static bool Messaging_Reply ( WP_Message* msg, void* owner ); static bool Messaging_Reply__Reply ( WP_Message* msg, void* owner ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) public: static void SwapDebuggingValue ( UINT8* &msg, UINT32 size ); static void SwapEndian ( WP_Message* msg, void* ptr, int size, bool fReply ); diff --git a/CLR/Include/TinyCLR_PlatformDef.h b/CLR/Include/TinyCLR_PlatformDef.h index 47eea4c9a..5251f8ac1 100644 --- a/CLR/Include/TinyCLR_PlatformDef.h +++ b/CLR/Include/TinyCLR_PlatformDef.h @@ -7,13 +7,16 @@ #include +#ifdef _WIN32 +#define NETMF_TARGET_LITTLE_ENDIAN +#endif + //////////////////////////////////////////////////////////////////////////////////////////////////// // PLATFORMS GENERAL DEFINITIONS #if defined(_WIN32_WCE) #define PLATFORM_WINCE #define TINYCLR_STOP() ::DebugBreak() -#elif defined(_WIN32) || defined(WIN32) -#define PLATFORM_WINDOWS +#elif defined(_WIN32) #define TINYCLR_STOP() ::DebugBreak() #pragma warning( error : 4706 ) // error C4706: assignment within conditional expression #elif defined(arm) || defined(__arm) || defined(__GNUC__) @@ -28,9 +31,9 @@ #define PLATFORM_SH #endif -#if !defined(PLATFORM_WINDOWS) && !defined(PLATFORM_WINCE) -#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) -!ERROR ENDIANNESS NOT DEFINED +#if !defined(PLATFORM_WINDOWS_EMULATOR) && !defined(PLATFORM_WINCE) +#if !defined(NETMF_TARGET_LITTLE_ENDIAN) && !defined(NETMF_TARGET_BIG_ENDIAN) +#error ENDIANNESS NOT DEFINED #endif #endif @@ -89,7 +92,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // WINDOWS -#if defined(PLATFORM_WINDOWS) +#if defined(_WIN32) #define TINYCLR_GC_VERBOSE #define TINYCLR_TRACE_MEMORY_STATS #define TINYCLR_PROFILE_NEW @@ -144,7 +147,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // TRACE DEPENDENCIES -#if defined(TINYCLR_JITTER) || defined(PLATFORM_WINDOWS) +#if defined(TINYCLR_JITTER) || defined(_WIN32) #define TINYCLR_OPCODE_NAMES #define TINYCLR_OPCODE_PARSER #define TINYCLR_OPCODE_STACKCHANGES @@ -166,7 +169,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// // LANGUAGE -#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_WINCE) +#if defined(_WIN32) #define PROHIBIT_ALL_CONSTRUCTORS(cls) \ private: \ cls(); \ @@ -216,7 +219,7 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////// // INCLUDES -#if defined(PLATFORM_WINDOWS) || defined(PLATFORM_WINCE) +#if defined(_WIN32) #if !defined(PLATFORM_WINCE) #define _WIN32_WINNT 0x0501 @@ -280,7 +283,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// -#if defined(PLATFORM_WINCE) +#if defined(_WIN32_WCE) #if (_WIN32_WCE == 0x420) #define ENUMLOGFONTEXW ENUMLOGFONT diff --git a/CLR/Include/TinyCLR_Runtime__HeapBlock.h b/CLR/Include/TinyCLR_Runtime__HeapBlock.h index 27e029d63..9a381d8f0 100644 --- a/CLR/Include/TinyCLR_Runtime__HeapBlock.h +++ b/CLR/Include/TinyCLR_Runtime__HeapBlock.h @@ -11,7 +11,7 @@ #endif //////////////////////////////////////////////////////////////////////////////////////////////////// -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #define CLR_RT_HEAPBLOCK_RAW_ID( dataType, flags, size ) ( (dataType & 0x000000FF) | ((flags & 0x000000FF) << 8) | ((size & 0x0000FFFF) << 16)) #define CLR_RT_HEAPBLOCK_ASSIGN_INTEGER32_SIGNED( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.s4 = (CLR_INT32)num; } @@ -23,7 +23,7 @@ #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT32(dataType,num) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.r4 = num; } #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT64(dataType,num) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.r8 = num; } -#else // BIG_ENDIAN +#else // NETMF_TARGET_BIG_ENDIAN #define CLR_RT_HEAPBLOCK_RAW_ID( dataType, flags, size ) ( (size & 0x0000FFFF) | ((flags & 0x000000FF) << 16) | ((dataType & 0x000000FF) << 24)) #define CLR_RT_HEAPBLOCK_ASSIGN_INTEGER32_SIGNED( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.padS4 = 0; m_data.numeric.s4 = (CLR_INT32)num; } @@ -35,7 +35,7 @@ #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT32( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.padR4 = 0; m_data.numeric.r4 = num; } #define CLR_RT_HEAPBLOCK_ASSIGN_FLOAT64( dataType, num ) { m_id.raw = CLR_RT_HEAPBLOCK_RAW_ID( dataType, 0, 1 ); m_data.numeric.r8 = num; } -#endif // BIG_ENDIAN +#endif // NETMF_TARGET_BIG_ENDIAN //////////////////////////////////////////////////////////// @@ -147,7 +147,7 @@ struct CLR_RT_HeapBlock union Numeric { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT8 u1; CLR_UINT16 u2; CLR_UINT32 u4; @@ -158,7 +158,7 @@ struct CLR_RT_HeapBlock #endif struct U8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; //--// @@ -293,7 +293,7 @@ struct CLR_RT_HeapBlock } u8; // -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_INT8 s1; CLR_INT16 s2; CLR_INT32 s4; @@ -304,7 +304,7 @@ struct CLR_RT_HeapBlock #endif struct S8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; //--// @@ -445,14 +445,14 @@ struct CLR_RT_HeapBlock #if !defined(TINYCLR_EMULATED_FLOATINGPOINT) -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) float r4; #else struct { CLR_UINT32 padR4; float r4; }; #endif struct R8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; #else @@ -464,7 +464,7 @@ struct CLR_RT_HeapBlock { double ret_val; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #if defined(__GNUC__) /// /// This code fixes an optimization problem with the gcc compiler. @@ -525,7 +525,7 @@ struct CLR_RT_HeapBlock R8& operator=( const double num ) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #if defined(__GNUC__) /// /// This code fixes an optimization problem with the gcc compiler. @@ -649,7 +649,7 @@ struct CLR_RT_HeapBlock #else /// not using floating point lib, emulated one -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 padR4; #endif @@ -705,7 +705,7 @@ struct CLR_RT_HeapBlock struct R8 { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CLR_UINT32 _L; CLR_UINT32 _H; //--// @@ -833,7 +833,7 @@ struct CLR_RT_HeapBlock // MemLE: DDCCBBAA // So for LE DD,Addr 00 is the low byte. // For BE it is certainly not true, hence this check will not work. Will Interop? FIXME GJS - verify interop -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) CT_ASSERT_UNIQUE_NAME( offsetof( Numeric, s1 ) == 0, s1 ) CT_ASSERT_UNIQUE_NAME( offsetof( Numeric, s2 ) == 0, s2 ) CT_ASSERT_UNIQUE_NAME( offsetof( Numeric, s4 ) == 0, s4 ) @@ -1078,7 +1078,7 @@ struct CLR_RT_HeapBlock } //--// -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) const CLR_RT_HeapBlock_AtomicData& DataByRefConst() const { return m_data; } #else const CLR_RT_HeapBlock_AtomicData& DataByRefConst() const diff --git a/CLR/Include/TinyCLR_Types.h b/CLR/Include/TinyCLR_Types.h index 01b0dcdc8..b13e8a5ba 100644 --- a/CLR/Include/TinyCLR_Types.h +++ b/CLR/Include/TinyCLR_Types.h @@ -611,7 +611,7 @@ inline CLR_UINT32 CLR_TkFromStream( const CLR_UINT8*& p ) #define TINYCLR_READ_UNALIGNED_UINT8(arg,ip) arg = *(const CLR_UINT8 *)ip; ip += sizeof(CLR_UINT8 ) template __inline void TINYCLR_READ_UNALIGNED_UINT16(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT16)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT16)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); #else @@ -621,7 +621,7 @@ template __inline void TINYCLR_READ_UNALIGNED_UINT16(T& arg, CLR_PME } template __inline void TINYCLR_READ_UNALIGNED_UINT32(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -631,11 +631,11 @@ template __inline void TINYCLR_READ_UNALIGNED_UINT32(T& arg, CLR_PME arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN } template __inline void TINYCLR_READ_UNALIGNED_UINT64(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -653,24 +653,24 @@ template __inline void TINYCLR_READ_UNALIGNED_UINT64(T& arg, CLR_PME arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN } #define TINYCLR_READ_UNALIGNED_INT8(arg,ip) arg = *(const CLR_INT8 * )ip; ip += sizeof(CLR_INT8 ) template __inline void TINYCLR_READ_UNALIGNED_INT16(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT16)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT16)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); #else arg = (CLR_UINT16)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT16)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN arg = (CLR_INT16)arg; } template __inline void TINYCLR_READ_UNALIGNED_INT32(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -680,12 +680,12 @@ template __inline void TINYCLR_READ_UNALIGNED_INT32(T& arg, CLR_PMET arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT32)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN arg = (CLR_INT32)arg; } template __inline void TINYCLR_READ_UNALIGNED_INT64(T& arg, CLR_PMETADATA& ip) { -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) arg = (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); @@ -703,7 +703,7 @@ template __inline void TINYCLR_READ_UNALIGNED_INT64(T& arg, CLR_PMET arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 16; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) << 8; ip += sizeof(CLR_UINT8); arg |= (CLR_UINT64)(*(const CLR_UINT8 *)ip) ; ip += sizeof(CLR_UINT8); -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN arg = (CLR_INT64)arg; } diff --git a/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp b/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp index b1770abe6..da9dd46cc 100644 --- a/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp +++ b/CLR/Libraries/CorLib/corlib_native_System_Runtime_CompilerServices_RuntimeHelpers.cpp @@ -37,7 +37,7 @@ HRESULT Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::In CLR_UINT32 sizeDst = array->m_sizeOfElement; lenSrc /= sizeDst; if(lenSrc > lenDst) lenSrc = lenDst; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) memcpy( ptrDst, ptrSrc, lenSrc * sizeDst ); #if defined(TINYCLR_EMULATED_FLOATINGPOINT) @@ -165,7 +165,7 @@ HRESULT Library_corlib_native_System_Runtime_CompilerServices_RuntimeHelpers::In break; } #endif -#endif //BIG_ENDIAN +#endif //NETMF_TARGET_BIG_ENDIAN } TINYCLR_NOCLEANUP(); diff --git a/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp b/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp index 851d5dfa3..12a5cde1d 100644 --- a/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp +++ b/CLR/Libraries/SPOT_Update/spot_update_native_Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp @@ -320,7 +320,7 @@ static bool DeserializeIntrinsicType(CLR_RT_HeapBlock* pObj, CLR_UINT8* serData, while(size--) { -#ifndef BIG_ENDIAN +#ifndef NETMF_TARGET_BIG_ENDIAN tmp[i++ ] = serData[serOffset++]; #else tmp[size] = serData[serOffset++]; @@ -379,7 +379,7 @@ static bool DeserializeObject(CLR_RT_HeapBlock* pObj, CLR_UINT8* serData, CLR_IN while(size--) { -#ifndef BIG_ENDIAN +#ifndef NETMF_TARGET_BIG_ENDIAN pData[i++ ] = serData[serOffset++]; #else pData[size] = serData[serOffset++]; @@ -438,7 +438,7 @@ static bool SerializeIntrinsicType(CLR_DataType type, CLR_UINT8* data, CLR_UINT8 while(size--) { -#ifndef BIG_ENDIAN +#ifndef NETMF_TARGET_BIG_ENDIAN serData[serOffset++] = *tmp++; #else serData[serOffset++] = tmp[size]; diff --git a/CLR/Messaging/Messaging.cpp b/CLR/Messaging/Messaging.cpp index 32e6500d1..c8512d218 100644 --- a/CLR/Messaging/Messaging.cpp +++ b/CLR/Messaging/Messaging.cpp @@ -420,7 +420,7 @@ bool CLR_Messaging::ProcessPayload( WP_Message* msg ) } //--// -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, msg->m_payload, msg->m_header.m_size, false ); #endif const CLR_Messaging_CommandHandlerLookups* tables; @@ -535,7 +535,7 @@ bool CLR_Messaging::TransmitMessage( const WP_Message* msg, bool fQueue ) UINT32 payloadSize; UINT32 flags; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) payloadSize = msg->m_header.m_size; flags = msg->m_header.m_flags; #else @@ -656,7 +656,7 @@ void CLR_Messaging::ReplyToCommand( WP_Message* msg, bool fSuccess, bool fCritic msgReply.Initialize( &m_controller ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian( msg, ptr, size, true ); #endif @@ -672,7 +672,7 @@ void CLR_Messaging::ReplyToCommand( WP_Message* msg, bool fSuccess, bool fCritic } //--// -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) UINT32 CLR_Messaging::SwapEndianPattern( UINT8* &buffer, UINT32 size, UINT32 count ) { UINT32 consumed=0; diff --git a/CLR/Messaging/Messaging_stub.cpp b/CLR/Messaging/Messaging_stub.cpp index 18194d137..16e02e033 100644 --- a/CLR/Messaging/Messaging_stub.cpp +++ b/CLR/Messaging/Messaging_stub.cpp @@ -65,7 +65,7 @@ void CLR_Messaging::Cleanup() NATIVE_PROFILE_CLR_MESSAGING(); } -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) UINT32 CLR_Messaging::SwapEndianPattern( UINT8* &buffer, UINT32 size, UINT32 count ) { diff --git a/CMSIS/CMSIS-SP-00300-r4p2-00rel0.txt b/CMSIS/CMSIS-SP-00300-r4p2-00rel0.txt deleted file mode 100644 index 203822da7..000000000 --- a/CMSIS/CMSIS-SP-00300-r4p2-00rel0.txt +++ /dev/null @@ -1,2 +0,0 @@ -The CMSIS version this code is based on is: -CMSIS-SP-00300-r4p2-00rel0 \ No newline at end of file diff --git a/CMSIS/CMSIS_RTX/dotNetMF.proj b/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj similarity index 93% rename from CMSIS/CMSIS_RTX/dotNetMF.proj rename to CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj index e34df39e8..7c644eb25 100644 --- a/CMSIS/CMSIS_RTX/dotNetMF.proj +++ b/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj @@ -8,7 +8,7 @@ CMSIS-RTX OS HAL CMSIS_RTX.$(LIB_EXT) - $(SPOCLIENT)\CMSIS\CMSIS_RTX\dotNetMF.proj + $(SPOCLIENT)\CMSIS\CMSIS\RTOS\RTX\dotNetMF.proj CMSIS_RTX.$(LIB_EXT).manifest OS\CMSIS_RTOS @@ -31,8 +31,8 @@ - - + + diff --git a/CMSIS/ReadMe.md b/CMSIS/ReadMe.md index ef6ec6684..d712fb476 100644 --- a/CMSIS/ReadMe.md +++ b/CMSIS/ReadMe.md @@ -2,6 +2,6 @@ This folder is a placeholder for the CMSIS source code installation. CMSIS is available from ARM on the [ARM web site](http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php) -CMSIS comes as a ZIP file, **_the version this code base is validated and tested with is v4.2 (CMSIS-SP-00300-r4p2-00rel0.zip)_** +CMSIS comes as a ZIP file, **_the version this code base is validated and tested with is v4.3 (CMSIS-SP-00300-r4p3-00rel0.zip)_** Extract the contents of the zip file into the same directory as this readme.md file. The build system will look for the CMSIS support files here. diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/GlobalLock/dotNetMF.proj b/DeviceCode/Cores/arm/Processors/CortexMx/GlobalLock/dotNetMF.proj index 552ea27db..6c424fdaf 100644 --- a/DeviceCode/Cores/arm/Processors/CortexMx/GlobalLock/dotNetMF.proj +++ b/DeviceCode/Cores/arm/Processors/CortexMx/GlobalLock/dotNetMF.proj @@ -2,10 +2,10 @@ GlobalLock_hal_Cortex {A839EEC5-C737-48C5-958B-BBF12920AA41} - Cortex-M3 Global lock + Cortex-Mx Global lock HAL GlobalLock_hal_Cortex.$(LIB_EXT) - $(SPOCLIENT)\DeviceCode\Cores\arm\Processors\CortexMx\dotNetMF.proj + $(SPOCLIENT)\DeviceCode\Cores\arm\Processors\CortexMx\GlobalLock\dotNetMF.proj GlobalLock_hal_Cortex.$(LIB_EXT).manifest diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/ItmPort.cpp b/DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/ItmPort.cpp new file mode 100644 index 000000000..a62c83c75 --- /dev/null +++ b/DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/ItmPort.cpp @@ -0,0 +1,49 @@ +#include + +#include "cmsis_generic.h" + +// only one "generic" port supported for ITM tracing messages to hardware debugger +// so pInstance is ignored +static int ItmPort_Write( void* pInstance, const char* Data, size_t size ) +{ + for( int i = 0; i< size; ++i ) + ITM_SendChar( Data[i] ); + + return size; +} + +static IGenericPort const ItmPortItf = +{ + // default returns TRUE + NULL, //BOOL (*Initialize)( void* pInstance ); + + // default returns TRUE + NULL, //BOOL (*Uninitialize)( void* pInstance ); + + // default return 0 + ItmPort_Write, //int (*Write)( void* pInstance, const char* Data, size_t size ); + + // defualt return 0 + NULL, //int (*Read)( void* pInstance, char* Data, size_t size ); + + // default return TRUE + NULL, //BOOL (*Flush)( void* pInstance ); + + // default do nothing + NULL, //void (*ProtectPins)( void* pInstance, BOOL On ); + + // default return FALSE + NULL, //BOOL (*IsSslSupported)( void* pInstance ); + + // default return FALSE + NULL, //BOOL (*UpgradeToSsl)( void* pInstance, const UINT8* pCACert, UINT32 caCertLen, const UINT8* pDeviceCert, UINT32 deviceCertLen, LPCSTR szTargetHost ); + + // default return FALSE + NULL, //BOOL (*IsUsingSsl)( void* pInstance ); +}; + +extern const GenericPortTableEntry Itm0GenericPort = +{ + ItmPortItf, + NULL +}; diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/dotNetMF.proj b/DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/dotNetMF.proj new file mode 100644 index 000000000..65185d9c0 --- /dev/null +++ b/DeviceCode/Cores/arm/Processors/CortexMx/ItmPort/dotNetMF.proj @@ -0,0 +1,27 @@ + + + CortexMx_ItmPort + {E30D2587-7481-4ECB-A961-16A8BA3DECB9} + Cortex-Mx Generic ITM port + HAL + CortexMx_ItmPort.$(LIB_EXT) + $(SPOCLIENT)\DeviceCode\Cores\arm\Processors\CortexMx\ItmPort\dotNetMF.proj + CortexMx_ItmPort.$(LIB_EXT).manifest + + + False + False + False + False + DeviceCode\Cores\arm\Processors\CortexMx + Library + false + 4.0.0.0 + + + + + + + + diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/cmsis_generic.h b/DeviceCode/Cores/arm/Processors/CortexMx/cmsis_generic.h new file mode 100644 index 000000000..32f9ff642 --- /dev/null +++ b/DeviceCode/Cores/arm/Processors/CortexMx/cmsis_generic.h @@ -0,0 +1,20 @@ +#ifndef _CMSIS_GENERIC_H +#define _CMSIS_GENERIC_H + +#define __CMSIS_GENERIC /* disable implementation specific functions (i.e. NVIC and Systick ) */ + +#if defined (CORTEX_M7) + #include "core_cm7.h" +#elif defined (CORTEX_M4) + #include "core_cm4.h" +#elif defined (CORTEX_M3) + #include "core_cm3.h" +#elif defined (CORTEX_M0) + #include "core_cm0.h" +#elif defined (CORTEX_M0PLUS) + #include "core_cm0plus.h" +#else + #error "Processor not specified or unsupported." +#endif + +#endif diff --git a/DeviceCode/Initialization/tinyhal.cpp b/DeviceCode/Initialization/tinyhal.cpp index aa41f5784..48f42b66d 100644 --- a/DeviceCode/Initialization/tinyhal.cpp +++ b/DeviceCode/Initialization/tinyhal.cpp @@ -382,9 +382,7 @@ void HAL_Initialize() LCD_Initialize(); -#if !defined(HAL_REDUCESIZE) CPU_InitializeCommunication(); -#endif I2C_Initialize(); diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/STM32F4_usart_functions.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/STM32F4_usart_functions.cpp index 4f9e83ab4..9f5ec66d1 100755 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/STM32F4_usart_functions.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/STM32F4_usart_functions.cpp @@ -106,10 +106,6 @@ void STM32F4_USART_Interrupt5 (void* param) BOOL CPU_USART_Initialize( int ComPortNum, int BaudRate, int Parity, int DataBits, int StopBits, int FlowValue ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return TRUE; - - --ComPortNum; if (ComPortNum >= TOTAL_USART_PORT) return FALSE; @@ -232,8 +228,8 @@ BOOL CPU_USART_Initialize( int ComPortNum, int BaudRate, int Parity, int DataBit CPU_INTC_ActivateInterrupt(USART6_IRQn, STM32F4_USART_Interrupt5, 0); break; -// some SoCS have more UARTs (default is 6 + ITM channel 0) -#if TOTAL_USART_PORT > 7 +// some SoCS have more UARTs (default is 6 ) +#if TOTAL_USART_PORT > 6 case 6: CPU_INTC_ActivateInterrupt(UART7_IRQn, STM32F4_USART_Interrupt4, 0); break; @@ -251,10 +247,6 @@ BOOL CPU_USART_Initialize( int ComPortNum, int BaudRate, int Parity, int DataBit BOOL CPU_USART_Uninitialize( int ComPortNum ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return TRUE; - - --ComPortNum; GLOBAL_LOCK(irq); g_STM32F4_Uart_Ports[ComPortNum]->CR1 = 0; // stop uart @@ -285,8 +277,8 @@ BOOL CPU_USART_Uninitialize( int ComPortNum ) CPU_INTC_DeactivateInterrupt(USART6_IRQn); break; -// some SoCS have more UARTs (default is 6 + ITM channel 0) -#if TOTAL_USART_PORT > 7 +// some SoCS have more UARTs (default is 6 ) +#if TOTAL_USART_PORT > 6 case 6: CPU_INTC_DeactivateInterrupt(UART7_IRQn); break; @@ -322,10 +314,6 @@ BOOL CPU_USART_Uninitialize( int ComPortNum ) BOOL CPU_USART_TxBufferEmpty( int ComPortNum ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return TRUE; - - --ComPortNum; if (g_STM32F4_Uart_Ports[ComPortNum]->SR & USART_SR_TXE) return TRUE; @@ -334,10 +322,6 @@ BOOL CPU_USART_TxBufferEmpty( int ComPortNum ) BOOL CPU_USART_TxShiftRegisterEmpty( int ComPortNum ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return TRUE; - - --ComPortNum; if (g_STM32F4_Uart_Ports[ComPortNum]->SR & USART_SR_TC) return TRUE; @@ -346,12 +330,6 @@ BOOL CPU_USART_TxShiftRegisterEmpty( int ComPortNum ) void CPU_USART_WriteCharToTxBuffer( int ComPortNum, UINT8 c ) { - if (ComPortNum == ITM_VIRTUAL_COMPORTNUM) - { - ITM_SendChar(c); - return; - } - --ComPortNum; #ifdef DEBUG ASSERT(CPU_USART_TxBufferEmpty(ComPortNum)); #endif @@ -360,10 +338,6 @@ void CPU_USART_WriteCharToTxBuffer( int ComPortNum, UINT8 c ) void CPU_USART_TxBufferEmptyInterruptEnable( int ComPortNum, BOOL Enable ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return; - - --ComPortNum; ptr_USART_TypeDef uart = g_STM32F4_Uart_Ports[ComPortNum]; if (Enable) { @@ -377,10 +351,6 @@ void CPU_USART_TxBufferEmptyInterruptEnable( int ComPortNum, BOOL Enable ) BOOL CPU_USART_TxBufferEmptyInterruptState( int ComPortNum ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return FALSE; // no TX interrupt for ITM port, it is one word at a time pulled by hardware - - --ComPortNum; if (g_STM32F4_Uart_Ports[ComPortNum]->CR1 & USART_CR1_TXEIE) return TRUE; @@ -389,10 +359,6 @@ BOOL CPU_USART_TxBufferEmptyInterruptState( int ComPortNum ) void CPU_USART_RxBufferFullInterruptEnable( int ComPortNum, BOOL Enable ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return; - - --ComPortNum; ptr_USART_TypeDef uart = g_STM32F4_Uart_Ports[ComPortNum]; if (Enable) { @@ -406,11 +372,6 @@ void CPU_USART_RxBufferFullInterruptEnable( int ComPortNum, BOOL Enable ) BOOL CPU_USART_RxBufferFullInterruptState( int ComPortNum ) { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return FALSE; // there is no receive interrupt for ITM; it's one way only. - - --ComPortNum; - if (g_STM32F4_Uart_Ports[ComPortNum]->CR1 & USART_CR1_RXNEIE) return TRUE; @@ -419,8 +380,6 @@ BOOL CPU_USART_RxBufferFullInterruptState( int ComPortNum ) BOOL CPU_USART_TxHandshakeEnabledState( int ComPortNum ) { - --ComPortNum; - // The state of the CTS input only matters if Flow Control is enabled #ifdef STM32F4_UART_CTS_PINS if( (UINT32)ComPortNum < ARRAYSIZE_CONST_EXPR(g_STM32F4_Uart_CTS_Pins) @@ -436,11 +395,6 @@ BOOL CPU_USART_TxHandshakeEnabledState( int ComPortNum ) void CPU_USART_ProtectPins( int ComPortNum, BOOL On ) // idempotent { - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return; - - --ComPortNum; - if (On) { CPU_USART_RxBufferFullInterruptEnable(ComPortNum, FALSE); @@ -461,11 +415,6 @@ UINT32 CPU_USART_PortsCount() void CPU_USART_GetPins( int ComPortNum, GPIO_PIN& rxPin, GPIO_PIN& txPin,GPIO_PIN& ctsPin, GPIO_PIN& rtsPin ) { rxPin = txPin = ctsPin = rtsPin = GPIO_PIN_NONE; - if( ComPortNum == ITM_VIRTUAL_COMPORTNUM ) - return; - - --ComPortNum; - if ((UINT32)ComPortNum >= ARRAYSIZE_CONST_EXPR(g_STM32F4_Uart_RxD_Pins)) return; @@ -483,13 +432,6 @@ void CPU_USART_GetPins( int ComPortNum, GPIO_PIN& rxPin, GPIO_PIN& txPin,GPIO_PI void CPU_USART_GetBaudrateBoundary( int ComPortNum, UINT32 & maxBaudrateHz, UINT32 & minBaudrateHz ) { - if (ComPortNum == ITM_VIRTUAL_COMPORTNUM) - { - maxBaudrateHz = 0; - minBaudrateHz = 0; - return; - } - --ComPortNum; UINT32 clk = SYSTEM_APB2_CLOCK_HZ; if (ComPortNum && ComPortNum != 5) clk = SYSTEM_APB1_CLOCK_HZ; @@ -500,24 +442,11 @@ void CPU_USART_GetBaudrateBoundary( int ComPortNum, UINT32 & maxBaudrateHz, UINT BOOL CPU_USART_SupportNonStandardBaudRate( int ComPortNum ) { - if (ComPortNum == ITM_VIRTUAL_COMPORTNUM) - return FALSE; - return TRUE; } BOOL CPU_USART_IsBaudrateSupported( int ComPortNum, UINT32& BaudrateHz ) { - if (ComPortNum == ITM_VIRTUAL_COMPORTNUM) - { - if ( BaudrateHz == 0 ) - return TRUE; - - BaudrateHz = 0; - return FALSE; - } - - --ComPortNum; UINT32 max = SYSTEM_APB2_CLOCK_HZ >> 4; if (ComPortNum && ComPortNum != 5) max = SYSTEM_APB1_CLOCK_HZ >> 4; diff --git a/DeviceCode/Targets/Native/STM32F4/processor_selector.h b/DeviceCode/Targets/Native/STM32F4/processor_selector.h index 0212d655a..d4a57fbb9 100644 --- a/DeviceCode/Targets/Native/STM32F4/processor_selector.h +++ b/DeviceCode/Targets/Native/STM32F4/processor_selector.h @@ -22,7 +22,7 @@ #elif defined(PLATFORM_ARM_STM32F4) #define STM32F4XX #else -ERROR - WE SHOULD NOT INCLUDE THIS HEADER IF NOT BUILDING A STM32F2/F4 PLATFORM +ERROR - WE SHOULD NOT INCLUDE THIS HEADER IF NOT BUILDING AN STM32F2/F4 PLATFORM #endif ///////////////////////////////////////////////////////// @@ -61,9 +61,11 @@ ERROR - WE SHOULD NOT INCLUDE THIS HEADER IF NOT BUILDING A STM32F2/F4 PLATFORM // // Port definitions -#define ITM_VIRTUAL_COMPORTNUM 0 +#ifndef ITM_GENERIC_PORTNUM +#define ITM_GENERIC_PORTNUM 0 +#endif -#define ITM0 ConvertCOM_ComHandle( ITM_VIRTUAL_COMPORTNUM ) +#define ITM0 ConvertCOM_GenericHandle( ITM_GENERIC_PORTNUM ) #define COM1 ConvertCOM_ComHandle(1) #define COM2 ConvertCOM_ComHandle(2) #define COM3 ConvertCOM_ComHandle(3) diff --git a/DeviceCode/Targets/OS/CMSIS_RTOS/CMSIS_RTOS.settings b/DeviceCode/Targets/OS/CMSIS_RTOS/CMSIS_RTOS.settings index 3f6f2f89c..cd7350d15 100644 --- a/DeviceCode/Targets/OS/CMSIS_RTOS/CMSIS_RTOS.settings +++ b/DeviceCode/Targets/OS/CMSIS_RTOS/CMSIS_RTOS.settings @@ -15,15 +15,15 @@ CMSIS_RTOS OS false + 4.3.0 - + - - + @@ -33,5 +33,15 @@ Condition="!EXISTS('$(SPOCLIENT)\CMSIS\ARM.CMSIS.pdsc')" Text="Missing CMSIS installation at: $(SPOCLIENT)\CMSIS\*" /> + + + + + diff --git a/DeviceCode/include/COM_decl.h b/DeviceCode/include/COM_decl.h index 67e46ba4d..5d2ae7ea5 100644 --- a/DeviceCode/include/COM_decl.h +++ b/DeviceCode/include/COM_decl.h @@ -5,7 +5,70 @@ #ifndef _DRIVERS_COM_DIRECTOR_DECL_H_ #define _DRIVERS_COM_DIRECTOR_DECL_H_ 1 -//--// +// The functionality of Generic ports is triggered by +// defining TOTAL_GENERIC_PORTS to a value > 0 in the +// solution's platform_selector.h header file +// Otherwise, the implementation of these functions is +// just a stub that returns values indicating failure +// as they should never be called. + +BOOL GenericPort_Initialize( int portNum ); +BOOL GenericPort_Uninitialize( int portNum ); +int GenericPort_Write( int portNum, const char* Data, size_t size ); +int GenericPort_Read( int portNum, char* Data, size_t size ); +BOOL GenericPort_Flush( int portNum ); +void GenericPort_ProtectPins( int portNum, BOOL On ); +BOOL GenericPort_IsSslSupported( int portNum ); +BOOL GenericPort_UpgradeToSsl( int portNum, const UINT8* pCACert, UINT32 caCertLen, const UINT8* pDeviceCert, UINT32 deviceCertLen, LPCSTR szTargetHost ); +BOOL GenericPort_IsUsingSsl( int portNum ); + +// interface table for a generic port +// any NULL entries in the table indicates default handling is desired +struct IGenericPort +{ + // default returns TRUE + BOOL (*Initialize)( void* pInstance ); + + // default returns TRUE + BOOL (*Uninitialize)( void* pInstance ); + + // default return 0 + int (*Write)( void* pInstance, const char* Data, size_t size ); + + // defualt return 0 + int (*Read)( void* pInstance, char* Data, size_t size ); + + // default return TRUE + BOOL (*Flush)( void* pInstance ); + + // default do nothing + void (*ProtectPins)( void* pInstance, BOOL On ); + + // default return FALSE + BOOL (*IsSslSupported)( void* pInstance ); + + // default return FALSE + BOOL (*UpgradeToSsl)( void* pInstance, const UINT8* pCACert, UINT32 caCertLen, const UINT8* pDeviceCert, UINT32 deviceCertLen, LPCSTR szTargetHost ); + + // default return FALSE + BOOL (*IsUsingSsl)( void* pInstance ); +}; + +struct GenericPortTableEntry +{ + IGenericPort const& Port; + void* pInstance; +}; + +#if TOTAL_GENERIC_PORTS > 0 +// ConvertCOM_GenericPort( ComPortHandle ) produces an index into this table +// This table is provided by the solution to allow customization and extensibility +// at the solution level. Individual port "drivers" can provide a common +// GenericPortTableEntry structure implementation yet still remain independent of +// the actual solution since the solution owns the table, and ordering and thus the +// handle definitions as well. +extern GenericPortTableEntry const* const g_GenericPorts[ TOTAL_GENERIC_PORTS ]; +#endif extern INT32 g_DebuggerPort_SslCtx_Handle; diff --git a/DeviceCode/include/Sockets_decl.h b/DeviceCode/include/Sockets_decl.h index dda4a4bd3..2f486fdd0 100644 --- a/DeviceCode/include/Sockets_decl.h +++ b/DeviceCode/include/Sockets_decl.h @@ -419,7 +419,7 @@ extern const ConfigurationSector g_ConfigurationSector; //--// -#if defined(LITTLE_ENDIAN) || defined(PLATFORM_WINDOWS) +#if defined(NETMF_TARGET_LITTLE_ENDIAN) #define SOCK_htons(x) ( (((x) & 0x000000FFUL) << 8) | (((x) & 0x0000FF00UL) >> 8) ) #define SOCK_htonl(x) ( (((x) & 0x000000FFUL) << 24) | (((x) & 0x0000FF00UL) << 8) | (((x) & 0x00FF0000UL) >> 8) | (((x) & 0xFF000000UL) >> 24) ) #define SOCK_ntohs(x) SOCK_htons(x) diff --git a/DeviceCode/include/TinyCLR_Endian.h b/DeviceCode/include/TinyCLR_Endian.h index 69bc9dd47..4187d8e71 100644 --- a/DeviceCode/include/TinyCLR_Endian.h +++ b/DeviceCode/include/TinyCLR_Endian.h @@ -3,7 +3,7 @@ // // // Microsoft dotNetMF Project -// Copyright �2001,2002,2009 Microsoft Corporation +// Copyright �2001,2002,2009 Microsoft Corporation // One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. // All rights reserved. // MICROSOFT CONFIDENTIAL @@ -73,7 +73,7 @@ __inline INT64 SwapEndian( INT64 u ) } // These macros only swap the Endiannes on BIG Endian machines -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) #define SwapEndianIfBE( a ) a #define SwapEndianIfBEc32( a ) a #define SwapEndianIfBEc16( a ) a diff --git a/DeviceCode/include/tinyhal.h b/DeviceCode/include/tinyhal.h index e582c8177..d0ffb014b 100644 --- a/DeviceCode/include/tinyhal.h +++ b/DeviceCode/include/tinyhal.h @@ -183,11 +183,11 @@ struct GPIO_FLAG #define STANDARD_USART_MIN_BAUDRATE 75 #define STANDARD_USART_MAX_BAUDRATE 2304000 -// Defines a type representing both a port type or "transport" and a port number +// COM_HANDLE Defines a type representing both a port type or "transport" and a port number // The COM_HANDLE is a multi bit field value with the following bit fields usage // |--------+--------+--------+--------| // |33222222|22221111|111111 | | -// |10987654|32109876|54321098|76543210| +// |10987654|32109876|54321098|76543210| bit position // |--------+--------+--------+--------| // |00000000|00000000|TTTTTTTT|pppppppp| ( transport != USB_TRANSPORT ) // |--------+--------+--------+--------| @@ -203,12 +203,20 @@ struct GPIO_FLAG // LCD_TRANSPORT => 5 // FLASH_WRITE_TRANSPORT => 6 // MESSAGING_TRANSPORT => 7 +// GENERIC_TRANSPORT => 8 // p => port instance number -// Port instances in the handle are 1 based. (e.g. p == 0 is invalid ) +// Port instances in the handle are 1 based. (e.g. p == 0 is invalid except when T == 0 ) // c -> Controller instance number ( USB_TRANSPORT only ) // -// NULL_PORT => T==0 && p == 0 -// +// NULL_PORT => T==0 && p == 0 +// +// GENERIC_TRANSPORT is any custom port that isn't one of the above, they +// are implemneted for the DebugPort_xxxx apis and the port number is +// and index into a const global table of port interfaces (structure of +// function pointers) These allow custom extensions to the normal transports +// without needing to continue defining additional transport types and modifiying +// switch on transport code. To keep compatibility high and code churn low, the +// previous legacy transports remain. typedef INT32 COM_HANDLE; #define TRANSPORT_SHIFT 8 @@ -222,6 +230,7 @@ typedef INT32 COM_HANDLE; #define ExtractEventFromTransport(x) (ExtractTransport(x) == USART_TRANSPORT ? SYSTEM_EVENT_FLAG_COM_IN: \ ExtractTransport(x) == USB_TRANSPORT ? SYSTEM_EVENT_FLAG_USB_IN: \ ExtractTransport(x) == SOCKET_TRANSPORT ? SYSTEM_EVENT_FLAG_SOCKET: \ + ExtractTransport(x) == GENERIC_TRANSPORT ? SYSTEM_EVENT_FLAG_GENERIC_PORT: \ ExtractTransport(x) == DEBUG_TRANSPORT ? SYSTEM_EVENT_FLAG_DEBUGGER_ACTIVITY: \ ExtractTransport(x) == MESSAGING_TRANSPORT ? SYSTEM_EVENT_FLAG_MESSAGING_ACTIVITY: \ 0) \ @@ -248,11 +257,14 @@ typedef INT32 COM_HANDLE; #define MESSAGING_TRANSPORT (7 << TRANSPORT_SHIFT) +#define GENERIC_TRANSPORT (8 << TRANSPORT_SHIFT) + #define COM_IsSerial(x) (((x) & TRANSPORT_MASK) == USART_TRANSPORT) #define COM_IsUsb(x) (((x) & TRANSPORT_MASK) == USB_TRANSPORT) #define COM_IsSock(x) (((x) & TRANSPORT_MASK) == SOCKET_TRANSPORT) #define COM_IsDebug(x) (((x) & TRANSPORT_MASK) == DEBUG_TRANSPORT) #define COM_IsMessaging(x) (((x) & TRANSPORT_MASK) == MESSAGING_TRANSPORT) +#define COM_IsGeneric(x) (((x) & TRANSPORT_MASK) == GENERIC_TRANSPORT) // Extracts a USART port number from a USART COM_HANDLE #define ConvertCOM_ComPort(x) (((x) & PORT_NUMBER_MASK) - 1) @@ -272,9 +284,12 @@ typedef INT32 COM_HANDLE; // Extracts a Debug transport port id from a DEBUG_TRANSPORT COM_HANDLE #define ConvertCOM_DebugPort(x) (((x) & PORT_NUMBER_MASK) - 1) -// Extracts a messaging transport port id from a MESSAGING_TRASNPORT COM_HANDLE +// Extracts a messaging transport port id from a MESSAGING_TRANSPORT COM_HANDLE #define ConvertCOM_MessagingPort(x) (((x) & PORT_NUMBER_MASK) - 1) +// Extracts a generic transport port id from a GENERIC_TRANSPORT COM_HANDLE +#define ConvertCOM_GenericPort(x) (((x) & PORT_NUMBER_MASK) - 1) + // Creates a COM_HANDLE value for a platform specific USART port number #define ConvertCOM_ComHandle(x) ((COM_HANDLE)((x) + USART_TRANSPORT + 1)) @@ -289,10 +304,11 @@ typedef INT32 COM_HANDLE; // Creates a COM_HANDLE value for a platform specific port number #define ConvertCOM_DebugHandle(x) ((COM_HANDLE)((x) + DEBUG_TRANSPORT + 1)) -// Creates a COM_HANDLE value for a platform specific MESsAGING port number +// Creates a COM_HANDLE value for a platform specific MESSAGING port number #define ConvertCOM_MessagingHandle(x)((COM_HANDLE)((x) + MESSAGING_TRANSPORT + 1)) -//--// +// Creates a COM_HANDLE value for a platform specific GENERIC port number +#define ConvertCOM_GenericHandle(x)((COM_HANDLE)((x) + GENERIC_TRANSPORT + 1)) typedef UINT32 FLASH_WORD; @@ -638,7 +654,7 @@ void ApplicationEntryPoint(); #define SYSTEM_EVENT_FLAG_TIMER1 0x00000020 #define SYSTEM_EVENT_FLAG_TIMER2 0x00000040 #define SYSTEM_EVENT_FLAG_BUTTON 0x00000080 -#define SYSTEM_EVENT_FLAG_UNUSED_0x00000100 0x00000100 +#define SYSTEM_EVENT_FLAG_GENERIC_PORT 0x00000100 #define SYSTEM_EVENT_FLAG_UNUSED_0x00000200 0x00000200 #define SYSTEM_EVENT_FLAG_UNUSED_0x00000400 0x00000400 #define SYSTEM_EVENT_FLAG_NETWORK 0x00000800 @@ -1433,16 +1449,16 @@ extern const ConfigurationSector g_ConfigurationSector; #if !defined(BUILD_RTM) -#define DEBUG_TRACE0(t, s) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s) ) -#define DEBUG_TRACE1(t, s, p1) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1) ) -#define DEBUG_TRACE2(t, s, p1,p2) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2) ) -#define DEBUG_TRACE3(t, s, p1,p2,p3) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3) ) -#define DEBUG_TRACE4(t, s, p1,p2,p3,p4) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4) ) -#define DEBUG_TRACE5(t, s, p1,p2,p3,p4,p5) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5) ) -#define DEBUG_TRACE6(t, s, p1,p2,p3,p4,p5,p6) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6) ) -#define DEBUG_TRACE7(t, s, p1,p2,p3,p4,p5,p6,p7) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7) ) -#define DEBUG_TRACE8(t, s, p1,p2,p3,p4,p5,p6,p7,p8) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8) ) -#define DEBUG_TRACE9(t, s, p1,p2,p3,p4,p5,p6,p7,p8,p9) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8),(p9) ) +#define DEBUG_TRACE0(t, s) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s) ) +#define DEBUG_TRACE1(t, s, p1) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1) ) +#define DEBUG_TRACE2(t, s, p1,p2) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2) ) +#define DEBUG_TRACE3(t, s, p1,p2,p3) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3) ) +#define DEBUG_TRACE4(t, s, p1,p2,p3,p4) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4) ) +#define DEBUG_TRACE5(t, s, p1,p2,p3,p4,p5) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5) ) +#define DEBUG_TRACE6(t, s, p1,p2,p3,p4,p5,p6) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6) ) +#define DEBUG_TRACE7(t, s, p1,p2,p3,p4,p5,p6,p7) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7) ) +#define DEBUG_TRACE8(t, s, p1,p2,p3,p4,p5,p6,p7,p8) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8) ) +#define DEBUG_TRACE9(t, s, p1,p2,p3,p4,p5,p6,p7,p8,p9) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8),(p9) ) #else diff --git a/DeviceCode/pal/COM/ComDirector.cpp b/DeviceCode/pal/COM/ComDirector.cpp index c33cb3028..d670095dc 100644 --- a/DeviceCode/pal/COM/ComDirector.cpp +++ b/DeviceCode/pal/COM/ComDirector.cpp @@ -4,8 +4,6 @@ #include -////////////////////////////////////////////////////////////////////////////////// - BOOL DebuggerPort_Initialize( COM_HANDLE ComPortNum ) { NATIVE_PROFILE_PAL_COM(); @@ -13,12 +11,21 @@ BOOL DebuggerPort_Initialize( COM_HANDLE ComPortNum ) { case USART_TRANSPORT: return USART_Initialize( ConvertCOM_ComPort(ComPortNum), HalSystemConfig.USART_DefaultBaudRate, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE ); + case USB_TRANSPORT: - if(USB_CONFIG_ERR_OK != USB_Configure( ConvertCOM_UsbController(ComPortNum), NULL )) return FALSE; - if(!USB_Initialize( ConvertCOM_UsbController(ComPortNum) )) return FALSE; + if(USB_CONFIG_ERR_OK != USB_Configure( ConvertCOM_UsbController(ComPortNum), NULL )) + return FALSE; + + if(!USB_Initialize( ConvertCOM_UsbController(ComPortNum) )) + return FALSE; + return USB_OpenStream( ConvertCOM_UsbStream(ComPortNum), USB_DEBUG_EP_WRITE, USB_DEBUG_EP_READ ); + case SOCKET_TRANSPORT: return SOCKETS_Initialize(ConvertCOM_SockPort(ComPortNum)); + + case GENERIC_TRANSPORT: + return GenericPort_Initialize( ConvertCOM_GenericPort( ComPortNum ) ); } return FALSE; @@ -31,11 +38,16 @@ BOOL DebuggerPort_Uninitialize( COM_HANDLE ComPortNum ) { case USART_TRANSPORT: return USART_Uninitialize( ConvertCOM_ComPort(ComPortNum) ); + case USB_TRANSPORT: USB_CloseStream( ConvertCOM_UsbStream(ComPortNum) ); return USB_Uninitialize( ConvertCOM_UsbController(ComPortNum) ); + case SOCKET_TRANSPORT: return SOCKETS_Uninitialize(ConvertCOM_SockPort(ComPortNum)); + + case GENERIC_TRANSPORT: + return GenericPort_Uninitialize( ConvertCOM_GenericPort( ComPortNum ) ); } return FALSE; @@ -56,15 +68,18 @@ int DebuggerPort_Write( COM_HANDLE ComPortNum, const char* Data, size_t size, in switch(transport) { - case USART_TRANSPORT: - ret = USART_Write( ConvertCOM_ComPort( ComPortNum ), dataTmp, size ); - break; - case USB_TRANSPORT: - ret = USB_Write( ConvertCOM_UsbStream( ComPortNum ), dataTmp, size ); - break; - case SOCKET_TRANSPORT: - ret = SOCKETS_Write( ConvertCOM_SockPort(ComPortNum), dataTmp, size ); - break; + case USART_TRANSPORT: + ret = USART_Write( ConvertCOM_ComPort( ComPortNum ), dataTmp, size ); + break; + case USB_TRANSPORT: + ret = USB_Write( ConvertCOM_UsbStream( ComPortNum ), dataTmp, size ); + break; + case SOCKET_TRANSPORT: + ret = SOCKETS_Write( ConvertCOM_SockPort(ComPortNum), dataTmp, size ); + break; + + case GENERIC_TRANSPORT: + return GenericPort_Write( ConvertCOM_GenericPort( ComPortNum ), dataTmp, size ); } if(ret < 0) @@ -102,15 +117,20 @@ int DebuggerPort_Read( COM_HANDLE ComPortNum, char* Data, size_t size ) switch(ExtractTransport(ComPortNum)) { - case USART_TRANSPORT: - ret = USART_Read( ConvertCOM_ComPort( ComPortNum ), Data, size ); - break; - case USB_TRANSPORT: - ret = USB_Read( ConvertCOM_UsbStream( ComPortNum ), Data, size ); - break; - case SOCKET_TRANSPORT: - ret = SOCKETS_Read( ConvertCOM_SockPort(ComPortNum), Data, size ); - break; + case USART_TRANSPORT: + ret = USART_Read( ConvertCOM_ComPort( ComPortNum ), Data, size ); + break; + + case USB_TRANSPORT: + ret = USB_Read( ConvertCOM_UsbStream( ComPortNum ), Data, size ); + break; + + case SOCKET_TRANSPORT: + ret = SOCKETS_Read( ConvertCOM_SockPort(ComPortNum), Data, size ); + break; + + case GENERIC_TRANSPORT: + return GenericPort_Read( ConvertCOM_GenericPort( ComPortNum ), Data, size ); } return ret; @@ -120,14 +140,19 @@ int DebuggerPort_Read( COM_HANDLE ComPortNum, char* Data, size_t size ) BOOL DebuggerPort_Flush( COM_HANDLE ComPortNum ) { NATIVE_PROFILE_PAL_COM(); - switch(ExtractTransport(ComPortNum)) + switch( ExtractTransport( ComPortNum ) ) { - case USART_TRANSPORT: - return USART_Flush( ConvertCOM_ComPort( ComPortNum ) ); - case USB_TRANSPORT: - return USB_Flush( ConvertCOM_UsbStream(ComPortNum) ); - case SOCKET_TRANSPORT: - return SOCKETS_Flush( ConvertCOM_SockPort(ComPortNum) ); + case USART_TRANSPORT: + return USART_Flush( ConvertCOM_ComPort( ComPortNum ) ); + + case USB_TRANSPORT: + return USB_Flush( ConvertCOM_UsbStream( ComPortNum ) ); + + case SOCKET_TRANSPORT: + return SOCKETS_Flush( ConvertCOM_SockPort( ComPortNum ) ); + + case GENERIC_TRANSPORT: + return GenericPort_Flush( ConvertCOM_GenericPort( ComPortNum ) ); } return FALSE; @@ -138,13 +163,15 @@ BOOL DebuggerPort_IsSslSupported( COM_HANDLE ComPortNum ) NATIVE_PROFILE_PAL_COM(); switch(ExtractTransport(ComPortNum)) { - case SOCKET_TRANSPORT: - return g_DebuggerPortSslConfig.GetCertificateAuthority != NULL; - - case USART_TRANSPORT: - case USB_TRANSPORT: - default: - break; + case SOCKET_TRANSPORT: + return g_DebuggerPortSslConfig.GetCertificateAuthority != NULL; + + case GENERIC_TRANSPORT: + return GenericPort_IsSslSupported( ConvertCOM_GenericPort( ComPortNum ) ); + case USART_TRANSPORT: + case USB_TRANSPORT: + default: + break; } return FALSE; @@ -152,33 +179,34 @@ BOOL DebuggerPort_IsSslSupported( COM_HANDLE ComPortNum ) BOOL DebuggerPort_UpgradeToSsl( COM_HANDLE ComPortNum, UINT32 flags ) { + LPCSTR szTargetHost = NULL; + UINT8* pCACert = NULL; + UINT32 caCertLen = 0; + UINT8* pDeviceCert = NULL; + UINT32 deviceCertLen = 0; + + if(g_DebuggerPortSslConfig.GetCertificateAuthority != NULL) + { + g_DebuggerPortSslConfig.GetCertificateAuthority(&pCACert, &caCertLen); + } + + if(g_DebuggerPortSslConfig.GetTargetHostName != NULL) + { + g_DebuggerPortSslConfig.GetTargetHostName(&szTargetHost); + } + + if(g_DebuggerPortSslConfig.GetDeviceCertificate != NULL) + { + g_DebuggerPortSslConfig.GetDeviceCertificate(&pDeviceCert, &deviceCertLen); + } + switch(ExtractTransport(ComPortNum)) { - case SOCKET_TRANSPORT: - { - LPCSTR szTargetHost = NULL; - UINT8* pCACert = NULL; - UINT32 caCertLen = 0; - UINT8* pDeviceCert = NULL; - UINT32 deviceCertLen = 0; - - if(g_DebuggerPortSslConfig.GetCertificateAuthority != NULL) - { - g_DebuggerPortSslConfig.GetCertificateAuthority(&pCACert, &caCertLen); - } - - if(g_DebuggerPortSslConfig.GetTargetHostName != NULL) - { - g_DebuggerPortSslConfig.GetTargetHostName(&szTargetHost); - } - - if(g_DebuggerPortSslConfig.GetDeviceCertificate != NULL) - { - g_DebuggerPortSslConfig.GetDeviceCertificate(&pDeviceCert, &deviceCertLen); - } - - return SOCKETS_UpgradeToSsl(ConvertCOM_ComPort(ComPortNum), pCACert, caCertLen, pDeviceCert, deviceCertLen, szTargetHost); - } + case SOCKET_TRANSPORT: + return SOCKETS_UpgradeToSsl(ConvertCOM_ComPort(ComPortNum), pCACert, caCertLen, pDeviceCert, deviceCertLen, szTargetHost); + + case GENERIC_TRANSPORT: + return GenericPort_UpgradeToSsl( ComPortNum, pCACert, caCertLen, pDeviceCert, deviceCertLen, szTargetHost ); } return FALSE; @@ -186,60 +214,83 @@ BOOL DebuggerPort_UpgradeToSsl( COM_HANDLE ComPortNum, UINT32 flags ) BOOL DebuggerPort_IsUsingSsl( COM_HANDLE ComPortNum ) { - switch(ExtractTransport(ComPortNum)) - { - case SOCKET_TRANSPORT: - return SOCKETS_IsUsingSsl(ConvertCOM_ComPort(ComPortNum)); - } - return FALSE; -} + switch(ExtractTransport(ComPortNum)) + { + case SOCKET_TRANSPORT: + return SOCKETS_IsUsingSsl(ConvertCOM_ComPort(ComPortNum)); + case GENERIC_TRANSPORT: + return GenericPort_IsUsingSsl( ConvertCOM_GenericPort( ComPortNum ) ); + } + return FALSE; +} ////////////////////////////////////////////////////////////////////////////////// - -void CPU_InitializeCommunication() +void InitializePort( COM_HANDLE ComPortNum ) { - NATIVE_PROFILE_PAL_COM(); - // STDIO can be different from the Debug Text port - // do these first so we can print out messages - - if(COM_IsSerial(HalSystemConfig.DebugTextPort)) + switch(ExtractTransport(ComPortNum)) { - USART_Initialize( ConvertCOM_ComPort(HalSystemConfig.DebugTextPort), HalSystemConfig.USART_DefaultBaudRate, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE ); - } + case USART_TRANSPORT: + USART_Initialize( ConvertCOM_ComPort( ComPortNum ), HalSystemConfig.USART_DefaultBaudRate, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE ); + break; - if(COM_IsSerial(HalSystemConfig.stdio)) - { - USART_Initialize( ConvertCOM_ComPort(HalSystemConfig.stdio), HalSystemConfig.USART_DefaultBaudRate, USART_PARITY_NONE, 8, USART_STOP_BITS_ONE, USART_FLOW_NONE ); + case USB_TRANSPORT: + USB_Initialize( ConvertCOM_UsbStream( ComPortNum ) ); + break; + + case SOCKET_TRANSPORT: + SOCKETS_Initialize( ConvertCOM_SockPort(ComPortNum) ); + break; + + case GENERIC_TRANSPORT: + GenericPort_Initialize( ConvertCOM_GenericPort( ComPortNum ) ); + break; } +} - if(COM_IsUsb(HalSystemConfig.DebugTextPort)) +void UninitializePort( COM_HANDLE ComPortNum ) +{ + switch(ExtractTransport(ComPortNum)) { - if(USB_CONFIG_ERR_OK == USB_Configure( ConvertCOM_UsbController(HalSystemConfig.DebugTextPort), NULL )) + case USART_TRANSPORT: + USART_Uninitialize( ConvertCOM_ComPort( ComPortNum ) ); + break; + + case USB_TRANSPORT: + if(USB_CONFIG_ERR_OK == USB_Configure( ConvertCOM_UsbController(ComPortNum), NULL )) { - USB_Initialize( ConvertCOM_UsbController(HalSystemConfig.DebugTextPort) ); - USB_OpenStream( ConvertCOM_UsbStream(HalSystemConfig.DebugTextPort), USB_DEBUG_EP_WRITE, USB_DEBUG_EP_READ ); + USB_Initialize( ConvertCOM_UsbController(ComPortNum) ); + USB_OpenStream( ConvertCOM_UsbStream(ComPortNum), USB_DEBUG_EP_WRITE, USB_DEBUG_EP_READ ); } - } + break; + case SOCKET_TRANSPORT: + SOCKETS_Uninitialize( ConvertCOM_SockPort(ComPortNum) ); + break; - Network_Initialize(); + case GENERIC_TRANSPORT: + GenericPort_Uninitialize( ConvertCOM_GenericPort( ComPortNum ) ); + break; + } } -void CPU_UninitializeCommunication() +void CPU_InitializeCommunication() { NATIVE_PROFILE_PAL_COM(); // STDIO can be different from the Debug Text port // do these first so we can print out messages + InitializePort( HalSystemConfig.DebugTextPort ); + InitializePort( HalSystemConfig.stdio ); + Network_Initialize(); +} - if(COM_IsSerial(HalSystemConfig.DebugTextPort)) - { - USART_Uninitialize( ConvertCOM_ComPort(HalSystemConfig.DebugTextPort) ); - } - if(COM_IsSerial(HalSystemConfig.stdio)) - { - USART_Uninitialize( ConvertCOM_ComPort(HalSystemConfig.stdio) ); - } +void CPU_UninitializeCommunication() +{ + NATIVE_PROFILE_PAL_COM(); + + // STDIO can be different from the Debug Text port + UninitializePort( HalSystemConfig.DebugTextPort ); + UninitializePort( HalSystemConfig.stdio ); // if USB is not defined, the STUB_USB will be set // Do not uninitialize the USB on soft reboot if USB is our debugger link @@ -266,13 +317,18 @@ void CPU_ProtectCommunicationGPIOs( BOOL On ) switch(ExtractTransport(HalSystemConfig.DebugTextPort)) { - case USART_TRANSPORT: - CPU_USART_ProtectPins( ConvertCOM_ComPort(HalSystemConfig.DebugTextPort), On ); - return ; - case USB_TRANSPORT: - CPU_USB_ProtectPins ( ConvertCOM_UsbController(HalSystemConfig.DebugTextPort), On ); - return; - default: - return; + case USART_TRANSPORT: + CPU_USART_ProtectPins( ConvertCOM_ComPort(HalSystemConfig.DebugTextPort), On ); + return ; + + case USB_TRANSPORT: + CPU_USB_ProtectPins( ConvertCOM_UsbController(HalSystemConfig.DebugTextPort), On ); + return; + + case GENERIC_TRANSPORT: + GenericPort_ProtectPins( ConvertCOM_GenericPort(HalSystemConfig.DebugTextPort), On ); + + default: + return; } } diff --git a/DeviceCode/pal/COM/GenericPort.cpp b/DeviceCode/pal/COM/GenericPort.cpp new file mode 100644 index 000000000..951026932 --- /dev/null +++ b/DeviceCode/pal/COM/GenericPort.cpp @@ -0,0 +1,153 @@ +#include + +// this implementation is intended to fit into +// existing solutions without additional modifications +// The functionality of Generic ports is triggered by +// defining TOTAL_GENERIC_PORTS to a value > 0 in the +// solution's platform_selector.h header file + + +BOOL GenericPort_Initialize( int portNum ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return FALSE; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return FALSE; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.Initialize == NULL ) + return TRUE; + + return entry.Port.Initialize( entry.pInstance ); +#endif +} + +BOOL GenericPort_Uninitialize( int portNum ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return FALSE; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return FALSE; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.Uninitialize == NULL ) + return TRUE; + + return entry.Port.Uninitialize( entry.pInstance ); +#endif +} + +int GenericPort_Write( int portNum, const char* Data, size_t size ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return 0; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return 0; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.Write == NULL ) + return 0; + + return entry.Port.Write( entry.pInstance, Data, size ); +#endif +} + +int GenericPort_Read( int portNum, char* Data, size_t size ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return 0; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return 0; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.Read ) + return 0; + + return entry.Port.Read( entry.pInstance, Data, size ); +#endif +} + +BOOL GenericPort_Flush( int portNum ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return FALSE; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return FALSE; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.Flush == NULL ) + return TRUE; + + return entry.Port.Flush( entry.pInstance ); +#endif +} + +void GenericPort_ProtectPins( int portNum, BOOL On ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.ProtectPins == NULL ) + return; + + entry.Port.ProtectPins( entry.pInstance, On ); +#endif +} + +BOOL GenericPort_IsSslSupported( int portNum ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return FALSE; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return FALSE; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.IsSslSupported ) + return FALSE; + + return entry.Port.IsSslSupported( entry.pInstance ); +#endif +} + +BOOL GenericPort_UpgradeToSsl( int portNum, const UINT8* pCACert, UINT32 caCertLen, const UINT8* pDeviceCert, UINT32 deviceCertLen, LPCSTR szTargetHost ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return FALSE; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return FALSE; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.UpgradeToSsl ) + return FALSE; + + return entry.Port.UpgradeToSsl( entry.pInstance, pCACert, caCertLen, pDeviceCert, deviceCertLen, szTargetHost ); +#endif +} + +BOOL GenericPort_IsUsingSsl( int portNum ) +{ +#if TOTAL_GENERIC_PORTS == 0 + return FALSE; +#else + if( portNum >= TOTAL_GENERIC_PORTS ) + return FALSE; + + GenericPortTableEntry const& entry = *g_GenericPorts[ portNum ]; + if( entry.Port.IsUsingSsl == NULL ) + return FALSE; + + return entry.Port.IsUsingSsl( entry.pInstance ); +#endif +} + diff --git a/DeviceCode/pal/COM/dotNetMF.proj b/DeviceCode/pal/COM/dotNetMF.proj index a5681eba7..e7b42dcd9 100644 --- a/DeviceCode/pal/COM/dotNetMF.proj +++ b/DeviceCode/pal/COM/dotNetMF.proj @@ -51,6 +51,7 @@ + diff --git a/DeviceCode/pal/graphics/graphics.cpp b/DeviceCode/pal/graphics/graphics.cpp index 251bb2d50..734dac21c 100644 --- a/DeviceCode/pal/graphics/graphics.cpp +++ b/DeviceCode/pal/graphics/graphics.cpp @@ -1144,7 +1144,7 @@ UINT32* Graphics_Driver::ComputePosition( const PAL_GFX_Bitmap& bitmap, int x, i { NATIVE_PROFILE_PAL_GRAPHICS(); -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) shift = (x % 2) * 16; mask = 0x0000FFFF << shift; #else diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c index 352b55241..ac831fa65 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/def.c @@ -52,7 +52,7 @@ * Note ntohs() and ntohl() are merely references to the htonx counterparts. */ -#if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) +#if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) /** * Convert an u16_t from host- to network byte order. @@ -105,4 +105,4 @@ lwip_ntohl(u32_t n) return lwip_htonl(n); } -#endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) */ +#endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) */ diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c index 1d5658207..96587edc0 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/core/snmp/asn1_dec.c @@ -334,10 +334,10 @@ snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value) { u16_t plen, base; u8_t *msg_ptr; -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN u8_t *lsb_ptr = (u8_t*)value; #endif -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN u8_t *lsb_ptr = (u8_t*)value + sizeof(s32_t) - 1; #endif u8_t sign; diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h index 79a2d90f2..3e2c1b368 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/inet_chksum.h @@ -39,13 +39,13 @@ /** Swap the bytes in an u16_t: much like htons() for little-endian */ #ifndef SWAP_BYTES_IN_WORD -#if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) +#if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) /* little endian and PLATFORM_BYTESWAP defined */ #define SWAP_BYTES_IN_WORD(w) LWIP_PLATFORM_HTONS(w) -#else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) */ +#else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN) */ /* can't use htons on big endian (or PLATFORM_BYTESWAP not defined)... */ #define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) -#endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN)*/ +#endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN)*/ #endif /* SWAP_BYTES_IN_WORD */ /** Split an u32_t in two u16_ts and add them up */ diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h index 77f84e02c..2193ba3fa 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv4/lwip/ip_addr.h @@ -134,7 +134,7 @@ extern const ip_addr_t ip_addr_broadcast; #define IP_LOOPBACKNET 127 /* official! */ -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN /** Set an IP address given by the four byte-parts */ #define IP4_ADDR(ipaddr, a,b,c,d) \ (ipaddr)->addr = ((u32_t)((a) & 0xff) << 24) | \ diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h index a01cfc65b..5f588cd90 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/ipv6/lwip/ip.h @@ -82,7 +82,7 @@ extern "C" { /* The IPv6 header. */ struct ip_hdr { -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN u8_t tclass1:4, v:4; u8_t flow1:4, tclass2:4; #else diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h index 4d6df773f..8f074fae0 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/arch.h @@ -32,12 +32,12 @@ #ifndef __LWIP_ARCH_H__ #define __LWIP_ARCH_H__ -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 +#ifndef NETMF_TARGET_LITTLE_ENDIAN +#define NETMF_TARGET_LITTLE_ENDIAN 1234 #endif -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 +#ifndef NETMF_TARGET_BIG_ENDIAN +#define NETMF_TARGET_BIG_ENDIAN 4321 #endif #include "arch/cc.h" diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h index 73a1b560b..2c2fba92f 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/include/lwip/def.h @@ -48,7 +48,7 @@ extern "C" { #endif /* Endianess-optimized shifting of two u8_t to create one u16_t */ -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN #define LWIP_MAKE_U16(a, b) ((a << 8) | b) #else #define LWIP_MAKE_U16(a, b) ((b << 8) | a) @@ -80,7 +80,7 @@ extern "C" { #define ntohl(x) lwip_ntohl(x) #endif /* LWIP_PREFIX_BYTEORDER_FUNCS */ -#if BYTE_ORDER == BIG_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN #define lwip_htons(x) (x) #define lwip_ntohs(x) (x) #define lwip_htonl(x) (x) @@ -89,7 +89,7 @@ extern "C" { #define PP_NTOHS(x) (x) #define PP_HTONL(x) (x) #define PP_NTOHL(x) (x) -#else /* BYTE_ORDER != BIG_ENDIAN */ +#else /* BYTE_ORDER != NETMF_TARGET_BIG_ENDIAN */ #if LWIP_PLATFORM_BYTESWAP #define lwip_htons(x) LWIP_PLATFORM_HTONS(x) #define lwip_ntohs(x) LWIP_PLATFORM_HTONS(x) @@ -113,7 +113,7 @@ u32_t lwip_ntohl(u32_t x); (((x) & 0xff000000UL) >> 24)) #define PP_NTOHL(x) PP_HTONL(x) -#endif /* BYTE_ORDER == BIG_ENDIAN */ +#endif /* BYTE_ORDER == NETMF_TARGET_BIG_ENDIAN */ #ifdef __cplusplus } diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c index 8e8fae9f9..325ee46e4 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/ppp.c @@ -1703,9 +1703,9 @@ pppInput(void *arg) LWIP_ASSERT("pbuf_header failed\n", 0); goto drop; } -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN protocol = htons(protocol); -#endif /* BYTE_ORDER == LITTLE_ENDIAN */ +#endif /* BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN */ SMEMCPY(nb->payload, &protocol, sizeof(protocol)); lcp_sprotrej(pd, nb->payload, nb->len); } diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c index 40fdad13d..dcf7ea318 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/netif/ppp/vj.c @@ -568,7 +568,7 @@ vj_uncompress_tcp(struct pbuf **nb, struct vjcompress *comp) goto bad; } -#if BYTE_ORDER == LITTLE_ENDIAN +#if BYTE_ORDER == NETMF_TARGET_LITTLE_ENDIAN tmp = n0->tot_len - vjlen + cs->cs_hlen; IPH_LEN_SET(&cs->cs_ip, htons((u_short)tmp)); #else diff --git a/DeviceCode/pal/tinycrt/tinycrt.cpp b/DeviceCode/pal/tinycrt/tinycrt.cpp index 3010a28de..6918c3eef 100644 --- a/DeviceCode/pal/tinycrt/tinycrt.cpp +++ b/DeviceCode/pal/tinycrt/tinycrt.cpp @@ -116,10 +116,7 @@ int hal_vfprintf( COM_HANDLE stream, const char* format, va_list arg ) switch(ExtractTransport(stream)) { - - case USART_TRANSPORT: - case USB_TRANSPORT: - case SOCKET_TRANSPORT: + default: DebuggerPort_Write( stream, buffer, chars, 0 ); // skip null terminator break; diff --git a/Solutions/MCBSTM32F400/DeviceCode/Init/IO_Init.cpp b/Solutions/MCBSTM32F400/DeviceCode/Init/IO_Init.cpp index 5ae7cb1c8..c94350cae 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Init/IO_Init.cpp +++ b/Solutions/MCBSTM32F400/DeviceCode/Init/IO_Init.cpp @@ -16,6 +16,11 @@ #include #include "..\..\..\..\DeviceCode\Targets\Native\STM32F4\DeviceCode\stm32f4xx.h" +// define the generic port table, only one generic extensionn port type supported +// and that is the ITM hardware trace port on Channel 0. +extern GenericPortTableEntry const Itm0GenericPort; +extern GenericPortTableEntry const* const g_GenericPorts[ TOTAL_GENERIC_PORTS ] = { &Itm0GenericPort }; + extern void STM32F4_GPIO_Pin_Config( GPIO_PIN pin, UINT32 mode, GPIO_RESISTOR resistor, UINT32 alternate ); // Workaround, since CPU_GPIO_DisablePin() does not correctly initialize pin speeds void __section("SectionForBootstrapOperations") InitNorFlash() diff --git a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj index 0ea268cb2..b4cee4b87 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj @@ -56,7 +56,6 @@ - \ No newline at end of file diff --git a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj index 1d280a811..640833f3e 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj @@ -58,7 +58,6 @@ - diff --git a/Solutions/MCBSTM32F400/MCBSTM32F400.settings b/Solutions/MCBSTM32F400/MCBSTM32F400.settings index 6a0a47cba..47b662524 100644 --- a/Solutions/MCBSTM32F400/MCBSTM32F400.settings +++ b/Solutions/MCBSTM32F400/MCBSTM32F400.settings @@ -21,6 +21,7 @@ + diff --git a/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj b/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj index 6aa2c514c..d82f02d74 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj +++ b/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj @@ -30,6 +30,10 @@ + + + + diff --git a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj index 235dc5aeb..0284688c2 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj +++ b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj @@ -73,6 +73,10 @@ + + + + @@ -426,7 +430,7 @@ - + diff --git a/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj b/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj index f61a31a45..b8c486f3d 100644 --- a/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj +++ b/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj @@ -63,6 +63,10 @@ + + + + diff --git a/Solutions/MCBSTM32F400/platform_selector.h b/Solutions/MCBSTM32F400/platform_selector.h index e382275da..aa4f4f418 100644 --- a/Solutions/MCBSTM32F400/platform_selector.h +++ b/Solutions/MCBSTM32F400/platform_selector.h @@ -80,11 +80,14 @@ #define TOTAL_GPIO_PINS TOTAL_GPIO_PORT * 16 #define INSTRUMENTATION_H_GPIO_PIN GPIO_PIN_NONE -#define TOTAL_USART_PORT 7 // ITM0 + 6 physical UARTS +#define TOTAL_USART_PORT 6 // 6 physical UARTS #define USART_DEFAULT_PORT COM1 #define USART_DEFAULT_BAUDRATE 115200 +#define TOTAL_GENERIC_PORTS 1 // 1 generic port extensions (ITM channel 0 ) +#define ITM_GENERIC_PORTNUM 0 // ITM0 is index 0 in generic port interface table + #define DEBUG_TEXT_PORT ITM0 #define STDIO USB1 #define DEBUGGER_PORT USB1 diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj index 7398f7888..c59165a4e 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj @@ -56,7 +56,6 @@ - \ No newline at end of file diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj index a8de49611..c3e2b5af5 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj @@ -58,7 +58,6 @@ - diff --git a/Solutions/Windows2/TinyCLR/Various.cpp b/Solutions/Windows2/TinyCLR/Various.cpp index 81c21f8b1..ef96bfd5e 100644 --- a/Solutions/Windows2/TinyCLR/Various.cpp +++ b/Solutions/Windows2/TinyCLR/Various.cpp @@ -503,16 +503,14 @@ int hal_vfprintf( COM_HANDLE stream, const char* format, va_list arg ) switch(ExtractTransport(stream)) { - case USART_TRANSPORT: - case USB_TRANSPORT: - case SOCKET_TRANSPORT: + default: DebuggerPort_Write( stream, buffer, chars, 0 ); // skip null terminator break; case LCD_TRANSPORT: break; - default: + case FLASH_WRITE_TRANSPORT: _ASSERTE(FALSE); } diff --git a/Support/Include/WireProtocol.h b/Support/Include/WireProtocol.h index 159370e4d..575aed346 100644 --- a/Support/Include/WireProtocol.h +++ b/Support/Include/WireProtocol.h @@ -127,7 +127,7 @@ struct WP_Message void PrepareReply ( const WP_Packet& req, UINT32 flags, UINT32 payloadSize, UINT8* payload ); void SetPayload ( UINT8* payload ); void Release ( ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) void SwapEndian ( ); #endif diff --git a/Support/WireProtocol/WireProtocol.cpp b/Support/WireProtocol/WireProtocol.cpp index eb0442d1a..58b9ed3f7 100644 --- a/Support/WireProtocol/WireProtocol.cpp +++ b/Support/WireProtocol/WireProtocol.cpp @@ -51,11 +51,11 @@ void WP_Message::PrepareRequest( UINT32 cmd, UINT32 flags, UINT32 payloadSize, U // The CRC for the header is computed setting the CRC field to zero and then running the CRC algorithm. // m_header.m_crcHeader = 0; -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif m_header.m_crcHeader = SUPPORT_ComputeCRC( (UINT8*)&m_header, sizeof(m_header), 0 ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) m_header.m_crcHeader = ::SwapEndian( m_header.m_crcHeader ); #endif @@ -78,11 +78,11 @@ void WP_Message::PrepareReply( const WP_Packet& req, UINT32 flags, UINT32 payloa // The CRC for the header is computed setting the CRC field to zero and then running the CRC algorithm. // m_header.m_crcHeader = 0; -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif m_header.m_crcHeader = SUPPORT_ComputeCRC( (UINT8*)&m_header, sizeof(m_header), 0 ); -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) m_header.m_crcHeader = ::SwapEndian( m_header.m_crcHeader ); #endif } @@ -107,7 +107,7 @@ bool WP_Message::VerifyHeader() { bool fRes; -#if !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_BIG_ENDIAN) UINT32 crc = m_header.m_crcHeader; #else UINT32 crc = ::SwapEndian( m_header.m_crcHeader ); @@ -212,7 +212,7 @@ bool WP_Message::Process() bool fBadPacket=true; if( VerifyHeader() ) { -#if defined(BIG_ENDIAN) +#if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif if ( m_parent->m_app->ProcessHeader( m_parent->m_state, this ) ) @@ -305,7 +305,7 @@ bool WP_Message::Process() } } -#if defined (BIG_ENDIAN) +#if defined (NETMF_TARGET_BIG_ENDIAN) void WP_Message::SwapEndian() { m_header.m_crcHeader = ::SwapEndian( m_header.m_crcHeader ); diff --git a/tools/DisAsmPE/Include/UnalignedAccess.h b/tools/DisAsmPE/Include/UnalignedAccess.h new file mode 100644 index 000000000..0a663bf66 --- /dev/null +++ b/tools/DisAsmPE/Include/UnalignedAccess.h @@ -0,0 +1,124 @@ +#ifndef _UNALIGNED_ACCESS_H_ +#define _UNALIGNED_ACCESS_H_ +//////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) Microsoft, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files +// except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the +// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +// either express or implied. See the License for the specific language governing permissions +// and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace Microsoft +{ + namespace Utilities + { + inline uint16_t ReadUnalignedUInt16( uint8_t const*& ip) + { + uint16_t retVal; + #if !defined(NETMF_TARGET_BIG_ENDIAN) + retVal = (uint16_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + retVal |= (uint16_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + #else + retVal = (uint16_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint16_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + #endif + return retVal; + } + + inline uint32_t ReadUnalignedUInt32( uint8_t const*& ip) + { + uint32_t retVal; + #if !defined(NETMF_TARGET_BIG_ENDIAN) + retVal = (uint32_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + #else + retVal = (uint32_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint32_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + #endif //NETMF_TARGET_BIG_ENDIAN + return retVal; + } + + inline uint64_t ReadUnalignedUInt64( uint8_t const*& ip) + { + uint64_t retVal; + #if !defined(NETMF_TARGET_BIG_ENDIAN) + retVal = (uint64_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 32; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 40; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 48; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 56; + ip += sizeof(uint8_t); + #else + retVal = (uint64_t)(*(const uint8_t *)ip) << 56; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 48; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 40; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 32; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 24; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 16; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip) << 8; + ip += sizeof(uint8_t); + retVal |= (uint64_t)(*(const uint8_t *)ip); + ip += sizeof(uint8_t); + #endif //NETMF_TARGET_BIG_ENDIAN + return retVal; + } + + inline int16_t ReadUnalignedInt16( uint8_t const*& ip) + { + return static_cast< int16_t >( ReadUnalignedUInt16( ip ) ); + } + + inline int32_t ReadUnalignedInt32( uint8_t const*& ip) + { + return static_cast< int32_t >( ReadUnalignedUInt32( ip ) ); + } + + inline int64_t ReadUnalignedInt64( uint8_t const*& ip) + { + return static_cast< int64_t >( ReadUnalignedUInt64( ip ) ); + } + } +} +#endif \ No newline at end of file diff --git a/tools/Targets/Microsoft.Spot.system.gcc.targets b/tools/Targets/Microsoft.Spot.system.gcc.targets index 270c6375d..5d649c804 100644 --- a/tools/Targets/Microsoft.Spot.system.gcc.targets +++ b/tools/Targets/Microsoft.Spot.system.gcc.targets @@ -144,8 +144,8 @@ $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_$(TARGETPROCESSOR) -DPLATFORM_ARM_$(TARGETPLATFORM) -DTARGETLOCATION_$(TARGETLOCATION) - $(CC_CPP_COMMON_FLAGS) -DLITTLE_ENDIAN - $(CC_CPP_COMMON_FLAGS) -DBIG_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_LITTLE_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_BIG_ENDIAN $(CC_CPP_COMMON_FLAGS) -DPATCH_BUILD $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_OS_PORT diff --git a/tools/Targets/Microsoft.Spot.system.mdk.targets b/tools/Targets/Microsoft.Spot.system.mdk.targets index a1f896d97..2292907a9 100644 --- a/tools/Targets/Microsoft.Spot.system.mdk.targets +++ b/tools/Targets/Microsoft.Spot.system.mdk.targets @@ -188,8 +188,8 @@ $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_$(TARGETPLATFORM) $(CC_CPP_COMMON_FLAGS) -DTARGETLOCATION_$(TARGETLOCATION) - $(CC_CPP_COMMON_FLAGS) -DLITTLE_ENDIAN - $(CC_CPP_COMMON_FLAGS) -DBIG_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_LITTLE_ENDIAN + $(CC_CPP_COMMON_FLAGS) -DNETMF_TARGET_BIG_ENDIAN $(CC_CPP_COMMON_FLAGS) -DPATCH_BUILD $(CC_CPP_COMMON_FLAGS) -DPLATFORM_ARM_OS_PORT From 8a75b2a218daaea3716632b3ad92cec395289769 Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Wed, 3 Aug 2016 15:18:28 +0100 Subject: [PATCH 3/6] # This is a combination of 42 commits. # The first commit's message is: Replace BIG_ENDIAN with NETMF_TARGET_BIG_ENDIAN and LITTLE_ENDIAN with NETMF_TARGET_LITTLE_ENDIAN Fixes #481 # This is the 2nd commit message: Removed not broken-out GPIO ports (used only A - E) PH0 and PH1 deliberately omitted to keep the range continuous. # This is the 3rd commit message: restored LWIP cc.h to use debug_printf as that is already set to extern "C" linkage. Changing hal_printf and everything that uses it to ensure it is always extern "C" as well was more work than seems worth it in this case. # This is the 4th commit message: Change DateTime.UtcNow.Kind from Local to Utc. # This is the 5th commit message: STM32F4DISCOVERY: TinyBooter uses ITM0 USART driver and PAL replaced with stubs. # This is the 6th commit message: Replaced 'tinyclr' with $(AssemblyName) in STM32F4DISCOVERY TinyCLR.proj Synced with MCBSTM32F400, commit 78f5cb3c996cc7234937b6a2c84c9f156b342e07. # This is the 7th commit message: - fixed assemblyinfo for Microsoft.VisualBasic.dll # This is the 8th commit message: -removed VS express SKU support as it causes issues with publishing to VS gallery and we don't need it anymore now that the VS community edition is freely available. - fixed VS14 integration solution and projects to allow build and debug with VS experimental Hive - added missing buildTasks project to depenencies for VS integration solution - added missing WinUsb project reference for VS integration Resolved circular dependency on build task projects - removed project references to build task projects as they are needed to build other projects - Create standalone solution to build the build task projects needed by other projects to allow building them independently of everything else. (NOTE: that msbuild.exe will normally leave an instance of itself running with all previously loaded tasks still loaded. Thus to build the build tasks it may be required to kill the pending msbuild.exe instance(s) to release the DLLs [It will timeout on it's own after a few minutes as well]) - Added standard project configuration settings to project files - works ok in VS but busted on command line builds (the non standard nature of the current projects makes a mess of this - they need to be brought into standard project form) restored direct tags for assemblies since the command line build from Build_sdk won't process ProjectReferences properly (Fixing that is a complete re-write of the build) - Added some dependency logging to the Common targets file to log child projects to help in tracking dependency issues. - updated VSIX manifest to official RTM name of Visual Studio 2015 - Fixed solution configuration settings so it doesn't mix debug and release settings on a single solution configuration. - Fixed WinUsb and Debugger CSPROJ files to set OutDir to the proper build output location # This is the 9th commit message: Fixed ConvertCOM_ComHandle() parameters (start from zero) # This is the 10th commit message: Revert "Fix DateTime Ticks to match the behavior of .NET" This reverts commit 79a595a8d6e56a929e52c8a55ebd48bda898f9e2. # This is the 11th commit message: - updated cmsis_os_cpp.h to latest RTX data structure layout - updated C++ support macros for timeres and mutex to maintain consistency between them for use. (e.g. 3 seperate macros, one to declare a member of a class, one for the constructor initializaion list and a third to be used in the constructor to perform final init/construction. This pattern ensures that the correct action is taken and allows for greater version implementation detal isolation. It is possible that the internals of the macro can change or even be empty in some cases and then in a new version change. - forced all RAM regions propr to the LWIP init region to uncompressed, this is to work around the linker bug in the ARMCC tool chain. WHile that bug was fixed in the latest toolchain, not everyone has upgraded. In the next release of NETMF we'll reset the min requiremeents to include the fix - until then we'll keep the workaround. # This is the 12th commit message: Fix UTF8 to UTF16 conversion for special characters # This is the 13th commit message: - adding in support for legacy crypto, which was removed previously. Turns out it is still needed by TinyBooter/mfdeploy for firmware signature checks as a small footprint crypto lib. - added default keys for signing. Users should create their own keys for security but providing a key prevents errors from hitting the build until they get to understanding that phase of things. # This is the 14th commit message: Update README.md # This is the 15th commit message: Revert "Restored Legacy Crypto support" # This is the 16th commit message: - Added code to tinybooter to dump out newkey, signature and current key on failure to verify signature on key updates to aid in diagnosing issues with Crypto library. - fixed multiple issues of return or throw on smae line as conditional expression which make debugging difficult. (Some debuggers can't set breakpoints on line and column) - for the crypto.lib project forced mapping MDK to the RVDS3.1 thumb2 crypto libraries. - added more readable wire-protocal packet tracing, now prints the command id as a textual name along with a decoded form of the flags with textual names for all active flags to aid in debugging the communications. - fixed DLLImports for the Crypto.dll to use CDecl calling convention to prevent issues with stack corruption and eliminate MDA exception while debugging. - Fixed flash driver for MCBSTM32F400 to check for ready status after erase to ensure chip is in a valid state before continuing. Othereise the chip can get corrupted (particularly the Config sector) - Added Addditional debug and ETW tracing for the NETMF wireprotocol in MFDeploy and VS integration. - Added additional trace messaging support toe device side wire protocol to help in tracking any failures that might occur on a device. - Fixed tracing to eprovide event code on WireProtocolTxHeader. # This is the 17th commit message: Revert "Adding support to provide more useful and actionalble diagnostics for Crypto libs and wire protocol debugging" # This is the 18th commit message: Updated string table inputs in Microsoft.SPOT.Support.Settings # This is the 19th commit message: StringTable data moved into separate file StringTableData.cpp (to avoid manual edits) Now the data file can be replaced directly with the generated one. # This is the 20th commit message: Excluded generated strings from StringTable $$method0x... {...guid} __StaticArrayInitTypeSize=... # This is the 21st commit message: Updated string table data - generated from Microsoft.SPOT.Native.strings and mscorlib.strings # This is the 22nd commit message: Deleted unused InitString() functions TINYCLR_CREATE_STRINGTABLE symbol is not used anymore, never defined. # This is the 23rd commit message: Added string table inputs information to StringTableData.cpp Inline task PrependLinesToFile created to workaround ReadLinesFromFile limitations. # This is the 24th commit message: Deleted unused compile_stringtable.cmd script The StringTable is now generated via 'buildstring' target in Tools\Targets\Microsoft.SPOT.Support.Settings # This is the 25th commit message: Update the Interface tests to reflect the known issue related to #95 # This is the 26th commit message: Fix TimerServiceTests # This is the 27th commit message: Fix http test for checking microsoft server # This is the 28th commit message: Eliminated VS14 build_sdk compiler warning C4474: 'wprintf' : too many arguments passed for format string # This is the 29th commit message: Eliminated VS14 build_sdk compiler warning C4477: 'wprintf' : format string '%f' requires an argument of type 'double', but variadic argument 1 has type 'CLR_INT32' # This is the 30th commit message: Eliminated VS14 build_sdk compiler warning C4477: 'wprintf' : format string '%g' requires an argument of type 'double', but variadic argument 1 has type 'CLR_INT64' # This is the 31st commit message: Set error on LINGER and DONTLINGER socket options # This is the 32nd commit message: GroupTests encoding is ASCII. Changed to Unicode for TM special character # This is the 33rd commit message: STM32F4x9_Flash_driver.cpp also needs FLASH definition # This is the 34th commit message: Revert "STM32F4x9_Flash_driver.cpp also needs FLASH definition" # This is the 35th commit message: Fix the condition for setting static DNS # This is the 36th commit message: Fix NetInfo Tests # This is the 37th commit message: Fix http tests issues # This is the 38th commit message: - Added git ignore for the binary only crypto libraries so they don't get added into the tree - Updated codesign certificate ids to current Microsoft SHA2 variants. # This is the 39th commit message: - adding in support for legacy crypto, which was removed previously. Turns out it is still needed by TinyBooter/mfdeploy for firmware signature checks as a small footprint crypto lib. - added default keys for signing. Users should create their own keys for security but providing a key prevents errors from hitting the build until they get to understanding that phase of things. # This is the 40th commit message: - Added code to tinybooter to dump out newkey, signature and current key on failure to verify signature on key updates to aid in diagnosing issues with Crypto library. - fixed multiple issues of return or throw on smae line as conditional expression which make debugging difficult. (Some debuggers can't set breakpoints on line and column) - for the crypto.lib project forced mapping MDK to the RVDS3.1 thumb2 crypto libraries. - added more readable wire-protocal packet tracing, now prints the command id as a textual name along with a decoded form of the flags with textual names for all active flags to aid in debugging the communications. - fixed DLLImports for the Crypto.dll to use CDecl calling convention to prevent issues with stack corruption and eliminate MDA exception while debugging. - Fixed flash driver for MCBSTM32F400 to check for ready status after erase to ensure chip is in a valid state before continuing. Othereise the chip can get corrupted (particularly the Config sector) - Added Addditional debug and ETW tracing for the NETMF wireprotocol in MFDeploy and VS integration. - Added additional trace messaging support toe device side wire protocol to help in tracking any failures that might occur on a device. - Fixed tracing to eprovide event code on WireProtocolTxHeader. Conflicts: crypto/dotNetMF.proj # This is the 41st commit message: Enabling time service for MCBStM32F400 # This is the 42nd commit message: - Enabled debug symbol information for release and RTM builds with MDK toolchain (It doesn't impact optimizations but allows for actual source debugging of release builds via JTAG debugger) --- .gitignore | 3 + Application/TinyBooter/Commands.cpp | 23 +- .../TinyBooter/ConfigurationManager.cpp | 12 +- Application/TinyBooter/CryptoInterface.cpp | 24 +- CLR/Core/CLR_RT_UnicodeHelper.cpp | 3 + CLR/Core/Execution.cpp | 2 +- CLR/Core/ParseOptions_Win32.cpp | 2 +- CLR/Core/StringTable.cpp | 2228 +---------------- CLR/Core/StringTableData.cpp | 1736 +++++++++++++ .../CorLib/corlib_native_System_DateTime.cpp | 2 +- CLR/Tools/Parser/ByteCodeParser.cpp | 4 +- CLR/Tools/Parser/Linker.cpp | 8 +- .../STM32F4_ETH_driver.cpp | 30 +- .../STM32F4_ETH_lwip_OS/STM32F4_ETH_lwip.cpp | 18 +- .../STM32F4_ETH_lwip_OS/STM32F4_ETH_phy.cpp | 8 +- .../STM32F4_ETH_rx_desc.cpp | 4 +- .../STM32F4_ETH_tx_desc.cpp | 6 +- .../Native/STM32F4/processor_selector.h | 12 +- DeviceCode/Targets/OS/CMSIS_RTOS/CpuOsIrq.h | 8 +- .../DeviceCode/lwip_1_4_1_os/arch/mutex | 4 +- .../lwip_1_4_1_os/arch/sysarch_timeout.h | 10 +- .../Targets/OS/CMSIS_RTOS/cmsis_os_cpp.h | 29 +- DeviceCode/include/tinyhal.h | 29 +- .../SocketsDriver/lwIP__Sockets.cpp | 57 +- Framework/CorDebug/VsPackage.cs | 1 - Framework/CorDebug/vs12/cordebugvs12.csproj | 6 + .../vs12/source.extension.vsixmanifest | 1 - Framework/CorDebug/vs14/cordebugvs14.csproj | 6 + Framework/CorDebug/vs14/cordebugvs14.sln | 97 +- .../vs14/source.extension.vsixmanifest | 5 +- Framework/Debugger/Debugger.csproj | 17 +- Framework/Debugger/DebuggerEventSource.cs | 202 +- Framework/Debugger/WinUsb/WinUsb.csproj | 32 +- Framework/Debugger/WireProtocol/Engine.cs | 1 + .../WireProtocol/MessageReassembler.cs | 2 +- .../Debugger/WireProtocol/OutgoingMessage.cs | 9 +- Framework/Subset_of_CorLib/System/DateTime.cs | 53 +- .../Subset_of_VisualBasic/AssemblyInfo.vb | 8 +- Framework/Tools/BuildTasks.sln | 46 + Framework/Tools/BuildTasks/BuildTasks.csproj | 185 +- .../BuildSigner/BuildSignerSpotBuild.csproj | 26 +- .../InternalBuildTasks.csproj | 224 +- .../Tools/MFDeploy/Library/MFConfigHelper.cs | 3 +- .../Tools/MFDeploy/Library/MFCryptoWrapper.cs | 17 +- Framework/Tools/WiXLib/WixLibSpotBuild.csproj | 30 +- Framework/Tools/buildTasks.dirproj | 4 +- .../AssemblyInfoTemplateProject.csproj | 15 +- .../CSharp/Class/ClassTemplateProject.csproj | 10 +- .../Class/VBClassTemplateProject.csproj | 10 +- .../EmulatorTemplateProject.csproj | 18 +- .../ExeTemplate/ExeTemplateProject.csproj | 6 +- .../LibTemplate/LibTemplateProject.csproj | 6 +- .../WinTemplate/WinTemplateProject.csproj | 4 +- .../ExeTemplate/VBExeTemplateProject.csproj | 9 +- .../LibTemplate/VBLibTemplateProject.csproj | 8 +- .../WinTemplate/VBWinTemplateProject.csproj | 8 +- README.md | 12 +- .../M29W640FB/M29W640FB_BlConfig.cpp | 6 +- .../M29W640FB_Flash_driver.cpp | 3 +- Solutions/MCBSTM32F400/MCBSTM32F400.settings | 2 +- .../TinyBooter/scatterfile_bootloader_gcc.xml | 2 +- .../TinyBooter/scatterfile_bootloader_mdk.xml | 2 +- Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj | 32 +- .../TinyCLR/scatterfile_tinyclr_gcc.xml | 2 +- .../TinyCLR/scatterfile_tinyclr_mdk.xml | 4 +- .../MCBSTM32F400/netmfdbg/netmfdbg.uvoptx | 515 +++- .../MCBSTM32F400/netmfdbg/netmfdbg.uvprojx | 416 +++ .../DeviceCode/Init/IO_Init.cpp | 53 +- .../TinyBooter/TinyBooter.proj | 12 +- .../STM32F4DISCOVERY/TinyCLR/TinyCLR.proj | 20 +- .../STM32F4DISCOVERY/platform_selector.h | 15 +- Support/WireProtocol/WireProtocol.cpp | 60 +- .../netInfoTests/NetworkInterfaceTests.cs | 174 +- .../TimeServiceTests/ServiceTests.cs | 49 +- .../Tests/CLR/System/Http/FunctionalTests.cs | 5 +- .../System/Http/HttpKnownHeaderNamesTests.cs | 17 +- .../CLR/System/Http/HttpRequestHeaderTests.cs | 10 +- .../Tests/CLR/System/Http/HttpServer.cs | 2 + .../CLR/System/Http/HttpStatusCodeTests.cs | 94 +- .../Tests/CLR/System/Http/HttpTests.csproj | 6 +- .../Tests/CLR/System/Http/HttpVersionTests.cs | 16 +- .../CLR/System/Http/HttpWebRequestTests.cs | 40 +- .../Tests/CLR/System/Http/TestServer.cs | 2 + .../Tests/CLR/System/Http/Utilities.cs | 28 + .../CLR/System/Http/WebExceptionTests.cs | 33 +- .../System/Http/WebHeaderCollectionTests.cs | 10 +- .../Tests/CLR/System/Http/WebResponseTests.cs | 3 +- .../CLR/System/Text/Regexp/GroupTests.cs | 36 +- .../CLR/mscorlib/interfaces/InterfaceTests.cs | 6 +- .../systemlib2/SystemDateTimeTests.cs | 29 +- crypto/dotNetMF.proj | 31 +- crypto/inc/crypto.h | 10 +- setup/Features/Tools.wxs | 1 + setup/UnManagedAssemblies/build.dirproj | 1 + .../Microsoft.SPOT.Build.Common.Targets | 3 + tools/Targets/Microsoft.SPOT.SDK.Targets | 12 +- tools/Targets/Microsoft.SPOT.Support.Settings | 49 +- .../Targets/Microsoft.Spot.system.mdk.targets | 12 +- tools/bin/BLANK.KEY | 5 + ...inybooter_metadataprocessor_key_readme.txt | 16 + tools/bin/tinybooter_private_key.bin | Bin 0 -> 260 bytes tools/bin/tinybooter_private_key_1.txt | Bin 0 -> 260 bytes tools/bin/tinybooter_public_key.bin | Bin 0 -> 260 bytes tools/bin/tinybooter_public_key_1.txt | Bin 0 -> 260 bytes tools/scripts/compile_stringtable.cmd | 12 - 105 files changed, 4038 insertions(+), 3161 deletions(-) create mode 100644 CLR/Core/StringTableData.cpp create mode 100644 Framework/Tools/BuildTasks.sln create mode 100644 Test/Platform/Tests/CLR/System/Http/Utilities.cs create mode 100644 tools/bin/BLANK.KEY create mode 100644 tools/bin/tinybooter_metadataprocessor_key_readme.txt create mode 100644 tools/bin/tinybooter_private_key.bin create mode 100644 tools/bin/tinybooter_private_key_1.txt create mode 100644 tools/bin/tinybooter_public_key.bin create mode 100644 tools/bin/tinybooter_public_key_1.txt delete mode 100644 tools/scripts/compile_stringtable.cmd diff --git a/.gitignore b/.gitignore index 40803f7db..a3b2312da 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,8 @@ [Oo]bj/ ipch/ +!/tools/bin/ + #uVision *.uvguix* Listings/ @@ -39,3 +41,4 @@ Listings/ /DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/Dependencies/WpdPack/ *.axfdump +/crypto/lib diff --git a/Application/TinyBooter/Commands.cpp b/Application/TinyBooter/Commands.cpp index 4108059e1..e130c73c2 100644 --- a/Application/TinyBooter/Commands.cpp +++ b/Application/TinyBooter/Commands.cpp @@ -1452,6 +1452,17 @@ bool Loader_Engine::Monitor_CheckSignature( WP_Message* msg ) return true; } +#ifdef DEBUG +// dumps binary block in a form useable as C code constants for isolated testing and verification +void DumpBlockDeclaration( char const* name, UINT8 const* pBlock, size_t len ) +{ + debug_printf( "const char %s[] = {", name ); + for( int i = 0; i < len; ++i ) + debug_printf( "%c%d", i == 0 ? ' ' : ',', pBlock[ i ] ); + debug_printf( "};\n" ); +} +#endif + bool Loader_Engine::Monitor_SignatureKeyUpdate( WP_Message* msg ) { bool fSuccess = false; @@ -1486,13 +1497,23 @@ bool Loader_Engine::Monitor_SignatureKeyUpdate( WP_Message* msg ) ASSERT(0); fSuccess = true; } + else + { +#ifdef DEBUG + debug_printf( "Failed cert check for new key:\n"); + DumpBlockDeclaration( "newKey", cmd->m_newKey, sizeof(RSAKey) ); + DumpBlockDeclaration( "newKeySig", cmd->m_newKeySignature, sizeof( cmd->m_newKeySignature ) ); + DumpBlockDeclaration( "currentKey", g_PrimaryConfigManager.GetDeploymentKeys( cmd->m_keyIndex ), sizeof(RSAKey) ); +#endif + fSuccess = false; + } } } } ReplyToCommand( msg, fSuccess, false ); - return true; + return true; } bool Loader_Engine::Monitor_FlashSectorMap( WP_Message* msg ) diff --git a/Application/TinyBooter/ConfigurationManager.cpp b/Application/TinyBooter/ConfigurationManager.cpp index d09c2614c..493fa5512 100644 --- a/Application/TinyBooter/ConfigurationManager.cpp +++ b/Application/TinyBooter/ConfigurationManager.cpp @@ -68,7 +68,9 @@ void ConfigurationSectorManager::LocateConfigurationSector( UINT32 BlockUsage ) void ConfigurationSectorManager::LoadConfiguration() { - if (m_device ==NULL) return; + if (m_device ==NULL) + return; + if (m_fSupportsXIP) { // Get the real address @@ -91,7 +93,8 @@ void ConfigurationSectorManager::WriteConfiguration( UINT32 writeOffset, BYTE *d BOOL eraseWrite = FALSE; UINT32 writeLengthInBytes ; - if (m_device ==NULL) return ; + if (m_device ==NULL) + return ; LoadConfiguration(); @@ -179,9 +182,10 @@ void ConfigurationSectorManager::EraseWriteConfigBlock( BYTE * data, UINT32 size BOOL ConfigurationSectorManager::IsBootLoaderRequired( INT32 &bootModeTimeout ) { - const UINT32 c_Empty = 0xFFFFFFFF; + const UINT32 c_Empty = 0xFFFFFFFF; - if(m_device == NULL) return FALSE; + if(m_device == NULL) + return FALSE; volatile UINT32* data = (volatile UINT32*)&m_configurationSector->BooterFlagArray[ 0 ]; diff --git a/Application/TinyBooter/CryptoInterface.cpp b/Application/TinyBooter/CryptoInterface.cpp index c073cdf2b..caf1afe3c 100644 --- a/Application/TinyBooter/CryptoInterface.cpp +++ b/Application/TinyBooter/CryptoInterface.cpp @@ -4,14 +4,9 @@ #include "CryptoInterface.h" #include "ConfigurationManager.h" -//--// extern UINT8* g_ConfigBuffer; -extern int g_ConfigBufferLength; - - -//--// - +extern int g_ConfigBufferLength; CryptoState::CryptoState( UINT32 dataAddress, UINT32 dataLength, BYTE* sig, UINT32 sigLength, UINT32 sectorType ) : #if defined(ARM_V1_2) @@ -43,14 +38,16 @@ bool CryptoState::VerifySignature( UINT32 keyIndex ) // IF THERE IS NO CONFIG SECTOR IN THE FLASH SECTOR TABLE, THEN WE DON'T HAVE KEYS, // THEREFORE WE WILL NOT PERFORM SIGNATURE CHECKING. // - if(g_PrimaryConfigManager.m_device == NULL) return true; + if(g_PrimaryConfigManager.m_device == NULL) + return true; switch(m_sectorType) { case BlockRange::BLOCKTYPE_DEPLOYMENT: // backwards compatibility - if(g_PrimaryConfigManager.GetTinyBooterVersion() != ConfigurationSector::c_CurrentVersionTinyBooter) return true; + if(g_PrimaryConfigManager.GetTinyBooterVersion() != ConfigurationSector::c_CurrentVersionTinyBooter) + return true; // if there is no key then we do not need to check the signature for the deployment sectors ONLY if(g_PrimaryConfigManager.CheckSignatureKeyEmpty( ConfigurationSector::c_DeployKeyDeployment )) @@ -73,10 +70,11 @@ bool CryptoState::VerifySignature( UINT32 keyIndex ) ASSERT(g_ConfigBufferLength > 0); ASSERT(g_ConfigBuffer != NULL); - if(g_ConfigBuffer == NULL || g_ConfigBufferLength <= 0) return false; + if(g_ConfigBuffer == NULL || g_ConfigBufferLength <= 0) + return false; // the g_ConfigBuffer contains the new configuration data - const ConfigurationSector* pNewCfg = (const ConfigurationSector*)g_ConfigBuffer; + const ConfigurationSector* pNewCfg = (const ConfigurationSector*)g_ConfigBuffer; bool fCanWrite = false; bool fRet = false; @@ -125,7 +123,8 @@ bool CryptoState::VerifySignature( UINT32 keyIndex ) // backwards compatibility - if(g_PrimaryConfigManager.GetTinyBooterVersion() != ConfigurationSector::c_CurrentVersionTinyBooter) return true; + if(g_PrimaryConfigManager.GetTinyBooterVersion() != ConfigurationSector::c_CurrentVersionTinyBooter) + return true; // if there is no key then we do not need to check the signature for the deployment sectors ONLY if (g_PrimaryConfigManager.CheckSignatureKeyEmpty( keyIndex )) @@ -136,7 +135,6 @@ bool CryptoState::VerifySignature( UINT32 keyIndex ) key = (RSAKey*)g_PrimaryConfigManager.GetDeploymentKeys( keyIndex ); break; - }; if(key == NULL) @@ -151,7 +149,7 @@ bool CryptoState::VerifySignature( UINT32 keyIndex ) { m_res = ::Crypto_StepRSAOperation( &m_handle ); } - + return m_res == CRYPTO_SUCCESS; } diff --git a/CLR/Core/CLR_RT_UnicodeHelper.cpp b/CLR/Core/CLR_RT_UnicodeHelper.cpp index e6434bb82..0e9fc7e5b 100644 --- a/CLR/Core/CLR_RT_UnicodeHelper.cpp +++ b/CLR/Core/CLR_RT_UnicodeHelper.cpp @@ -103,6 +103,7 @@ int CLR_RT_UnicodeHelper::CountNumberOfBytes( int max ) if(ch >= LOW_SURROGATE_START && ch <= LOW_SURROGATE_END) { num += 4; + max--; } else { @@ -375,6 +376,8 @@ bool CLR_RT_UnicodeHelper::ConvertToUTF8( int iMaxChars, bool fJustMove ) outputUTF8 += 4; outputUTF8_size -= 4; } + + iMaxChars -= 2; } else { diff --git a/CLR/Core/Execution.cpp b/CLR/Core/Execution.cpp index 58b7dee7c..bf58a47eb 100644 --- a/CLR/Core/Execution.cpp +++ b/CLR/Core/Execution.cpp @@ -840,7 +840,7 @@ bool CLR_RT_ExecutionEngine::SpawnStaticConstructorHelper( CLR_RT_AppDomain* app CLR_RT_MethodDef_Index idxNext; _ASSERTE(m_cctorThread != NULL); - _ASSERTE(m_cctorThread->CanThreadBeReused()); + //_ASSERTE(m_cctorThread->CanThreadBeReused()); idxNext.m_data = idx.m_data; diff --git a/CLR/Core/ParseOptions_Win32.cpp b/CLR/Core/ParseOptions_Win32.cpp index 28ebcb94e..5495a0916 100644 --- a/CLR/Core/ParseOptions_Win32.cpp +++ b/CLR/Core/ParseOptions_Win32.cpp @@ -293,7 +293,7 @@ void CLR_RT_ParseOptions::Usage() if(m_commands.size() > 1) { - wprintf( L" %s\n", option.c_str(), cmd->m_szDescription ); + wprintf( L" %s\n", option.c_str()); } for(it2 = cmd->m_params.begin(); it2 != cmd->m_params.end(); it2++) diff --git a/CLR/Core/StringTable.cpp b/CLR/Core/StringTable.cpp index 68571b812..9b5bfeabe 100644 --- a/CLR/Core/StringTable.cpp +++ b/CLR/Core/StringTable.cpp @@ -6,2241 +6,15 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// -static const size_t c_CLR_StringTable_Size = 1076; - -#if defined(TINYCLR_CREATE_STRINGTABLE) - -static CLR_STRING c_CLR_StringTable_Lookup[c_CLR_StringTable_Size]; - -#else - -static const CLR_STRING c_CLR_StringTable_Lookup[] = -{ - /* 0000 */ 0, - /* 0001 */ 20, - /* 0002 */ 40, - /* 0003 */ 47, - /* 0004 */ 53, - /* 0005 */ 122, - /* 0006 */ 191, - /* 0007 */ 197, - /* 0008 */ 201, - /* 0009 */ 208, - /* 000A */ 212, - /* 000B */ 220, - /* 000C */ 235, - /* 000D */ 252, - /* 000E */ 270, - /* 000F */ 279, - /* 0010 */ 295, - /* 0011 */ 306, - /* 0012 */ 317, - /* 0013 */ 326, - /* 0014 */ 340, - /* 0015 */ 348, - /* 0016 */ 362, - /* 0017 */ 366, - /* 0018 */ 387, - /* 0019 */ 397, - /* 001A */ 424, - /* 001B */ 444, - /* 001C */ 465, - /* 001D */ 483, - /* 001E */ 505, - /* 001F */ 533, - /* 0020 */ 539, - /* 0021 */ 549, - /* 0022 */ 559, - /* 0023 */ 568, - /* 0024 */ 581, - /* 0025 */ 599, - /* 0026 */ 606, - /* 0027 */ 620, - /* 0028 */ 630, - /* 0029 */ 641, - /* 002A */ 656, - /* 002B */ 666, - /* 002C */ 676, - /* 002D */ 684, - /* 002E */ 693, - /* 002F */ 705, - /* 0030 */ 710, - /* 0031 */ 723, - /* 0032 */ 728, - /* 0033 */ 735, - /* 0034 */ 748, - /* 0035 */ 758, - /* 0036 */ 766, - /* 0037 */ 772, - /* 0038 */ 779, - /* 0039 */ 786, - /* 003A */ 791, - /* 003B */ 800, - /* 003C */ 808, - /* 003D */ 815, - /* 003E */ 831, - /* 003F */ 836, - /* 0040 */ 848, - /* 0041 */ 863, - /* 0042 */ 881, - /* 0043 */ 892, - /* 0044 */ 906, - /* 0045 */ 917, - /* 0046 */ 930, - /* 0047 */ 936, - /* 0048 */ 958, - /* 0049 */ 981, - /* 004A */ 1001, - /* 004B */ 1017, - /* 004C */ 1038, - /* 004D */ 1044, - /* 004E */ 1059, - /* 004F */ 1072, - /* 0050 */ 1083, - /* 0051 */ 1099, - /* 0052 */ 1113, - /* 0053 */ 1119, - /* 0054 */ 1125, - /* 0055 */ 1133, - /* 0056 */ 1147, - /* 0057 */ 1155, - /* 0058 */ 1171, - /* 0059 */ 1181, - /* 005A */ 1192, - /* 005B */ 1199, - /* 005C */ 1206, - /* 005D */ 1220, - /* 005E */ 1228, - /* 005F */ 1248, - /* 0060 */ 1264, - /* 0061 */ 1273, - /* 0062 */ 1281, - /* 0063 */ 1300, - /* 0064 */ 1321, - /* 0065 */ 1326, - /* 0066 */ 1333, - /* 0067 */ 1345, - /* 0068 */ 1349, - /* 0069 */ 1353, - /* 006A */ 1360, - /* 006B */ 1376, - /* 006C */ 1389, - /* 006D */ 1404, - /* 006E */ 1428, - /* 006F */ 1450, - /* 0070 */ 1469, - /* 0071 */ 1492, - /* 0072 */ 1505, - /* 0073 */ 1517, - /* 0074 */ 1530, - /* 0075 */ 1539, - /* 0076 */ 1554, - /* 0077 */ 1573, - /* 0078 */ 1586, - /* 0079 */ 1590, - /* 007A */ 1600, - /* 007B */ 1613, - /* 007C */ 1626, - /* 007D */ 1639, - /* 007E */ 1652, - /* 007F */ 1664, - /* 0080 */ 1670, - /* 0081 */ 1690, - /* 0082 */ 1699, - /* 0083 */ 1714, - /* 0084 */ 1723, - /* 0085 */ 1731, - /* 0086 */ 1741, - /* 0087 */ 1749, - /* 0088 */ 1758, - /* 0089 */ 1765, - /* 008A */ 1777, - /* 008B */ 1787, - /* 008C */ 1801, - /* 008D */ 1824, - /* 008E */ 1841, - /* 008F */ 1849, - /* 0090 */ 1853, - /* 0091 */ 1860, - /* 0092 */ 1871, - /* 0093 */ 1880, - /* 0094 */ 1897, - /* 0095 */ 1907, - /* 0096 */ 1916, - /* 0097 */ 1937, - /* 0098 */ 1943, - /* 0099 */ 1959, - /* 009A */ 1968, - /* 009B */ 1976, - /* 009C */ 1986, - /* 009D */ 1995, - /* 009E */ 2010, - /* 009F */ 2036, - /* 00A0 */ 2057, - /* 00A1 */ 2063, - /* 00A2 */ 2068, - /* 00A3 */ 2075, - /* 00A4 */ 2085, - /* 00A5 */ 2099, - /* 00A6 */ 2111, - /* 00A7 */ 2121, - /* 00A8 */ 2143, - /* 00A9 */ 2155, - /* 00AA */ 2165, - /* 00AB */ 2179, - /* 00AC */ 2192, - /* 00AD */ 2207, - /* 00AE */ 2217, - /* 00AF */ 2227, - /* 00B0 */ 2236, - /* 00B1 */ 2244, - /* 00B2 */ 2264, - /* 00B3 */ 2271, - /* 00B4 */ 2276, - /* 00B5 */ 2293, - /* 00B6 */ 2307, - /* 00B7 */ 2329, - /* 00B8 */ 2351, - /* 00B9 */ 2373, - /* 00BA */ 2385, - /* 00BB */ 2395, - /* 00BC */ 2400, - /* 00BD */ 2411, - /* 00BE */ 2426, - /* 00BF */ 2435, - /* 00C0 */ 2444, - /* 00C1 */ 2453, - /* 00C2 */ 2464, - /* 00C3 */ 2474, - /* 00C4 */ 2485, - /* 00C5 */ 2500, - /* 00C6 */ 2518, - /* 00C7 */ 2537, - /* 00C8 */ 2546, - /* 00C9 */ 2559, - /* 00CA */ 2565, - /* 00CB */ 2571, - /* 00CC */ 2577, - /* 00CD */ 2584, - /* 00CE */ 2601, - /* 00CF */ 2614, - /* 00D0 */ 2627, - /* 00D1 */ 2643, - /* 00D2 */ 2653, - /* 00D3 */ 2662, - /* 00D4 */ 2665, - /* 00D5 */ 2678, - /* 00D6 */ 2698, - /* 00D7 */ 2714, - /* 00D8 */ 2728, - /* 00D9 */ 2740, - /* 00DA */ 2760, - /* 00DB */ 2776, - /* 00DC */ 2792, - /* 00DD */ 2811, - /* 00DE */ 2828, - /* 00DF */ 2842, - /* 00E0 */ 2862, - /* 00E1 */ 2876, - /* 00E2 */ 2885, - /* 00E3 */ 2901, - /* 00E4 */ 2910, - /* 00E5 */ 2922, - /* 00E6 */ 2937, - /* 00E7 */ 2949, - /* 00E8 */ 2969, - /* 00E9 */ 2988, - /* 00EA */ 2999, - /* 00EB */ 3026, - /* 00EC */ 3054, - /* 00ED */ 3069, - /* 00EE */ 3086, - /* 00EF */ 3096, - /* 00F0 */ 3112, - /* 00F1 */ 3127, - /* 00F2 */ 3139, - /* 00F3 */ 3153, - /* 00F4 */ 3162, - /* 00F5 */ 3175, - /* 00F6 */ 3188, - /* 00F7 */ 3197, - /* 00F8 */ 3207, - /* 00F9 */ 3219, - /* 00FA */ 3247, - /* 00FB */ 3256, - /* 00FC */ 3266, - /* 00FD */ 3278, - /* 00FE */ 3290, - /* 00FF */ 3303, - /* 0100 */ 3314, - /* 0101 */ 3328, - /* 0102 */ 3348, - /* 0103 */ 3362, - /* 0104 */ 3378, - /* 0105 */ 3388, - /* 0106 */ 3403, - /* 0107 */ 3428, - /* 0108 */ 3439, - /* 0109 */ 3449, - /* 010A */ 3460, - /* 010B */ 3468, - /* 010C */ 3476, - /* 010D */ 3486, - /* 010E */ 3502, - /* 010F */ 3520, - /* 0110 */ 3535, - /* 0111 */ 3556, - /* 0112 */ 3568, - /* 0113 */ 3581, - /* 0114 */ 3592, - /* 0115 */ 3605, - /* 0116 */ 3619, - /* 0117 */ 3633, - /* 0118 */ 3654, - /* 0119 */ 3668, - /* 011A */ 3688, - /* 011B */ 3704, - /* 011C */ 3715, - /* 011D */ 3732, - /* 011E */ 3752, - /* 011F */ 3762, - /* 0120 */ 3782, - /* 0121 */ 3809, - /* 0122 */ 3835, - /* 0123 */ 3852, - /* 0124 */ 3864, - /* 0125 */ 3872, - /* 0126 */ 3890, - /* 0127 */ 3906, - /* 0128 */ 3918, - /* 0129 */ 3927, - /* 012A */ 3957, - /* 012B */ 3970, - /* 012C */ 3979, - /* 012D */ 4009, - /* 012E */ 4014, - /* 012F */ 4024, - /* 0130 */ 4041, - /* 0131 */ 4054, - /* 0132 */ 4075, - /* 0133 */ 4085, - /* 0134 */ 4101, - /* 0135 */ 4106, - /* 0136 */ 4116, - /* 0137 */ 4135, - /* 0138 */ 4150, - /* 0139 */ 4170, - /* 013A */ 4183, - /* 013B */ 4194, - /* 013C */ 4206, - /* 013D */ 4218, - /* 013E */ 4228, - /* 013F */ 4245, - /* 0140 */ 4257, - /* 0141 */ 4269, - /* 0142 */ 4281, - /* 0143 */ 4296, - /* 0144 */ 4312, - /* 0145 */ 4328, - /* 0146 */ 4341, - /* 0147 */ 4347, - /* 0148 */ 4359, - /* 0149 */ 4380, - /* 014A */ 4390, - /* 014B */ 4401, - /* 014C */ 4413, - /* 014D */ 4422, - /* 014E */ 4432, - /* 014F */ 4440, - /* 0150 */ 4451, - /* 0151 */ 4476, - /* 0152 */ 4487, - /* 0153 */ 4503, - /* 0154 */ 4528, - /* 0155 */ 4538, - /* 0156 */ 4545, - /* 0157 */ 4567, - /* 0158 */ 4588, - /* 0159 */ 4596, - /* 015A */ 4602, - /* 015B */ 4608, - /* 015C */ 4614, - /* 015D */ 4621, - /* 015E */ 4633, - /* 015F */ 4640, - /* 0160 */ 4658, - /* 0161 */ 4672, - /* 0162 */ 4686, - /* 0163 */ 4707, - /* 0164 */ 4733, - /* 0165 */ 4750, - /* 0166 */ 4757, - /* 0167 */ 4770, - /* 0168 */ 4791, - /* 0169 */ 4812, - /* 016A */ 4829, - /* 016B */ 4844, - /* 016C */ 4861, - /* 016D */ 4872, - /* 016E */ 4886, - /* 016F */ 4899, - /* 0170 */ 4912, - /* 0171 */ 4932, - /* 0172 */ 4951, - /* 0173 */ 4964, - /* 0174 */ 4969, - /* 0175 */ 4973, - /* 0176 */ 4981, - /* 0177 */ 5009, - /* 0178 */ 5024, - /* 0179 */ 5036, - /* 017A */ 5051, - /* 017B */ 5065, - /* 017C */ 5072, - /* 017D */ 5077, - /* 017E */ 5090, - /* 017F */ 5099, - /* 0180 */ 5116, - /* 0181 */ 5135, - /* 0182 */ 5140, - /* 0183 */ 5144, - /* 0184 */ 5153, - /* 0185 */ 5159, - /* 0186 */ 5170, - /* 0187 */ 5182, - /* 0188 */ 5198, - /* 0189 */ 5211, - /* 018A */ 5219, - /* 018B */ 5230, - /* 018C */ 5241, - /* 018D */ 5256, - /* 018E */ 5284, - /* 018F */ 5308, - /* 0190 */ 5326, - /* 0191 */ 5351, - /* 0192 */ 5373, - /* 0193 */ 5392, - /* 0194 */ 5405, - /* 0195 */ 5409, - /* 0196 */ 5418, - /* 0197 */ 5425, - /* 0198 */ 5433, - /* 0199 */ 5439, - /* 019A */ 5444, - /* 019B */ 5453, - /* 019C */ 5460, - /* 019D */ 5474, - /* 019E */ 5492, - /* 019F */ 5502, - /* 01A0 */ 5524, - /* 01A1 */ 5543, - /* 01A2 */ 5558, - /* 01A3 */ 5575, - /* 01A4 */ 5590, - /* 01A5 */ 5616, - /* 01A6 */ 5636, - /* 01A7 */ 5653, - /* 01A8 */ 5673, - /* 01A9 */ 5691, - /* 01AA */ 5710, - /* 01AB */ 5727, - /* 01AC */ 5747, - /* 01AD */ 5773, - /* 01AE */ 5790, - /* 01AF */ 5813, - /* 01B0 */ 5846, - /* 01B1 */ 5878, - /* 01B2 */ 5887, - /* 01B3 */ 5913, - /* 01B4 */ 5947, - /* 01B5 */ 5964, - /* 01B6 */ 5971, - /* 01B7 */ 5985, - /* 01B8 */ 5993, - /* 01B9 */ 5998, - /* 01BA */ 6012, - /* 01BB */ 6036, - /* 01BC */ 6058, - /* 01BD */ 6081, - /* 01BE */ 6088, - /* 01BF */ 6105, - /* 01C0 */ 6112, - /* 01C1 */ 6136, - /* 01C2 */ 6146, - /* 01C3 */ 6154, - /* 01C4 */ 6159, - /* 01C5 */ 6168, - /* 01C6 */ 6178, - /* 01C7 */ 6199, - /* 01C8 */ 6210, - /* 01C9 */ 6217, - /* 01CA */ 6223, - /* 01CB */ 6237, - /* 01CC */ 6254, - /* 01CD */ 6273, - /* 01CE */ 6278, - /* 01CF */ 6283, - /* 01D0 */ 6289, - /* 01D1 */ 6293, - /* 01D2 */ 6302, - /* 01D3 */ 6324, - /* 01D4 */ 6345, - /* 01D5 */ 6350, - /* 01D6 */ 6355, - /* 01D7 */ 6372, - /* 01D8 */ 6391, - /* 01D9 */ 6395, - /* 01DA */ 6401, - /* 01DB */ 6415, - /* 01DC */ 6428, - /* 01DD */ 6450, - /* 01DE */ 6463, - /* 01DF */ 6478, - /* 01E0 */ 6491, - /* 01E1 */ 6515, - /* 01E2 */ 6527, - /* 01E3 */ 6533, - /* 01E4 */ 6540, - /* 01E5 */ 6550, - /* 01E6 */ 6560, - /* 01E7 */ 6582, - /* 01E8 */ 6587, - /* 01E9 */ 6600, - /* 01EA */ 6610, - /* 01EB */ 6619, - /* 01EC */ 6629, - /* 01ED */ 6638, - /* 01EE */ 6660, - /* 01EF */ 6679, - /* 01F0 */ 6695, - /* 01F1 */ 6705, - /* 01F2 */ 6717, - /* 01F3 */ 6725, - /* 01F4 */ 6737, - /* 01F5 */ 6745, - /* 01F6 */ 6761, - /* 01F7 */ 6777, - /* 01F8 */ 6788, - /* 01F9 */ 6796, - /* 01FA */ 6810, - /* 01FB */ 6819, - /* 01FC */ 6836, - /* 01FD */ 6853, - /* 01FE */ 6860, - /* 01FF */ 6869, - /* 0200 */ 6887, - /* 0201 */ 6907, - /* 0202 */ 6928, - /* 0203 */ 6947, - /* 0204 */ 6971, - /* 0205 */ 6991, - /* 0206 */ 6997, - /* 0207 */ 7006, - /* 0208 */ 7017, - /* 0209 */ 7023, - /* 020A */ 7036, - /* 020B */ 7052, - /* 020C */ 7068, - /* 020D */ 7075, - /* 020E */ 7081, - /* 020F */ 7101, - /* 0210 */ 7123, - /* 0211 */ 7146, - /* 0212 */ 7165, - /* 0213 */ 7182, - /* 0214 */ 7197, - /* 0215 */ 7217, - /* 0216 */ 7235, - /* 0217 */ 7247, - /* 0218 */ 7265, - /* 0219 */ 7271, - /* 021A */ 7275, - /* 021B */ 7283, - /* 021C */ 7294, - /* 021D */ 7312, - /* 021E */ 7318, - /* 021F */ 7325, - /* 0220 */ 7330, - /* 0221 */ 7341, - /* 0222 */ 7352, - /* 0223 */ 7357, - /* 0224 */ 7369, - /* 0225 */ 7384, - /* 0226 */ 7391, - /* 0227 */ 7398, - /* 0228 */ 7409, - /* 0229 */ 7437, - /* 022A */ 7468, - /* 022B */ 7480, - /* 022C */ 7509, - /* 022D */ 7541, - /* 022E */ 7556, - /* 022F */ 7575, - /* 0230 */ 7603, - /* 0231 */ 7613, - /* 0232 */ 7617, - /* 0233 */ 7631, - /* 0234 */ 7651, - /* 0235 */ 7671, - /* 0236 */ 7681, - /* 0237 */ 7694, - /* 0238 */ 7710, - /* 0239 */ 7724, - /* 023A */ 7736, - /* 023B */ 7752, - /* 023C */ 7761, - /* 023D */ 7767, - /* 023E */ 7771, - /* 023F */ 7778, - /* 0240 */ 7783, - /* 0241 */ 7789, - /* 0242 */ 7796, - /* 0243 */ 7810, - /* 0244 */ 7822, - /* 0245 */ 7838, - /* 0246 */ 7850, - /* 0247 */ 7863, - /* 0248 */ 7881, - /* 0249 */ 7898, - /* 024A */ 7909, - /* 024B */ 7916, - /* 024C */ 7928, - /* 024D */ 7934, - /* 024E */ 7947, - /* 024F */ 7960, - /* 0250 */ 7973, - /* 0251 */ 7979, - /* 0252 */ 7993, - /* 0253 */ 8002, - /* 0254 */ 8009, - /* 0255 */ 8022, - /* 0256 */ 8035, - /* 0257 */ 8042, - /* 0258 */ 8058, - /* 0259 */ 8070, - /* 025A */ 8080, - /* 025B */ 8089, - /* 025C */ 8117, - /* 025D */ 8134, - /* 025E */ 8142, - /* 025F */ 8169, - /* 0260 */ 8176, - /* 0261 */ 8195, - /* 0262 */ 8236, - /* 0263 */ 8265, - /* 0264 */ 8296, - /* 0265 */ 8330, - /* 0266 */ 8363, - /* 0267 */ 8395, - /* 0268 */ 8427, - /* 0269 */ 8461, - /* 026A */ 8495, - /* 026B */ 8529, - /* 026C */ 8551, - /* 026D */ 8570, - /* 026E */ 8591, - /* 026F */ 8622, - /* 0270 */ 8649, - /* 0271 */ 8659, - /* 0272 */ 8675, - /* 0273 */ 8686, - /* 0274 */ 8705, - /* 0275 */ 8723, - /* 0276 */ 8740, - /* 0277 */ 8772, - /* 0278 */ 8796, - /* 0279 */ 8808, - /* 027A */ 8825, - /* 027B */ 8841, - /* 027C */ 8850, - /* 027D */ 8861, - /* 027E */ 8872, - /* 027F */ 8883, - /* 0280 */ 8894, - /* 0281 */ 8901, - /* 0282 */ 8922, - /* 0283 */ 8937, - /* 0284 */ 8949, - /* 0285 */ 8961, - /* 0286 */ 8966, - /* 0287 */ 8977, - /* 0288 */ 8986, - /* 0289 */ 8995, - /* 028A */ 9006, - /* 028B */ 9026, - /* 028C */ 9044, - /* 028D */ 9060, - /* 028E */ 9076, - /* 028F */ 9093, - /* 0290 */ 9099, - /* 0291 */ 9113, - /* 0292 */ 9121, - /* 0293 */ 9128, - /* 0294 */ 9140, - /* 0295 */ 9147, - /* 0296 */ 9159, - /* 0297 */ 9168, - /* 0298 */ 9176, - /* 0299 */ 9184, - /* 029A */ 9192, - /* 029B */ 9204, - /* 029C */ 9212, - /* 029D */ 9220, - /* 029E */ 9229, - /* 029F */ 9238, - /* 02A0 */ 9247, - /* 02A1 */ 9256, - /* 02A2 */ 9272, - /* 02A3 */ 9280, - /* 02A4 */ 9286, - /* 02A5 */ 9291, - /* 02A6 */ 9299, - /* 02A7 */ 9309, - /* 02A8 */ 9322, - /* 02A9 */ 9333, - /* 02AA */ 9346, - /* 02AB */ 9351, - /* 02AC */ 9360, - /* 02AD */ 9367, - /* 02AE */ 9374, - /* 02AF */ 9381, - /* 02B0 */ 9393, - /* 02B1 */ 9406, - /* 02B2 */ 9427, - /* 02B3 */ 9434, - /* 02B4 */ 9442, - /* 02B5 */ 9457, - /* 02B6 */ 9477, - /* 02B7 */ 9487, - /* 02B8 */ 9503, - /* 02B9 */ 9511, - /* 02BA */ 9516, - /* 02BB */ 9534, - /* 02BC */ 9542, - /* 02BD */ 9550, - /* 02BE */ 9563, - /* 02BF */ 9578, - /* 02C0 */ 9603, - /* 02C1 */ 9614, - /* 02C2 */ 9627, - /* 02C3 */ 9635, - /* 02C4 */ 9648, - /* 02C5 */ 9662, - /* 02C6 */ 9668, - /* 02C7 */ 9682, - /* 02C8 */ 9692, - /* 02C9 */ 9703, - /* 02CA */ 9713, - /* 02CB */ 9723, - /* 02CC */ 9731, - /* 02CD */ 9733, - /* 02CE */ 9735, - /* 02CF */ 9740, - /* 02D0 */ 9745, - /* 02D1 */ 9752, - /* 02D2 */ 9759, - /* 02D3 */ 9766, - /* 02D4 */ 9776, - /* 02D5 */ 9805, - /* 02D6 */ 9834, - /* 02D7 */ 9841, - /* 02D8 */ 9849, - /* 02D9 */ 9858, - /* 02DA */ 9867, - /* 02DB */ 9877, - /* 02DC */ 9887, - /* 02DD */ 9905, - /* 02DE */ 9915, - /* 02DF */ 9925, - /* 02E0 */ 9936, - /* 02E1 */ 9952, - /* 02E2 */ 9963, - /* 02E3 */ 9975, - /* 02E4 */ 9985, - /* 02E5 */ 9997, - /* 02E6 */ 10004, - /* 02E7 */ 10012, - /* 02E8 */ 10019, - /* 02E9 */ 10027, - /* 02EA */ 10036, - /* 02EB */ 10052, - /* 02EC */ 10070, - /* 02ED */ 10078, - /* 02EE */ 10090, - /* 02EF */ 10100, - /* 02F0 */ 10116, - /* 02F1 */ 10127, - /* 02F2 */ 10133, - /* 02F3 */ 10141, - /* 02F4 */ 10153, - /* 02F5 */ 10165, - /* 02F6 */ 10185, - /* 02F7 */ 10207, - /* 02F8 */ 10214, - /* 02F9 */ 10230, - /* 02FA */ 10242, - /* 02FB */ 10255, - /* 02FC */ 10260, - /* 02FD */ 10266, - /* 02FE */ 10274, - /* 02FF */ 10288, - /* 0300 */ 10301, - /* 0301 */ 10310, - /* 0302 */ 10330, - /* 0303 */ 10353, - /* 0304 */ 10370, - /* 0305 */ 10394, - /* 0306 */ 10420, - /* 0307 */ 10431, - /* 0308 */ 10443, - /* 0309 */ 10459, - /* 030A */ 10472, - /* 030B */ 10487, - /* 030C */ 10501, - /* 030D */ 10516, - /* 030E */ 10529, - /* 030F */ 10539, - /* 0310 */ 10551, - /* 0311 */ 10563, - /* 0312 */ 10578, - /* 0313 */ 10591, - /* 0314 */ 10604, - /* 0315 */ 10614, - /* 0316 */ 10625, - /* 0317 */ 10635, - /* 0318 */ 10652, - /* 0319 */ 10672, - /* 031A */ 10684, - /* 031B */ 10702, - /* 031C */ 10722, - /* 031D */ 10738, - /* 031E */ 10756, - /* 031F */ 10776, - /* 0320 */ 10797, - /* 0321 */ 10826, - /* 0322 */ 10844, - /* 0323 */ 10853, - /* 0324 */ 10871, - /* 0325 */ 10890, - /* 0326 */ 10898, - /* 0327 */ 10911, - /* 0328 */ 10925, - /* 0329 */ 10939, - /* 032A */ 10956, - /* 032B */ 10965, - /* 032C */ 10983, - /* 032D */ 10993, - /* 032E */ 11007, - /* 032F */ 11025, - /* 0330 */ 11038, - /* 0331 */ 11046, - /* 0332 */ 11062, - /* 0333 */ 11076, - /* 0334 */ 11090, - /* 0335 */ 11101, - /* 0336 */ 11115, - /* 0337 */ 11126, - /* 0338 */ 11140, - /* 0339 */ 11150, - /* 033A */ 11167, - /* 033B */ 11191, - /* 033C */ 11204, - /* 033D */ 11231, - /* 033E */ 11248, - /* 033F */ 11269, - /* 0340 */ 11282, - /* 0341 */ 11291, - /* 0342 */ 11301, - /* 0343 */ 11316, - /* 0344 */ 11323, - /* 0345 */ 11340, - /* 0346 */ 11359, - /* 0347 */ 11373, - /* 0348 */ 11388, - /* 0349 */ 11400, - /* 034A */ 11412, - /* 034B */ 11424, - /* 034C */ 11439, - /* 034D */ 11451, - /* 034E */ 11462, - /* 034F */ 11474, - /* 0350 */ 11490, - /* 0351 */ 11506, - /* 0352 */ 11527, - /* 0353 */ 11543, - /* 0354 */ 11556, - /* 0355 */ 11571, - /* 0356 */ 11590, - /* 0357 */ 11603, - /* 0358 */ 11622, - /* 0359 */ 11634, - /* 035A */ 11650, - /* 035B */ 11664, - /* 035C */ 11673, - /* 035D */ 11682, - /* 035E */ 11701, - /* 035F */ 11723, - /* 0360 */ 11742, - /* 0361 */ 11760, - /* 0362 */ 11781, - /* 0363 */ 11792, - /* 0364 */ 11810, - /* 0365 */ 11829, - /* 0366 */ 11849, - /* 0367 */ 11869, - /* 0368 */ 11879, - /* 0369 */ 11894, - /* 036A */ 11906, - /* 036B */ 11917, - /* 036C */ 11933, - /* 036D */ 11950, - /* 036E */ 11960, - /* 036F */ 11971, - /* 0370 */ 11983, - /* 0371 */ 11993, - /* 0372 */ 12003, - /* 0373 */ 12023, - /* 0374 */ 12038, - /* 0375 */ 12047, - /* 0376 */ 12064, - /* 0377 */ 12076, - /* 0378 */ 12084, - /* 0379 */ 12111, - /* 037A */ 12128, - /* 037B */ 12153, - /* 037C */ 12174, - /* 037D */ 12182, - /* 037E */ 12196, - /* 037F */ 12219, - /* 0380 */ 12236, - /* 0381 */ 12250, - /* 0382 */ 12261, - /* 0383 */ 12273, - /* 0384 */ 12288, - /* 0385 */ 12297, - /* 0386 */ 12310, - /* 0387 */ 12327, - /* 0388 */ 12340, - /* 0389 */ 12357, - /* 038A */ 12373, - /* 038B */ 12392, - /* 038C */ 12411, - /* 038D */ 12424, - /* 038E */ 12444, - /* 038F */ 12459, - /* 0390 */ 12472, - /* 0391 */ 12481, - /* 0392 */ 12489, - /* 0393 */ 12500, - /* 0394 */ 12512, - /* 0395 */ 12525, - /* 0396 */ 12541, - /* 0397 */ 12562, - /* 0398 */ 12583, - /* 0399 */ 12597, - /* 039A */ 12606, - /* 039B */ 12620, - /* 039C */ 12635, - /* 039D */ 12652, - /* 039E */ 12662, - /* 039F */ 12675, - /* 03A0 */ 12691, - /* 03A1 */ 12702, - /* 03A2 */ 12718, - /* 03A3 */ 12728, - /* 03A4 */ 12742, - /* 03A5 */ 12760, - /* 03A6 */ 12775, - /* 03A7 */ 12785, - /* 03A8 */ 12794, - /* 03A9 */ 12805, - /* 03AA */ 12817, - /* 03AB */ 12834, - /* 03AC */ 12843, - /* 03AD */ 12864, - /* 03AE */ 12876, - /* 03AF */ 12888, - /* 03B0 */ 12900, - /* 03B1 */ 12911, - /* 03B2 */ 12920, - /* 03B3 */ 12926, - /* 03B4 */ 12933, - /* 03B5 */ 12949, - /* 03B6 */ 12965, - /* 03B7 */ 12975, - /* 03B8 */ 12987, - /* 03B9 */ 12996, - /* 03BA */ 13007, - /* 03BB */ 13017, - /* 03BC */ 13026, - /* 03BD */ 13050, - /* 03BE */ 13057, - /* 03BF */ 13068, - /* 03C0 */ 13077, - /* 03C1 */ 13089, - /* 03C2 */ 13100, - /* 03C3 */ 13115, - /* 03C4 */ 13126, - /* 03C5 */ 13135, - /* 03C6 */ 13146, - /* 03C7 */ 13158, - /* 03C8 */ 13167, - /* 03C9 */ 13172, - /* 03CA */ 13186, - /* 03CB */ 13200, - /* 03CC */ 13212, - /* 03CD */ 13224, - /* 03CE */ 13231, - /* 03CF */ 13239, - /* 03D0 */ 13250, - /* 03D1 */ 13268, - /* 03D2 */ 13274, - /* 03D3 */ 13282, - /* 03D4 */ 13293, - /* 03D5 */ 13305, - /* 03D6 */ 13313, - /* 03D7 */ 13328, - /* 03D8 */ 13339, - /* 03D9 */ 13360, - /* 03DA */ 13369, - /* 03DB */ 13376, - /* 03DC */ 13381, - /* 03DD */ 13401, - /* 03DE */ 13416, - /* 03DF */ 13433, - /* 03E0 */ 13449, - /* 03E1 */ 13465, - /* 03E2 */ 13475, - /* 03E3 */ 13485, - /* 03E4 */ 13492, - /* 03E5 */ 13504, - /* 03E6 */ 13516, - /* 03E7 */ 13525, - /* 03E8 */ 13535, - /* 03E9 */ 13544, - /* 03EA */ 13558, - /* 03EB */ 13565, - /* 03EC */ 13580, - /* 03ED */ 13597, - /* 03EE */ 13602, - /* 03EF */ 13615, - /* 03F0 */ 13626, - /* 03F1 */ 13640, - /* 03F2 */ 13646, - /* 03F3 */ 13653, - /* 03F4 */ 13662, - /* 03F5 */ 13675, - /* 03F6 */ 13683, - /* 03F7 */ 13691, - /* 03F8 */ 13700, - /* 03F9 */ 13714, - /* 03FA */ 13722, - /* 03FB */ 13730, - /* 03FC */ 13737, - /* 03FD */ 13745, - /* 03FE */ 13755, - /* 03FF */ 13763, - /* 0400 */ 13779, - /* 0401 */ 13790, - /* 0402 */ 13799, - /* 0403 */ 13812, - /* 0404 */ 13820, - /* 0405 */ 13843, - /* 0406 */ 13864, - /* 0407 */ 13881, - /* 0408 */ 13893, - /* 0409 */ 13905, - /* 040A */ 13920, - /* 040B */ 13942, - /* 040C */ 13956, - /* 040D */ 13968, - /* 040E */ 13987, - /* 040F */ 14002, - /* 0410 */ 14019, - /* 0411 */ 14032, - /* 0412 */ 14045, - /* 0413 */ 14050, - /* 0414 */ 14063, - /* 0415 */ 14068, - /* 0416 */ 14077, - /* 0417 */ 14096, - /* 0418 */ 14102, - /* 0419 */ 14115, - /* 041A */ 14130, - /* 041B */ 14135, - /* 041C */ 14142, - /* 041D */ 14153, - /* 041E */ 14166, - /* 041F */ 14177, - /* 0420 */ 14206, - /* 0421 */ 14223, - /* 0422 */ 14244, - /* 0423 */ 14258, - /* 0424 */ 14267, - /* 0425 */ 14279, - /* 0426 */ 14292, - /* 0427 */ 14305, - /* 0428 */ 14321, - /* 0429 */ 14340, - /* 042A */ 14353, - /* 042B */ 14369, - /* 042C */ 14380, - /* 042D */ 14397, - /* 042E */ 14408, - /* 042F */ 14425, - /* 0430 */ 14442, - /* 0431 */ 14449, - /* 0432 */ 14463, - /* 0433 */ 14471, -}; - -#endif - -static const char c_CLR_StringTable_Data[] = - /* 0000 */ "$$method0x6000076-1\0" - /* 0001 */ "$$method0x60000d3-1\0" - /* 0002 */ ".cctor\0" - /* 0003 */ ".ctor\0" - /* 0004 */ "{B70A4291-7624-430A-AAE1-8CF9F687DC1C}\0" - /* 0005 */ "{C7C76022-B6BB-4169-9C7D-91094A106503}\0" - /* 0006 */ "Abort\0" - /* 0007 */ "Abs\0" - /* 0008 */ "Accept\0" - /* 0009 */ "Add\0" - /* 000A */ "AddDays\0" - /* 000B */ "AddEventFilter\0" - /* 000C */ "AddEventListener\0" - /* 000D */ "AddEventProcessor\0" - /* 000E */ "AddHours\0" - /* 000F */ "AddMilliseconds\0" - /* 0010 */ "AddMinutes\0" - /* 0011 */ "AddSeconds\0" - /* 0012 */ "AddTicks\0" - /* 0013 */ "AddToOpenList\0" - /* 0014 */ "Address\0" - /* 0015 */ "AddressFamily\0" - /* 0016 */ "Any\0" - /* 0017 */ "AnyPendingFinalizers\0" - /* 0018 */ "AppDomain\0" - /* 0019 */ "AppDomainUnloadedException\0" - /* 001A */ "AppendTrailingZeros\0" - /* 001B */ "ApplicationException\0" - /* 001C */ "ArgumentException\0" - /* 001D */ "ArgumentNullException\0" - /* 001E */ "ArgumentOutOfRangeException\0" - /* 001F */ "Array\0" - /* 0020 */ "ArrayList\0" - /* 0021 */ "ArraySize\0" - /* 0022 */ "Assembly\0" - /* 0023 */ "AssemblyInfo\0" - /* 0024 */ "AssemblyNameFlags\0" - /* 0025 */ "Assert\0" - /* 0026 */ "AsyncCallback\0" - /* 0027 */ "Attribute\0" - /* 0028 */ "Attributes\0" - /* 0029 */ "AutoResetEvent\0" - /* 002A */ "Backlight\0" - /* 002B */ "BaseEvent\0" - /* 002C */ "Battery\0" - /* 002D */ "BaudRate\0" - /* 002E */ "BeginInvoke\0" - /* 002F */ "Bias\0" - /* 0030 */ "BinarySearch\0" - /* 0031 */ "Bind\0" - /* 0032 */ "Binder\0" - /* 0033 */ "BindingFlags\0" - /* 0034 */ "BitPacked\0" - /* 0035 */ "Boolean\0" - /* 0036 */ "Break\0" - /* 0037 */ "Buffer\0" - /* 0038 */ "Button\0" - /* 0039 */ "Byte\0" - /* 003A */ "Category\0" - /* 003B */ "Ceiling\0" - /* 003C */ "Change\0" - /* 003D */ "ChangeExtension\0" - /* 003E */ "Char\0" - /* 003F */ "Charge_Full\0" - /* 0040 */ "Charge_FullMin\0" - /* 0041 */ "Charge_Hysteresis\0" - /* 0042 */ "Charge_Low\0" - /* 0043 */ "Charge_Medium\0" - /* 0044 */ "Charge_Min\0" - /* 0045 */ "ChargerModel\0" - /* 0046 */ "Check\0" - /* 0047 */ "CheckInvalidPathChars\0" - /* 0048 */ "ChipSelect_ActiveState\0" - /* 0049 */ "ChipSelect_HoldTime\0" - /* 004A */ "ChipSelect_Port\0" - /* 004B */ "ChipSelect_SetupTime\0" - /* 004C */ "Clear\0" - /* 004D */ "ClearInterrupt\0" - /* 004E */ "ClockRateKhz\0" - /* 004F */ "Clock_Edge\0" - /* 0050 */ "Clock_IdleState\0" - /* 0051 */ "Clock_RateKHz\0" - /* 0052 */ "Clone\0" - /* 0053 */ "Close\0" - /* 0054 */ "Combine\0" - /* 0055 */ "CombineArrays\0" - /* 0056 */ "Compare\0" - /* 0057 */ "CompareExchange\0" - /* 0058 */ "CompareTo\0" - /* 0059 */ "ComputeCRC\0" - /* 005A */ "Concat\0" - /* 005B */ "Config\0" - /* 005C */ "Configuration\0" - /* 005D */ "Connect\0" - /* 005E */ "ConstraintException\0" - /* 005F */ "ConstructorInfo\0" - /* 0060 */ "Contains\0" - /* 0061 */ "Convert\0" - /* 0062 */ "ConvertNameToIndex\0" - /* 0063 */ "ConvertStringToInt32\0" - /* 0064 */ "Copy\0" - /* 0065 */ "CopyTo\0" - /* 0066 */ "CoreNewLine\0" - /* 0067 */ "Cos\0" - /* 0068 */ "Cpu\0" - /* 0069 */ "Create\0" - /* 006A */ "CreateDirectory\0" - /* 006B */ "CreateDomain\0" - /* 006C */ "CreateInstance\0" - /* 006D */ "CreateInstanceAndUnwrap\0" - /* 006E */ "CreateReadTransaction\0" - /* 006F */ "CreateSubdirectory\0" - /* 0070 */ "CreateWriteTransaction\0" - /* 0071 */ "CreationTime\0" - /* 0072 */ "CultureInfo\0" - /* 0073 */ "CultureTypes\0" - /* 0074 */ "DateTime\0" - /* 0075 */ "DateTimeFormat\0" - /* 0076 */ "DateTimeFormatInfo\0" - /* 0077 */ "DateTimeKind\0" - /* 0078 */ "Day\0" - /* 0079 */ "DayOfWeek\0" - /* 007A */ "DaylightBias\0" - /* 007B */ "DaylightDate\0" - /* 007C */ "DaylightName\0" - /* 007D */ "DaylightTime\0" - /* 007E */ "DaysInMonth\0" - /* 007F */ "Debug\0" - /* 0080 */ "DebuggableAttribute\0" - /* 0081 */ "Debugger\0" - /* 0082 */ "DebuggingModes\0" - /* 0083 */ "DecodeRS\0" - /* 0084 */ "Decoder\0" - /* 0085 */ "Decrement\0" - /* 0086 */ "Decrypt\0" - /* 0087 */ "Delegate\0" - /* 0088 */ "Delete\0" - /* 0089 */ "Deserialize\0" - /* 008A */ "Directory\0" - /* 008B */ "DirectoryInfo\0" - /* 008C */ "DirectorySeparatorChar\0" - /* 008D */ "DisableInterrupt\0" - /* 008E */ "Dispose\0" - /* 008F */ "Dns\0" - /* 0090 */ "Double\0" - /* 0091 */ "DumpBuffer\0" - /* 0092 */ "DumpHeap\0" - /* 0093 */ "DumpPerfCounters\0" - /* 0094 */ "DumpStack\0" - /* 0095 */ "Duration\0" - /* 0096 */ "EditorBrowsableState\0" - /* 0097 */ "Empty\0" - /* 0098 */ "EnableInterrupt\0" - /* 0099 */ "Encoding\0" - /* 009A */ "Encrypt\0" - /* 009B */ "EndInvoke\0" - /* 009C */ "EndPoint\0" - /* 009D */ "EnsureCapacity\0" - /* 009E */ "EnsureStringArrayResource\0" - /* 009F */ "EnsureStringResource\0" - /* 00A0 */ "Enter\0" - /* 00A1 */ "Enum\0" - /* 00A2 */ "Equals\0" - /* 00A3 */ "EventArgs\0" - /* 00A4 */ "EventCategory\0" - /* 00A5 */ "EventConfig\0" - /* 00A6 */ "EventData\0" - /* 00A7 */ "EventDispatchCallback\0" - /* 00A8 */ "EventFilter\0" - /* 00A9 */ "EventInfo\0" - /* 00AA */ "EventListener\0" - /* 00AB */ "EventMessage\0" - /* 00AC */ "EventProcessor\0" - /* 00AD */ "EventSink\0" - /* 00AE */ "Exception\0" - /* 00AF */ "Exchange\0" - /* 00B0 */ "Execute\0" - /* 00B1 */ "ExecutionConstraint\0" - /* 00B2 */ "Exists\0" - /* 00B3 */ "Exit\0" - /* 00B4 */ "ExtendedTimeZone\0" - /* 00B5 */ "ExtendedTimer\0" - /* 00B6 */ "ExtendedWeakReference\0" - /* 00B7 */ "ExtractRangeFromArray\0" - /* 00B8 */ "ExtractValueFromArray\0" - /* 00B9 */ "FalseString\0" - /* 00BA */ "FieldInfo\0" - /* 00BB */ "File\0" - /* 00BC */ "FileAccess\0" - /* 00BD */ "FileAttributes\0" - /* 00BE */ "FileInfo\0" - /* 00BF */ "FileMode\0" - /* 00C0 */ "FileName\0" - /* 00C1 */ "FileRecord\0" - /* 00C2 */ "FileShare\0" - /* 00C3 */ "FileStream\0" - /* 00C4 */ "FileSystemInfo\0" - /* 00C5 */ "FileSystemManager\0" - /* 00C6 */ "FillBufferAndReset\0" - /* 00C7 */ "Finalize\0" - /* 00C8 */ "FindResource\0" - /* 00C9 */ "Flags\0" - /* 00CA */ "Floor\0" - /* 00CB */ "Flush\0" - /* 00CC */ "Format\0" - /* 00CD */ "FormatCustomized\0" - /* 00CE */ "FormatDigits\0" - /* 00CF */ "FormatNative\0" - /* 00D0 */ "FromFileTimeUtc\0" - /* 00D1 */ "FromTicks\0" - /* 00D2 */ "FullName\0" - /* 00D3 */ "GC\0" - /* 00D4 */ "GenericEvent\0" - /* 00D5 */ "GetActivationString\0" - /* 00D6 */ "GetAddressBytes\0" - /* 00D7 */ "GetAssemblies\0" - /* 00D8 */ "GetAssembly\0" - /* 00D9 */ "GetAssemblyFromHash\0" - /* 00DA */ "GetAssemblyHash\0" - /* 00DB */ "GetAssemblyInfo\0" - /* 00DC */ "GetAssemblyLastUse\0" - /* 00DD */ "GetAssemblyPatch\0" - /* 00DE */ "GetAttributes\0" - /* 00DF */ "GetBaudRateBoundary\0" - /* 00E0 */ "GetButtonPins\0" - /* 00E1 */ "GetBytes\0" - /* 00E2 */ "GetChargerModel\0" - /* 00E3 */ "GetChars\0" - /* 00E4 */ "GetChildren\0" - /* 00E5 */ "GetConstructor\0" - /* 00E6 */ "GetCultures\0" - /* 00E7 */ "GetCurrentDirectory\0" - /* 00E8 */ "GetDaylightChanges\0" - /* 00E9 */ "GetDecoder\0" - /* 00EA */ "GetDelimitedStringResource\0" - /* 00EB */ "GetDelimitedStringResources\0" - /* 00EC */ "GetDirectories\0" - /* 00ED */ "GetDirectoryName\0" - /* 00EE */ "GetDomain\0" - /* 00EF */ "GetDoubleNumber\0" - /* 00F0 */ "GetElementType\0" - /* 00F1 */ "GetEndPoint\0" - /* 00F2 */ "GetEnumerator\0" - /* 00F3 */ "GetEvent\0" - /* 00F4 */ "GetEventInfo\0" - /* 00F5 */ "GetExtension\0" - /* 00F6 */ "GetField\0" - /* 00F7 */ "GetFields\0" - /* 00F8 */ "GetFileName\0" - /* 00F9 */ "GetFileNameWithoutExtension\0" - /* 00FA */ "GetFiles\0" - /* 00FB */ "GetFormat\0" - /* 00FC */ "GetFullPath\0" - /* 00FD */ "GetHashCode\0" - /* 00FE */ "GetHostEntry\0" - /* 00FF */ "GetI2CPins\0" - /* 0100 */ "GetInterfaces\0" - /* 0101 */ "GetInvalidPathChars\0" - /* 0102 */ "GetLCDMetrics\0" - /* 0103 */ "GetLastBootTime\0" - /* 0104 */ "GetLength\0" - /* 0105 */ "GetMachineTime\0" - /* 0106 */ "GetManifestResourceNames\0" - /* 0107 */ "GetMessage\0" - /* 0108 */ "GetMethod\0" - /* 0109 */ "GetMethods\0" - /* 010A */ "GetName\0" - /* 010B */ "GetNext\0" - /* 010C */ "GetObject\0" - /* 010D */ "GetObjectFromId\0" - /* 010E */ "GetObjectInternal\0" - /* 010F */ "GetObjectValue\0" - /* 0110 */ "GetParentCultureName\0" - /* 0111 */ "GetPathRoot\0" - /* 0112 */ "GetPinsCount\0" - /* 0113 */ "GetPinsMap\0" - /* 0114 */ "GetPinsUsage\0" - /* 0115 */ "GetRealFormat\0" - /* 0116 */ "GetRootLength\0" - /* 0117 */ "GetSatelliteAssembly\0" - /* 0118 */ "GetSerialPins\0" - /* 0119 */ "GetSerialPortsCount\0" - /* 011A */ "GetSocketOption\0" - /* 011B */ "GetSpiPins\0" - /* 011C */ "GetSpiPortsCount\0" - /* 011D */ "GetStreamProperties\0" - /* 011E */ "GetString\0" - /* 011F */ "GetSupportBaudRates\0" - /* 0120 */ "GetSupportedInterruptModes\0" - /* 0121 */ "GetSupportedResistorModes\0" - /* 0122 */ "GetSystemVersion\0" - /* 0123 */ "GetTimeZone\0" - /* 0124 */ "GetType\0" - /* 0125 */ "GetTypeFromHandle\0" - /* 0126 */ "GetTypeFromHash\0" - /* 0127 */ "GetTypeHash\0" - /* 0128 */ "GetTypes\0" - /* 0129 */ "GetTypesImplementingInterface\0" - /* 012A */ "GetUtcOffset\0" - /* 012B */ "GetValue\0" - /* 012C */ "GloballySynchronizedAttribute\0" - /* 012D */ "Guid\0" - /* 012E */ "Handshake\0" - /* 012F */ "HardwareProvider\0" - /* 0130 */ "HasExtension\0" - /* 0131 */ "HasIllegalCharacters\0" - /* 0132 */ "HexToChar\0" - /* 0133 */ "HibernateSystem\0" - /* 0134 */ "Hour\0" - /* 0135 */ "I2CDevice\0" - /* 0136 */ "I2CReadTransaction\0" - /* 0137 */ "I2CTransaction\0" - /* 0138 */ "I2CWriteTransaction\0" - /* 0139 */ "IAsyncResult\0" - /* 013A */ "ICloneable\0" - /* 013B */ "ICollection\0" - /* 013C */ "IComparable\0" - /* 013D */ "IComparer\0" - /* 013E */ "ICustomFormatter\0" - /* 013F */ "IDisposable\0" - /* 0140 */ "IEnumerable\0" - /* 0141 */ "IEnumerator\0" - /* 0142 */ "IEventListener\0" - /* 0143 */ "IEventProcessor\0" - /* 0144 */ "IFormatProvider\0" - /* 0145 */ "IFormattable\0" - /* 0146 */ "IList\0" - /* 0147 */ "IOException\0" - /* 0148 */ "IOExceptionErrorCode\0" - /* 0149 */ "IPAddress\0" - /* 014A */ "IPEndPoint\0" - /* 014B */ "IPHostEntry\0" - /* 014C */ "IReflect\0" - /* 014D */ "Increment\0" - /* 014E */ "IndexOf\0" - /* 014F */ "IndexOfAny\0" - /* 0150 */ "IndexOutOfRangeException\0" - /* 0151 */ "Initialize\0" - /* 0152 */ "InitializeArray\0" - /* 0153 */ "InitializeForEventSource\0" - /* 0154 */ "InputPort\0" - /* 0155 */ "Insert\0" - /* 0156 */ "InsertGroupSeperators\0" - /* 0157 */ "InsertValueIntoArray\0" - /* 0158 */ "Install\0" - /* 0159 */ "Int16\0" - /* 015A */ "Int32\0" - /* 015B */ "Int64\0" - /* 015C */ "IntPtr\0" - /* 015D */ "Interlocked\0" - /* 015E */ "Intern\0" - /* 015F */ "InternalWriteRead\0" - /* 0160 */ "InterruptMode\0" - /* 0161 */ "InterruptPort\0" - /* 0162 */ "InvalidCastException\0" - /* 0163 */ "InvalidOperationException\0" - /* 0164 */ "InvalidPathChars\0" - /* 0165 */ "Invoke\0" - /* 0166 */ "InvokeMember\0" - /* 0167 */ "IsDaylightSavingTime\0" - /* 0168 */ "IsDirectorySeparator\0" - /* 0169 */ "IsFeaturePresent\0" - /* 016A */ "IsFullyCharged\0" - /* 016B */ "IsInstanceOfType\0" - /* 016C */ "IsInterned\0" - /* 016D */ "IsNullOrEmpty\0" - /* 016E */ "IsPathRooted\0" - /* 016F */ "IsSubclassOf\0" - /* 0170 */ "IsSupportedBaudRate\0" - /* 0171 */ "IsTransparentProxy\0" - /* 0172 */ "IsTypeLoaded\0" - /* 0173 */ "Join\0" - /* 0174 */ "Key\0" - /* 0175 */ "Key_RSA\0" - /* 0176 */ "Key_TinyEncryptionAlgorithm\0" - /* 0177 */ "LastAccessTime\0" - /* 0178 */ "LastIndexOf\0" - /* 0179 */ "LastIndexOfAny\0" - /* 017A */ "LastWriteTime\0" - /* 017B */ "Listen\0" - /* 017C */ "Load\0" - /* 017D */ "LoadInternal\0" - /* 017E */ "Loopback\0" - /* 017F */ "ManualResetEvent\0" - /* 0180 */ "MarshalByRefObject\0" - /* 0181 */ "Math\0" - /* 0182 */ "Max\0" - /* 0183 */ "MaxValue\0" - /* 0184 */ "Media\0" - /* 0185 */ "MemberInfo\0" - /* 0186 */ "MemberTypes\0" - /* 0187 */ "MemberwiseClone\0" - /* 0188 */ "MemoryStream\0" - /* 0189 */ "Message\0" - /* 018A */ "MethodBase\0" - /* 018B */ "MethodInfo\0" - /* 018C */ "Microsoft.SPOT\0" - /* 018D */ "Microsoft.SPOT.Cryptography\0" - /* 018E */ "Microsoft.SPOT.Hardware\0" - /* 018F */ "Microsoft.SPOT.IO\0" - /* 0190 */ "Microsoft.SPOT.Messaging\0" - /* 0191 */ "Microsoft.SPOT.Native\0" - /* 0192 */ "Microsoft.SPOT.Net\0" - /* 0193 */ "Milliseconds\0" - /* 0194 */ "Min\0" - /* 0195 */ "MinValue\0" - /* 0196 */ "Minute\0" - /* 0197 */ "Monitor\0" - /* 0198 */ "Month\0" - /* 0199 */ "Move\0" - /* 019A */ "MoveNext\0" - /* 019B */ "MoveTo\0" - /* 019C */ "MultiCastCase\0" - /* 019D */ "MulticastDelegate\0" - /* 019E */ "NameSpace\0" - /* 019F */ "NativeEventDispatcher\0" - /* 01A0 */ "NativeEventHandler\0" - /* 01A1 */ "NativeFileInfo\0" - /* 01A2 */ "NativeFileStream\0" - /* 01A3 */ "NativeFindFile\0" - /* 01A4 */ "NativeGetBaudRateBoundary\0" - /* 01A5 */ "NativeGetButtonPins\0" - /* 01A6 */ "NativeGetI2CPins\0" - /* 01A7 */ "NativeGetLCDMetrics\0" - /* 01A8 */ "NativeGetPinUsage\0" - /* 01A9 */ "NativeGetPinsCount\0" - /* 01AA */ "NativeGetPinsMap\0" - /* 01AB */ "NativeGetSerialPins\0" - /* 01AC */ "NativeGetSerialPortsCount\0" - /* 01AD */ "NativeGetSpiPins\0" - /* 01AE */ "NativeGetSpiPortsCount\0" - /* 01AF */ "NativeGetSupportedInterruptModes\0" - /* 01B0 */ "NativeGetSupportedResistorModes\0" - /* 01B1 */ "NativeIO\0" - /* 01B2 */ "NativeIsSupportedBaudRate\0" - /* 01B3 */ "NativeSupportsNonStandardBaudRate\0" - /* 01B4 */ "Native_Resources\0" - /* 01B5 */ "Negate\0" - /* 01B6 */ "NetworkStream\0" - /* 01B7 */ "NewGuid\0" - /* 01B8 */ "Next\0" - /* 01B9 */ "NormalizePath\0" - /* 01BA */ "NotImplementedException\0" - /* 01BB */ "NotSupportedException\0" - /* 01BC */ "NullReferenceException\0" - /* 01BD */ "Number\0" - /* 01BE */ "NumberFormatInfo\0" - /* 01BF */ "Object\0" - /* 01C0 */ "ObjectDisposedException\0" - /* 01C1 */ "OnCharger\0" - /* 01C2 */ "OnEvent\0" - /* 01C3 */ "Open\0" - /* 01C4 */ "OpenRead\0" - /* 01C5 */ "OpenWrite\0" - /* 01C6 */ "OutOfMemoryException\0" - /* 01C7 */ "OutputPort\0" - /* 01C8 */ "Parity\0" - /* 01C9 */ "Parse\0" - /* 01CA */ "ParseNextChar\0" - /* 01CB */ "ParseQuoteString\0" - /* 01CC */ "ParseRepeatPattern\0" - /* 01CD */ "Path\0" - /* 01CE */ "Peek\0" - /* 01CF */ "Piezo\0" - /* 01D0 */ "Pin\0" - /* 01D1 */ "PinUsage\0" - /* 01D2 */ "PinValidInterruptMode\0" - /* 01D3 */ "PinValidResistorMode\0" - /* 01D4 */ "Poll\0" - /* 01D5 */ "Port\0" - /* 01D6 */ "PostProcessFloat\0" - /* 01D7 */ "PostProcessInteger\0" - /* 01D8 */ "Pow\0" - /* 01D9 */ "Print\0" - /* 01DA */ "PriorityLevel\0" - /* 01DB */ "ProcessEvent\0" - /* 01DC */ "ProcessorArchitecture\0" - /* 01DD */ "PropertyInfo\0" - /* 01DE */ "ProtocolFamily\0" - /* 01DF */ "ProtocolType\0" - /* 01E0 */ "PushBackIntoRecoverList\0" - /* 01E1 */ "QueryDriver\0" - /* 01E2 */ "Raise\0" - /* 01E3 */ "Random\0" - /* 01E4 */ "Randomize\0" - /* 01E5 */ "RangeBias\0" - /* 01E6 */ "ReRegisterForFinalize\0" - /* 01E7 */ "Read\0" - /* 01E8 */ "ReadAllBytes\0" - /* 01E9 */ "ReadBlock\0" - /* 01EA */ "ReadByte\0" - /* 01EB */ "ReadBytes\0" - /* 01EC */ "ReadLine\0" - /* 01ED */ "ReadNonSeekableStream\0" - /* 01EE */ "ReadSeekableStream\0" - /* 01EF */ "ReadTemperature\0" - /* 01F0 */ "ReadToEnd\0" - /* 01F1 */ "ReadVoltage\0" - /* 01F2 */ "Receive\0" - /* 01F3 */ "ReceiveFrom\0" - /* 01F4 */ "Recover\0" - /* 01F5 */ "RecoverOrCreate\0" - /* 01F6 */ "ReferenceEquals\0" - /* 01F7 */ "Reflection\0" - /* 01F8 */ "Refresh\0" - /* 01F9 */ "RefreshIfNull\0" - /* 01FA */ "Register\0" - /* 01FB */ "RemotedException\0" - /* 01FC */ "RemotingServices\0" - /* 01FD */ "Remove\0" - /* 01FE */ "RemoveAt\0" - /* 01FF */ "RemoveEventFilter\0" - /* 0200 */ "RemoveEventListener\0" - /* 0201 */ "RemoveEventProcessor\0" - /* 0202 */ "RemoveFromOpenList\0" - /* 0203 */ "ReplaceDecimalSeperator\0" - /* 0204 */ "ReplaceNegativeSign\0" - /* 0205 */ "Reply\0" - /* 0206 */ "ReplyRaw\0" - /* 0207 */ "ReservePin\0" - /* 0208 */ "Reset\0" - /* 0209 */ "ResistorMode\0" - /* 020A */ "ResourceManager\0" - /* 020B */ "ResourceUtility\0" - /* 020C */ "Resume\0" - /* 020D */ "Round\0" - /* 020E */ "RunClassConstructor\0" - /* 020F */ "RuntimeArgumentHandle\0" - /* 0210 */ "RuntimeConstructorInfo\0" - /* 0211 */ "RuntimeFieldHandle\0" - /* 0212 */ "RuntimeFieldInfo\0" - /* 0213 */ "RuntimeHelpers\0" - /* 0214 */ "RuntimeMethodHandle\0" - /* 0215 */ "RuntimeMethodInfo\0" - /* 0216 */ "RuntimeType\0" - /* 0217 */ "RuntimeTypeHandle\0" - /* 0218 */ "SByte\0" - /* 0219 */ "SPI\0" - /* 021A */ "SPI_mod\0" - /* 021B */ "SPI_module\0" - /* 021C */ "SZArrayEnumerator\0" - /* 021D */ "Scale\0" - /* 021E */ "Second\0" - /* 021F */ "Seek\0" - /* 0220 */ "SeekOrigin\0" - /* 0221 */ "SelectMode\0" - /* 0222 */ "Send\0" - /* 0223 */ "SendMessage\0" - /* 0224 */ "SendMessageRaw\0" - /* 0225 */ "SendTo\0" - /* 0226 */ "Serial\0" - /* 0227 */ "SerialData\0" - /* 0228 */ "SerialDataReceivedEventArgs\0" - /* 0229 */ "SerialDataReceivedEventHandler\0" - /* 022A */ "SerialError\0" - /* 022B */ "SerialErrorReceivedEventArgs\0" - /* 022C */ "SerialErrorReceivedEventHandler\0" - /* 022D */ "SerialPortName\0" - /* 022E */ "SerializationFlags\0" - /* 022F */ "SerializationHintsAttribute\0" - /* 0230 */ "Serialize\0" - /* 0231 */ "Set\0" - /* 0232 */ "SetAttributes\0" - /* 0233 */ "SetCurrentDirectory\0" - /* 0234 */ "SetCurrentUICulture\0" - /* 0235 */ "SetLength\0" - /* 0236 */ "SetLocalTime\0" - /* 0237 */ "SetSocketOption\0" - /* 0238 */ "SetTimeOffset\0" - /* 0239 */ "SetTimeZone\0" - /* 023A */ "SetTimeZoneInfo\0" - /* 023B */ "SetValue\0" - /* 023C */ "Share\0" - /* 023D */ "Sin\0" - /* 023E */ "Single\0" - /* 023F */ "Size\0" - /* 0240 */ "Sleep\0" - /* 0241 */ "Socket\0" - /* 0242 */ "SocketAddress\0" - /* 0243 */ "SocketError\0" - /* 0244 */ "SocketException\0" - /* 0245 */ "SocketFlags\0" - /* 0246 */ "SocketNative\0" - /* 0247 */ "SocketOptionLevel\0" - /* 0248 */ "SocketOptionName\0" - /* 0249 */ "SocketType\0" - /* 024A */ "Source\0" - /* 024B */ "SpecifyKind\0" - /* 024C */ "Split\0" - /* 024D */ "StandardBias\0" - /* 024E */ "StandardDate\0" - /* 024F */ "StandardName\0" - /* 0250 */ "Start\0" - /* 0251 */ "StateOfCharge\0" - /* 0252 */ "StopBits\0" - /* 0253 */ "Stream\0" - /* 0254 */ "StreamReader\0" - /* 0255 */ "StreamWriter\0" - /* 0256 */ "String\0" - /* 0257 */ "StringResources\0" - /* 0258 */ "StylusEvent\0" - /* 0259 */ "Substring\0" - /* 025A */ "Subtract\0" - /* 025B */ "SupportsNonStandardBaudRate\0" - /* 025C */ "SuppressFinalize\0" - /* 025D */ "Suspend\0" - /* 025E */ "SynchronizeWithNetworkTime\0" - /* 025F */ "System\0" - /* 0260 */ "System.Collections\0" - /* 0261 */ "System.Collections.ICollection.get_Count\0" - /* 0262 */ "System.Collections.IList.Add\0" - /* 0263 */ "System.Collections.IList.Clear\0" - /* 0264 */ "System.Collections.IList.Contains\0" - /* 0265 */ "System.Collections.IList.IndexOf\0" - /* 0266 */ "System.Collections.IList.Insert\0" - /* 0267 */ "System.Collections.IList.Remove\0" - /* 0268 */ "System.Collections.IList.RemoveAt\0" - /* 0269 */ "System.Collections.IList.get_Item\0" - /* 026A */ "System.Collections.IList.set_Item\0" - /* 026B */ "System.ComponentModel\0" - /* 026C */ "System.Diagnostics\0" - /* 026D */ "System.Globalization\0" - /* 026E */ "System.Globalization.Resources\0" - /* 026F */ "System.IDisposable.Dispose\0" - /* 0270 */ "System.IO\0" - /* 0271 */ "System.IO.Ports\0" - /* 0272 */ "System.Net\0" - /* 0273 */ "System.Net.Sockets\0" - /* 0274 */ "System.Reflection\0" - /* 0275 */ "System.Resources\0" - /* 0276 */ "System.Runtime.CompilerServices\0" - /* 0277 */ "System.Runtime.Remoting\0" - /* 0278 */ "System.Text\0" - /* 0279 */ "System.Threading\0" - /* 027A */ "SystemException\0" - /* 027B */ "SystemID\0" - /* 027C */ "SystemInfo\0" - /* 027D */ "SystemTime\0" - /* 027E */ "TextReader\0" - /* 027F */ "TextWriter\0" - /* 0280 */ "Thread\0" - /* 0281 */ "ThreadAbortException\0" - /* 0282 */ "ThreadPriority\0" - /* 0283 */ "ThreadStart\0" - /* 0284 */ "ThreadState\0" - /* 0285 */ "Time\0" - /* 0286 */ "TimeEvents\0" - /* 0287 */ "TimeSpan\0" - /* 0288 */ "TimeZone\0" - /* 0289 */ "TimeZoneId\0" - /* 028A */ "TimeZoneInformation\0" - /* 028B */ "Timeout_Backlight\0" - /* 028C */ "Timeout_Charged\0" - /* 028D */ "Timeout_Charger\0" - /* 028E */ "Timeout_Charging\0" - /* 028F */ "Timer\0" - /* 0290 */ "TimerCallback\0" - /* 0291 */ "ToArray\0" - /* 0292 */ "ToByte\0" - /* 0293 */ "ToByteArray\0" - /* 0294 */ "ToChar\0" - /* 0295 */ "ToCharArray\0" - /* 0296 */ "ToDouble\0" - /* 0297 */ "ToInt16\0" - /* 0298 */ "ToInt32\0" - /* 0299 */ "ToInt64\0" - /* 029A */ "ToLocalTime\0" - /* 029B */ "ToLower\0" - /* 029C */ "ToSByte\0" - /* 029D */ "ToString\0" - /* 029E */ "ToUInt16\0" - /* 029F */ "ToUInt32\0" - /* 02A0 */ "ToUInt64\0" - /* 02A1 */ "ToUniversalTime\0" - /* 02A2 */ "ToUpper\0" - /* 02A3 */ "Trace\0" - /* 02A4 */ "Trim\0" - /* 02A5 */ "TrimEnd\0" - /* 02A6 */ "TrimStart\0" - /* 02A7 */ "TristatePort\0" - /* 02A8 */ "TrueString\0" - /* 02A9 */ "TrySZIndexOf\0" - /* 02AA */ "Type\0" - /* 02AB */ "TypeCode\0" - /* 02AC */ "UInt16\0" - /* 02AD */ "UInt32\0" - /* 02AE */ "UInt64\0" - /* 02AF */ "UTF8Decoder\0" - /* 02B0 */ "UTF8Encoding\0" - /* 02B1 */ "UnknownTypeException\0" - /* 02B2 */ "Unload\0" - /* 02B3 */ "Utility\0" - /* 02B4 */ "ValidateFormat\0" - /* 02B5 */ "ValidateNullOrEmpty\0" - /* 02B6 */ "ValueType\0" - /* 02B7 */ "VerifySignature\0" - /* 02B8 */ "Version\0" - /* 02B9 */ "Void\0" - /* 02BA */ "VolumeInformation\0" - /* 02BB */ "WaitAll\0" - /* 02BC */ "WaitAny\0" - /* 02BD */ "WaitForEvent\0" - /* 02BE */ "WaitForIdleCPU\0" - /* 02BF */ "WaitForPendingFinalizers\0" - /* 02C0 */ "WaitHandle\0" - /* 02C1 */ "WaitMultiple\0" - /* 02C2 */ "WaitOne\0" - /* 02C3 */ "WeakDelegate\0" - /* 02C4 */ "WeakReference\0" - /* 02C5 */ "Write\0" - /* 02C6 */ "WriteAllBytes\0" - /* 02C7 */ "WriteByte\0" - /* 02C8 */ "WriteBytes\0" - /* 02C9 */ "WriteLine\0" - /* 02CA */ "WriteRead\0" - /* 02CB */ "WriteTo\0" - /* 02CC */ "X\0" - /* 02CD */ "Y\0" - /* 02CE */ "Year\0" - /* 02CF */ "Zero\0" - /* 02D0 */ "_Build\0" - /* 02D1 */ "_Major\0" - /* 02D2 */ "_Minor\0" - /* 02D3 */ "_Revision\0" - /* 02D4 */ "__StaticArrayInitTypeSize=52\0" - /* 02D5 */ "__StaticArrayInitTypeSize=76\0" - /* 02D6 */ "_array\0" - /* 02D7 */ "_buffer\0" - /* 02D8 */ "_canRead\0" - /* 02D9 */ "_canSeek\0" - /* 02DA */ "_canWrite\0" - /* 02DB */ "_capacity\0" - /* 02DC */ "_currentDirectory\0" - /* 02DD */ "_disposed\0" - /* 02DE */ "_endIndex\0" - /* 02DF */ "_errorCode\0" - /* 02E0 */ "_eventInfoTable\0" - /* 02E1 */ "_eventSink\0" - /* 02E2 */ "_expandable\0" - /* 02E3 */ "_fileName\0" - /* 02E4 */ "_fileRecord\0" - /* 02E5 */ "_index\0" - /* 02E6 */ "_isOpen\0" - /* 02E7 */ "_items\0" - /* 02E8 */ "_length\0" - /* 02E9 */ "_message\0" - /* 02EA */ "_nativeFileInfo\0" - /* 02EB */ "_nativeFileStream\0" - /* 02EC */ "_origin\0" - /* 02ED */ "_ownsSocket\0" - /* 02EE */ "_position\0" - /* 02EF */ "_remoteEndPoint\0" - /* 02F0 */ "_seekLimit\0" - /* 02F1 */ "_size\0" - /* 02F2 */ "_socket\0" - /* 02F3 */ "_socketType\0" - /* 02F4 */ "_startIndex\0" - /* 02F5 */ "abbreviatedDayNames\0" - /* 02F6 */ "abbreviatedMonthNames\0" - /* 02F7 */ "accept\0" - /* 02F8 */ "add_OnInterrupt\0" - /* 02F9 */ "addressList\0" - /* 02FA */ "amDesignator\0" - /* 02FB */ "bind\0" - /* 02FC */ "close\0" - /* 02FD */ "connect\0" - /* 02FE */ "dateSeparator\0" - /* 02FF */ "dateTimeInfo\0" - /* 0300 */ "dayNames\0" - /* 0301 */ "fullDateTimePattern\0" - /* 0302 */ "generalLongTimePattern\0" - /* 0303 */ "get_AMDesignator\0" - /* 0304 */ "get_AbbreviatedDayNames\0" - /* 0305 */ "get_AbbreviatedMonthNames\0" - /* 0306 */ "get_Active\0" - /* 0307 */ "get_Address\0" - /* 0308 */ "get_AddressList\0" - /* 0309 */ "get_Assembly\0" - /* 030A */ "get_Attributes\0" - /* 030B */ "get_Available\0" - /* 030C */ "get_BaseStream\0" - /* 030D */ "get_BaseType\0" - /* 030E */ "get_Build\0" - /* 030F */ "get_CanRead\0" - /* 0310 */ "get_CanSeek\0" - /* 0311 */ "get_CanTimeout\0" - /* 0312 */ "get_CanWrite\0" - /* 0313 */ "get_Capacity\0" - /* 0314 */ "get_Chars\0" - /* 0315 */ "get_Config\0" - /* 0316 */ "get_Count\0" - /* 0317 */ "get_CreationTime\0" - /* 0318 */ "get_CreationTimeUtc\0" - /* 0319 */ "get_Current\0" - /* 031A */ "get_CurrentDomain\0" - /* 031B */ "get_CurrentEncoding\0" - /* 031C */ "get_CurrentInfo\0" - /* 031D */ "get_CurrentThread\0" - /* 031E */ "get_CurrentTimeZone\0" - /* 031F */ "get_CurrentUICulture\0" - /* 0320 */ "get_CurrentUICultureInternal\0" - /* 0321 */ "get_DataAvailable\0" - /* 0322 */ "get_Date\0" - /* 0323 */ "get_DateSeparator\0" - /* 0324 */ "get_DateTimeFormat\0" - /* 0325 */ "get_Day\0" - /* 0326 */ "get_DayNames\0" - /* 0327 */ "get_DayOfWeek\0" - /* 0328 */ "get_DayOfYear\0" - /* 0329 */ "get_DaylightName\0" - /* 032A */ "get_Days\0" - /* 032B */ "get_DeclaringType\0" - /* 032C */ "get_Delta\0" - /* 032D */ "get_Directory\0" - /* 032E */ "get_DirectoryName\0" - /* 032F */ "get_Encoding\0" - /* 0330 */ "get_End\0" - /* 0331 */ "get_EndOfStream\0" - /* 0332 */ "get_ErrorCode\0" - /* 0333 */ "get_EventType\0" - /* 0334 */ "get_Exists\0" - /* 0335 */ "get_Extension\0" - /* 0336 */ "get_Family\0" - /* 0337 */ "get_FieldType\0" - /* 0338 */ "get_Flags\0" - /* 0339 */ "get_FriendlyName\0" - /* 033A */ "get_FullDateTimePattern\0" - /* 033B */ "get_FullName\0" - /* 033C */ "get_GeneralLongTimePattern\0" - /* 033D */ "get_GlitchFilter\0" - /* 033E */ "get_GlitchFilterTime\0" - /* 033F */ "get_HostName\0" - /* 0340 */ "get_Hour\0" - /* 0341 */ "get_Hours\0" - /* 0342 */ "get_HwProvider\0" - /* 0343 */ "get_Id\0" - /* 0344 */ "get_InitialState\0" - /* 0345 */ "get_InnerException\0" - /* 0346 */ "get_Interrupt\0" - /* 0347 */ "get_IsAbstract\0" - /* 0348 */ "get_IsAlive\0" - /* 0349 */ "get_IsArray\0" - /* 034A */ "get_IsAsync\0" - /* 034B */ "get_IsAttached\0" - /* 034C */ "get_IsClass\0" - /* 034D */ "get_IsEnum\0" - /* 034E */ "get_IsFinal\0" - /* 034F */ "get_IsFixedSize\0" - /* 0350 */ "get_IsInterface\0" - /* 0351 */ "get_IsNeutralCulture\0" - /* 0352 */ "get_IsNotPublic\0" - /* 0353 */ "get_IsPublic\0" - /* 0354 */ "get_IsReadOnly\0" - /* 0355 */ "get_IsSerializable\0" - /* 0356 */ "get_IsStatic\0" - /* 0357 */ "get_IsSynchronized\0" - /* 0358 */ "get_IsValid\0" - /* 0359 */ "get_IsValueType\0" - /* 035A */ "get_IsVirtual\0" - /* 035B */ "get_Item\0" - /* 035C */ "get_Kind\0" - /* 035D */ "get_LastAccessTime\0" - /* 035E */ "get_LastAccessTimeUtc\0" - /* 035F */ "get_LastExpiration\0" - /* 0360 */ "get_LastWriteTime\0" - /* 0361 */ "get_LastWriteTimeUtc\0" - /* 0362 */ "get_Length\0" - /* 0363 */ "get_LocalEndPoint\0" - /* 0364 */ "get_LogicalVolumes\0" - /* 0365 */ "get_LongDatePattern\0" - /* 0366 */ "get_LongTimePattern\0" - /* 0367 */ "get_Major\0" - /* 0368 */ "get_MemberType\0" - /* 0369 */ "get_Message\0" - /* 036A */ "get_Method\0" - /* 036B */ "get_Millisecond\0" - /* 036C */ "get_Milliseconds\0" - /* 036D */ "get_Minor\0" - /* 036E */ "get_Minute\0" - /* 036F */ "get_Minutes\0" - /* 0370 */ "get_Model\0" - /* 0371 */ "get_Month\0" - /* 0372 */ "get_MonthDayPattern\0" - /* 0373 */ "get_MonthNames\0" - /* 0374 */ "get_Name\0" - /* 0375 */ "get_NegativeSign\0" - /* 0376 */ "get_NewLine\0" - /* 0377 */ "get_Now\0" - /* 0378 */ "get_NumberDecimalSeparator\0" - /* 0379 */ "get_NumberFormat\0" - /* 037A */ "get_NumberGroupSeparator\0" - /* 037B */ "get_NumberGroupSizes\0" - /* 037C */ "get_OEM\0" - /* 037D */ "get_OEMString\0" - /* 037E */ "get_OffsetToStringData\0" - /* 037F */ "get_PMDesignator\0" - /* 0380 */ "get_ParamName\0" - /* 0381 */ "get_Parent\0" - /* 0382 */ "get_Payload\0" - /* 0383 */ "get_PayloadRaw\0" - /* 0384 */ "get_Port\0" - /* 0385 */ "get_Position\0" - /* 0386 */ "get_PositiveSign\0" - /* 0387 */ "get_Priority\0" - /* 0388 */ "get_PropertyType\0" - /* 0389 */ "get_ReadTimeout\0" - /* 038A */ "get_ReceiveTimeout\0" - /* 038B */ "get_RemoteEndPoint\0" - /* 038C */ "get_Resistor\0" - /* 038D */ "get_ResourceManager\0" - /* 038E */ "get_ReturnType\0" - /* 038F */ "get_Revision\0" - /* 0390 */ "get_Root\0" - /* 0391 */ "get_SKU\0" - /* 0392 */ "get_Second\0" - /* 0393 */ "get_Seconds\0" - /* 0394 */ "get_Selector\0" - /* 0395 */ "get_SendTimeout\0" - /* 0396 */ "get_ShortDatePattern\0" - /* 0397 */ "get_ShortTimePattern\0" - /* 0398 */ "get_Signature\0" - /* 0399 */ "get_Size\0" - /* 039A */ "get_SlowClock\0" - /* 039B */ "get_StackTrace\0" - /* 039C */ "get_StandardName\0" - /* 039D */ "get_Start\0" - /* 039E */ "get_SyncRoot\0" - /* 039F */ "get_SystemClock\0" - /* 03A0 */ "get_Target\0" - /* 03A1 */ "get_ThreadState\0" - /* 03A2 */ "get_Ticks\0" - /* 03A3 */ "get_TimeOfDay\0" - /* 03A4 */ "get_TimeSeparator\0" - /* 03A5 */ "get_TimeZoneId\0" - /* 03A6 */ "get_Today\0" - /* 03A7 */ "get_UTF8\0" - /* 03A8 */ "get_UtcNow\0" - /* 03A9 */ "get_Version\0" - /* 03AA */ "get_WriteTimeout\0" - /* 03AB */ "get_Year\0" - /* 03AC */ "get_YearMonthPattern\0" - /* 03AD */ "getaddrinfo\0" - /* 03AE */ "getpeername\0" - /* 03AF */ "getsockname\0" - /* 03B0 */ "getsockopt\0" - /* 03B1 */ "hostName\0" - /* 03B2 */ "ioctl\0" - /* 03B3 */ "listen\0" - /* 03B4 */ "longDatePattern\0" - /* 03B5 */ "longTimePattern\0" - /* 03B6 */ "m_Address\0" - /* 03B7 */ "m_AppDomain\0" - /* 03B8 */ "m_Buffer\0" - /* 03B9 */ "m_Delegate\0" - /* 03BA */ "m_HResult\0" - /* 03BB */ "m_Handle\0" - /* 03BC */ "m_NativeEventDispatcher\0" - /* 03BD */ "m_Port\0" - /* 03BE */ "m_Priority\0" - /* 03BF */ "m_Thread\0" - /* 03C0 */ "m_appDomain\0" - /* 03C1 */ "m_assembly\0" - /* 03C2 */ "m_baseAssembly\0" - /* 03C3 */ "m_baseName\0" - /* 03C4 */ "m_buffer\0" - /* 03C5 */ "m_callback\0" - /* 03C6 */ "m_callbacks\0" - /* 03C7 */ "m_config\0" - /* 03C8 */ "m_cs\0" - /* 03C9 */ "m_cultureInfo\0" - /* 03CA */ "m_cultureName\0" - /* 03CB */ "m_curBufLen\0" - /* 03CC */ "m_curBufPos\0" - /* 03CD */ "m_data\0" - /* 03CE */ "m_delta\0" - /* 03CF */ "m_disposed\0" - /* 03D0 */ "m_doublyEncrypted\0" - /* 03D1 */ "m_end\0" - /* 03D2 */ "m_error\0" - /* 03D3 */ "m_exponent\0" - /* 03D4 */ "m_fBlocking\0" - /* 03D5 */ "m_flags\0" - /* 03D6 */ "m_friendlyName\0" - /* 03D7 */ "m_fullPath\0" - /* 03D8 */ "m_glitchFilterEnable\0" - /* 03D9 */ "m_handle\0" - /* 03DA */ "m_hash\0" - /* 03DB */ "m_id\0" - /* 03DC */ "m_illegalCharacters\0" - /* 03DD */ "m_initialState\0" - /* 03DE */ "m_innerException\0" - /* 03DF */ "m_interruptMode\0" - /* 03E0 */ "m_localEndPoint\0" - /* 03E1 */ "m_message\0" - /* 03E2 */ "m_modulus\0" - /* 03E3 */ "m_name\0" - /* 03E4 */ "m_openFiles\0" - /* 03E5 */ "m_paramName\0" - /* 03E6 */ "m_parent\0" - /* 03E7 */ "m_payload\0" - /* 03E8 */ "m_portId\0" - /* 03E9 */ "m_recvTimeout\0" - /* 03EA */ "m_refs\0" - /* 03EB */ "m_resistorMode\0" - /* 03EC */ "m_resourceFileId\0" - /* 03ED */ "m_rm\0" - /* 03EE */ "m_rmFallback\0" - /* 03EF */ "m_selector\0" - /* 03F0 */ "m_sendTimeout\0" - /* 03F1 */ "m_seq\0" - /* 03F2 */ "m_size\0" - /* 03F3 */ "m_source\0" - /* 03F4 */ "m_stackTrace\0" - /* 03F5 */ "m_start\0" - /* 03F6 */ "m_state\0" - /* 03F7 */ "m_stream\0" - /* 03F8 */ "m_threadSpawn\0" - /* 03F9 */ "m_ticks\0" - /* 03FA */ "m_timer\0" - /* 03FB */ "m_type\0" - /* 03FC */ "m_value\0" - /* 03FD */ "m_xAction\0" - /* 03FE */ "manager\0" - /* 03FF */ "monthDayPattern\0" - /* 0400 */ "monthNames\0" - /* 0401 */ "mscorlib\0" - /* 0402 */ "negativeSign\0" - /* 0403 */ "numInfo\0" - /* 0404 */ "numberDecimalSeparator\0" - /* 0405 */ "numberGroupSeparator\0" - /* 0406 */ "numberGroupSizes\0" - /* 0407 */ "op_Addition\0" - /* 0408 */ "op_Equality\0" - /* 0409 */ "op_GreaterThan\0" - /* 040A */ "op_GreaterThanOrEqual\0" - /* 040B */ "op_Inequality\0" - /* 040C */ "op_LessThan\0" - /* 040D */ "op_LessThanOrEqual\0" - /* 040E */ "op_Subtraction\0" - /* 040F */ "op_UnaryNegation\0" - /* 0410 */ "op_UnaryPlus\0" - /* 0411 */ "pmDesignator\0" - /* 0412 */ "poll\0" - /* 0413 */ "positiveSign\0" - /* 0414 */ "recv\0" - /* 0415 */ "recvfrom\0" - /* 0416 */ "remove_OnInterrupt\0" - /* 0417 */ "s_ewr\0" - /* 0418 */ "s_hwProvider\0" - /* 0419 */ "s_utf8Encoding\0" - /* 041A */ "send\0" - /* 041B */ "sendto\0" - /* 041C */ "set_Active\0" - /* 041D */ "set_Capacity\0" - /* 041E */ "set_Config\0" - /* 041F */ "set_CurrentUICultureInternal\0" - /* 0420 */ "set_GlitchFilter\0" - /* 0421 */ "set_GlitchFilterTime\0" - /* 0422 */ "set_Interrupt\0" - /* 0423 */ "set_Item\0" - /* 0424 */ "set_NewLine\0" - /* 0425 */ "set_Position\0" - /* 0426 */ "set_Priority\0" - /* 0427 */ "set_ReadTimeout\0" - /* 0428 */ "set_ReceiveTimeout\0" - /* 0429 */ "set_Resistor\0" - /* 042A */ "set_SendTimeout\0" - /* 042B */ "set_Target\0" - /* 042C */ "set_WriteTimeout\0" - /* 042D */ "setsockopt\0" - /* 042E */ "shortDatePattern\0" - /* 042F */ "shortTimePattern\0" - /* 0430 */ "socket\0" - /* 0431 */ "timeSeparator\0" - /* 0432 */ "value__\0" - /* 0433 */ "yearMonthPattern\0" - -/*****/"Copyright\0" -/*****/"�2001,2002,2003\0" -/*****/"Microsoft Corp\0" -/*****/"1 Microsoft Way\0" -/*****/"Redmond, WA\0" -/*****/"98052-6399\0" -/*****/"U.S.A.\0" -/*****/"All rights reserved.\0" -/*****/"MICROSOFT CONFIDENTIAL" -; - - +#include "StringTableData.cpp" //////////////////////////////////////////////////////////////////////////////////////////////////// -#if defined(TINYCLR_CREATE_STRINGTABLE) -#if !defined(BIG_ENDIAN) -void CLR_RT_Assembly::InitString() -{ - NATIVE_PROFILE_CLR_CORE(); - CLR_STRING* dst = c_CLR_StringTable_Lookup; - LPCSTR src = c_CLR_StringTable_Data; - size_t len = c_CLR_StringTable_Size; - size_t offset = 0; - - while(len-- > 0) - { - size_t strLen = hal_strlen_s( src ) + 1; - - *dst++ = (CLR_STRING)offset; - - offset += strLen; - src += strLen; - } -} -#else - void CLR_RT_Assembly::InitString() { NATIVE_PROFILE_CLR_CORE(); - CLR_STRING* dst = c_CLR_StringTable_Lookup; - LPCSTR src = c_CLR_StringTable_Data; - size_t len = c_CLR_StringTable_Size; - size_t offset = 0; - - while(len-- > 0) - { - size_t strLen = hal_strlen_s( src ) + 1; - - *dst++ = (CLR_STRING)offset; - - offset += strLen; - src += strLen; - } } -#endif - -#else - -void CLR_RT_Assembly::InitString() -{ - NATIVE_PROFILE_CLR_CORE(); -} - -#endif - LPCSTR CLR_RT_Assembly::GetString( CLR_STRING i ) { NATIVE_PROFILE_CLR_CORE(); diff --git a/CLR/Core/StringTableData.cpp b/CLR/Core/StringTableData.cpp new file mode 100644 index 000000000..49e705eb2 --- /dev/null +++ b/CLR/Core/StringTableData.cpp @@ -0,0 +1,1736 @@ +// +// The StringTable was generated from the following +// specified in Microsoft.SPOT.Support.Settings: +// +// Microsoft.SPOT.Native.strings +// mscorlib.strings +// + +const size_t c_CLR_StringTable_Size = 860; + +const CLR_STRING c_CLR_StringTable_Lookup[] = +{ + /* 0000 */ 0, + /* 0001 */ 7, + /* 0002 */ 13, + /* 0003 */ 19, + /* 0004 */ 23, + /* 0005 */ 56, + /* 0006 */ 61, + /* 0007 */ 65, + /* 0008 */ 73, + /* 0009 */ 82, + /* 000A */ 98, + /* 000B */ 109, + /* 000C */ 120, + /* 000D */ 129, + /* 000E */ 150, + /* 000F */ 160, + /* 0010 */ 187, + /* 0011 */ 194, + /* 0012 */ 207, + /* 0013 */ 218, + /* 0014 */ 238, + /* 0015 */ 259, + /* 0016 */ 277, + /* 0017 */ 299, + /* 0018 */ 327, + /* 0019 */ 337, + /* 001A */ 343, + /* 001B */ 353, + /* 001C */ 363, + /* 001D */ 368, + /* 001E */ 377, + /* 001F */ 390, + /* 0020 */ 409, + /* 0021 */ 422, + /* 0022 */ 440, + /* 0023 */ 452, + /* 0024 */ 472, + /* 0025 */ 479, + /* 0026 */ 493, + /* 0027 */ 498, + /* 0028 */ 504, + /* 0029 */ 514, + /* 002A */ 525, + /* 002B */ 544, + /* 002C */ 559, + /* 002D */ 569, + /* 002E */ 579, + /* 002F */ 591, + /* 0030 */ 596, + /* 0031 */ 609, + /* 0032 */ 616, + /* 0033 */ 629, + /* 0034 */ 642, + /* 0035 */ 652, + /* 0036 */ 660, + /* 0037 */ 666, + /* 0038 */ 671, + /* 0039 */ 680, + /* 003A */ 688, + /* 003B */ 695, + /* 003C */ 700, + /* 003D */ 706, + /* 003E */ 712, + /* 003F */ 718, + /* 0040 */ 724, + /* 0041 */ 732, + /* 0042 */ 746, + /* 0043 */ 754, + /* 0044 */ 770, + /* 0045 */ 780, + /* 0046 */ 791, + /* 0047 */ 798, + /* 0048 */ 818, + /* 0049 */ 834, + /* 004A */ 848, + /* 004B */ 861, + /* 004C */ 870, + /* 004D */ 878, + /* 004E */ 883, + /* 004F */ 890, + /* 0050 */ 907, + /* 0051 */ 911, + /* 0052 */ 916, + /* 0053 */ 929, + /* 0054 */ 944, + /* 0055 */ 968, + /* 0056 */ 980, + /* 0057 */ 993, + /* 0058 */ 1015, + /* 0059 */ 1024, + /* 005A */ 1039, + /* 005B */ 1058, + /* 005C */ 1071, + /* 005D */ 1075, + /* 005E */ 1085, + /* 005F */ 1098, + /* 0060 */ 1111, + /* 0061 */ 1124, + /* 0062 */ 1137, + /* 0063 */ 1149, + /* 0064 */ 1155, + /* 0065 */ 1175, + /* 0066 */ 1184, + /* 0067 */ 1199, + /* 0068 */ 1207, + /* 0069 */ 1217, + /* 006A */ 1226, + /* 006B */ 1234, + /* 006C */ 1246, + /* 006D */ 1262, + /* 006E */ 1270, + /* 006F */ 1277, + /* 0070 */ 1295, + /* 0071 */ 1304, + /* 0072 */ 1325, + /* 0073 */ 1331, + /* 0074 */ 1348, + /* 0075 */ 1357, + /* 0076 */ 1367, + /* 0077 */ 1376, + /* 0078 */ 1384, + /* 0079 */ 1399, + /* 007A */ 1425, + /* 007B */ 1446, + /* 007C */ 1452, + /* 007D */ 1458, + /* 007E */ 1470, + /* 007F */ 1475, + /* 0080 */ 1490, + /* 0081 */ 1497, + /* 0082 */ 1507, + /* 0083 */ 1521, + /* 0084 */ 1531, + /* 0085 */ 1544, + /* 0086 */ 1554, + /* 0087 */ 1563, + /* 0088 */ 1583, + /* 0089 */ 1588, + /* 008A */ 1592, + /* 008B */ 1607, + /* 008C */ 1621, + /* 008D */ 1643, + /* 008E */ 1662, + /* 008F */ 1684, + /* 0090 */ 1706, + /* 0091 */ 1718, + /* 0092 */ 1727, + /* 0093 */ 1744, + /* 0094 */ 1754, + /* 0095 */ 1763, + /* 0096 */ 1780, + /* 0097 */ 1789, + /* 0098 */ 1807, + /* 0099 */ 1820, + /* 009A */ 1826, + /* 009B */ 1832, + /* 009C */ 1838, + /* 009D */ 1847, + /* 009E */ 1854, + /* 009F */ 1871, + /* 00A0 */ 1884, + /* 00A1 */ 1897, + /* 00A2 */ 1917, + /* 00A3 */ 1934, + /* 00A4 */ 1944, + /* 00A5 */ 1947, + /* 00A6 */ 1960, + /* 00A7 */ 1968, + /* 00A8 */ 1982, + /* 00A9 */ 1994, + /* 00AA */ 2014, + /* 00AB */ 2030, + /* 00AC */ 2046, + /* 00AD */ 2068, + /* 00AE */ 2091, + /* 00AF */ 2100, + /* 00B0 */ 2109, + /* 00B1 */ 2124, + /* 00B2 */ 2136, + /* 00B3 */ 2155, + /* 00B4 */ 2166, + /* 00B5 */ 2193, + /* 00B6 */ 2221, + /* 00B7 */ 2231, + /* 00B8 */ 2247, + /* 00B9 */ 2264, + /* 00BA */ 2279, + /* 00BB */ 2293, + /* 00BC */ 2314, + /* 00BD */ 2332, + /* 00BE */ 2341, + /* 00BF */ 2351, + /* 00C0 */ 2361, + /* 00C1 */ 2373, + /* 00C2 */ 2387, + /* 00C3 */ 2402, + /* 00C4 */ 2427, + /* 00C5 */ 2438, + /* 00C6 */ 2448, + /* 00C7 */ 2459, + /* 00C8 */ 2467, + /* 00C9 */ 2477, + /* 00CA */ 2498, + /* 00CB */ 2514, + /* 00CC */ 2532, + /* 00CD */ 2547, + /* 00CE */ 2568, + /* 00CF */ 2580, + /* 00D0 */ 2595, + /* 00D1 */ 2609, + /* 00D2 */ 2630, + /* 00D3 */ 2640, + /* 00D4 */ 2657, + /* 00D5 */ 2675, + /* 00D6 */ 2683, + /* 00D7 */ 2701, + /* 00D8 */ 2717, + /* 00D9 */ 2729, + /* 00DA */ 2745, + /* 00DB */ 2754, + /* 00DC */ 2784, + /* 00DD */ 2797, + /* 00DE */ 2806, + /* 00DF */ 2817, + /* 00E0 */ 2847, + /* 00E1 */ 2852, + /* 00E2 */ 2857, + /* 00E3 */ 2867, + /* 00E4 */ 2887, + /* 00E5 */ 2897, + /* 00E6 */ 2902, + /* 00E7 */ 2915, + /* 00E8 */ 2926, + /* 00E9 */ 2938, + /* 00EA */ 2950, + /* 00EB */ 2960, + /* 00EC */ 2977, + /* 00ED */ 2989, + /* 00EE */ 3001, + /* 00EF */ 3015, + /* 00F0 */ 3027, + /* 00F1 */ 3039, + /* 00F2 */ 3057, + /* 00F3 */ 3072, + /* 00F4 */ 3088, + /* 00F5 */ 3104, + /* 00F6 */ 3117, + /* 00F7 */ 3123, + /* 00F8 */ 3128, + /* 00F9 */ 3140, + /* 00FA */ 3161, + /* 00FB */ 3170, + /* 00FC */ 3180, + /* 00FD */ 3188, + /* 00FE */ 3199, + /* 00FF */ 3224, + /* 0100 */ 3235, + /* 0101 */ 3251, + /* 0102 */ 3276, + /* 0103 */ 3296, + /* 0104 */ 3303, + /* 0105 */ 3325, + /* 0106 */ 3346, + /* 0107 */ 3354, + /* 0108 */ 3360, + /* 0109 */ 3366, + /* 010A */ 3372, + /* 010B */ 3390, + /* 010C */ 3397, + /* 010D */ 3409, + /* 010E */ 3416, + /* 010F */ 3437, + /* 0110 */ 3463, + /* 0111 */ 3470, + /* 0112 */ 3483, + /* 0113 */ 3504, + /* 0114 */ 3515, + /* 0115 */ 3526, + /* 0116 */ 3543, + /* 0117 */ 3554, + /* 0118 */ 3560, + /* 0119 */ 3579, + /* 011A */ 3598, + /* 011B */ 3611, + /* 011C */ 3630, + /* 011D */ 3643, + /* 011E */ 3648, + /* 011F */ 3652, + /* 0120 */ 3666, + /* 0121 */ 3678, + /* 0122 */ 3693, + /* 0123 */ 3698, + /* 0124 */ 3711, + /* 0125 */ 3715, + /* 0126 */ 3721, + /* 0127 */ 3730, + /* 0128 */ 3747, + /* 0129 */ 3766, + /* 012A */ 3771, + /* 012B */ 3775, + /* 012C */ 3784, + /* 012D */ 3795, + /* 012E */ 3807, + /* 012F */ 3823, + /* 0130 */ 3831, + /* 0131 */ 3844, + /* 0132 */ 3855, + /* 0133 */ 3865, + /* 0134 */ 3883, + /* 0135 */ 3894, + /* 0136 */ 3904, + /* 0137 */ 3922, + /* 0138 */ 3937, + /* 0139 */ 3961, + /* 013A */ 3986, + /* 013B */ 4007, + /* 013C */ 4020, + /* 013D */ 4024, + /* 013E */ 4033, + /* 013F */ 4040, + /* 0140 */ 4048, + /* 0141 */ 4054, + /* 0142 */ 4063, + /* 0143 */ 4081, + /* 0144 */ 4098, + /* 0145 */ 4105, + /* 0146 */ 4113, + /* 0147 */ 4118, + /* 0148 */ 4128, + /* 0149 */ 4139, + /* 014A */ 4163, + /* 014B */ 4185, + /* 014C */ 4208, + /* 014D */ 4215, + /* 014E */ 4232, + /* 014F */ 4239, + /* 0150 */ 4263, + /* 0151 */ 4271, + /* 0152 */ 4292, + /* 0153 */ 4298, + /* 0154 */ 4316, + /* 0155 */ 4333, + /* 0156 */ 4347, + /* 0157 */ 4364, + /* 0158 */ 4383, + /* 0159 */ 4397, + /* 015A */ 4402, + /* 015B */ 4408, + /* 015C */ 4412, + /* 015D */ 4429, + /* 015E */ 4448, + /* 015F */ 4452, + /* 0160 */ 4458, + /* 0161 */ 4472, + /* 0162 */ 4485, + /* 0163 */ 4507, + /* 0164 */ 4520, + /* 0165 */ 4525, + /* 0166 */ 4549, + /* 0167 */ 4555, + /* 0168 */ 4561, + /* 0169 */ 4569, + /* 016A */ 4576, + /* 016B */ 4586, + /* 016C */ 4608, + /* 016D */ 4613, + /* 016E */ 4622, + /* 016F */ 4630, + /* 0170 */ 4646, + /* 0171 */ 4662, + /* 0172 */ 4673, + /* 0173 */ 4680, + /* 0174 */ 4697, + /* 0175 */ 4714, + /* 0176 */ 4721, + /* 0177 */ 4730, + /* 0178 */ 4738, + /* 0179 */ 4756, + /* 017A */ 4780, + /* 017B */ 4802, + /* 017C */ 4822, + /* 017D */ 4828, + /* 017E */ 4837, + /* 017F */ 4843, + /* 0180 */ 4859, + /* 0181 */ 4875, + /* 0182 */ 4885, + /* 0183 */ 4899, + /* 0184 */ 4917, + /* 0185 */ 4932, + /* 0186 */ 4955, + /* 0187 */ 4962, + /* 0188 */ 4970, + /* 0189 */ 4976, + /* 018A */ 4996, + /* 018B */ 5018, + /* 018C */ 5041, + /* 018D */ 5060, + /* 018E */ 5077, + /* 018F */ 5092, + /* 0190 */ 5112, + /* 0191 */ 5130, + /* 0192 */ 5142, + /* 0193 */ 5160, + /* 0194 */ 5166, + /* 0195 */ 5184, + /* 0196 */ 5190, + /* 0197 */ 5197, + /* 0198 */ 5202, + /* 0199 */ 5213, + /* 019A */ 5225, + /* 019B */ 5240, + /* 019C */ 5259, + /* 019D */ 5287, + /* 019E */ 5297, + /* 019F */ 5301, + /* 01A0 */ 5313, + /* 01A1 */ 5333, + /* 01A2 */ 5343, + /* 01A3 */ 5356, + /* 01A4 */ 5365, + /* 01A5 */ 5370, + /* 01A6 */ 5381, + /* 01A7 */ 5385, + /* 01A8 */ 5392, + /* 01A9 */ 5397, + /* 01AA */ 5403, + /* 01AB */ 5410, + /* 01AC */ 5419, + /* 01AD */ 5431, + /* 01AE */ 5437, + /* 01AF */ 5442, + /* 01B0 */ 5448, + /* 01B1 */ 5461, + /* 01B2 */ 5474, + /* 01B3 */ 5487, + /* 01B4 */ 5493, + /* 01B5 */ 5504, + /* 01B6 */ 5517, + /* 01B7 */ 5524, + /* 01B8 */ 5531, + /* 01B9 */ 5545, + /* 01BA */ 5561, + /* 01BB */ 5569, + /* 01BC */ 5579, + /* 01BD */ 5588, + /* 01BE */ 5605, + /* 01BF */ 5613, + /* 01C0 */ 5620, + /* 01C1 */ 5639, + /* 01C2 */ 5680, + /* 01C3 */ 5709, + /* 01C4 */ 5740, + /* 01C5 */ 5774, + /* 01C6 */ 5807, + /* 01C7 */ 5839, + /* 01C8 */ 5871, + /* 01C9 */ 5905, + /* 01CA */ 5939, + /* 01CB */ 5973, + /* 01CC */ 5995, + /* 01CD */ 6014, + /* 01CE */ 6035, + /* 01CF */ 6066, + /* 01D0 */ 6076, + /* 01D1 */ 6094, + /* 01D2 */ 6111, + /* 01D3 */ 6143, + /* 01D4 */ 6167, + /* 01D5 */ 6193, + /* 01D6 */ 6239, + /* 01D7 */ 6251, + /* 01D8 */ 6268, + /* 01D9 */ 6284, + /* 01DA */ 6293, + /* 01DB */ 6304, + /* 01DC */ 6315, + /* 01DD */ 6319, + /* 01DE */ 6324, + /* 01DF */ 6331, + /* 01E0 */ 6356, + /* 01E1 */ 6363, + /* 01E2 */ 6384, + /* 01E3 */ 6399, + /* 01E4 */ 6411, + /* 01E5 */ 6423, + /* 01E6 */ 6428, + /* 01E7 */ 6439, + /* 01E8 */ 6448, + /* 01E9 */ 6458, + /* 01EA */ 6467, + /* 01EB */ 6478, + /* 01EC */ 6498, + /* 01ED */ 6504, + /* 01EE */ 6518, + /* 01EF */ 6528, + /* 01F0 */ 6536, + /* 01F1 */ 6551, + /* 01F2 */ 6561, + /* 01F3 */ 6568, + /* 01F4 */ 6580, + /* 01F5 */ 6587, + /* 01F6 */ 6599, + /* 01F7 */ 6608, + /* 01F8 */ 6616, + /* 01F9 */ 6624, + /* 01FA */ 6632, + /* 01FB */ 6644, + /* 01FC */ 6652, + /* 01FD */ 6660, + /* 01FE */ 6669, + /* 01FF */ 6678, + /* 0200 */ 6687, + /* 0201 */ 6696, + /* 0202 */ 6705, + /* 0203 */ 6721, + /* 0204 */ 6729, + /* 0205 */ 6740, + /* 0206 */ 6753, + /* 0207 */ 6775, + /* 0208 */ 6800, + /* 0209 */ 6811, + /* 020A */ 6827, + /* 020B */ 6841, + /* 020C */ 6862, + /* 020D */ 6886, + /* 020E */ 6894, + /* 020F */ 6900, + /* 0210 */ 6905, + /* 0211 */ 6913, + /* 0212 */ 6923, + /* 0213 */ 6934, + /* 0214 */ 6943, + /* 0215 */ 6952, + /* 0216 */ 6965, + /* 0217 */ 6970, + /* 0218 */ 6979, + /* 0219 */ 6987, + /* 021A */ 7003, + /* 021B */ 7011, + /* 021C */ 7027, + /* 021D */ 7036, + /* 021E */ 7053, + /* 021F */ 7060, + /* 0220 */ 7067, + /* 0221 */ 7074, + /* 0222 */ 7086, + /* 0223 */ 7099, + /* 0224 */ 7120, + /* 0225 */ 7127, + /* 0226 */ 7135, + /* 0227 */ 7150, + /* 0228 */ 7156, + /* 0229 */ 7172, + /* 022A */ 7182, + /* 022B */ 7190, + /* 022C */ 7195, + /* 022D */ 7203, + /* 022E */ 7211, + /* 022F */ 7236, + /* 0230 */ 7247, + /* 0231 */ 7260, + /* 0232 */ 7268, + /* 0233 */ 7281, + /* 0234 */ 7295, + /* 0235 */ 7301, + /* 0236 */ 7311, + /* 0237 */ 7313, + /* 0238 */ 7329, + /* 0239 */ 7331, + /* 023A */ 7336, + /* 023B */ 7341, + /* 023C */ 7348, + /* 023D */ 7355, + /* 023E */ 7362, + /* 023F */ 7372, + /* 0240 */ 7379, + /* 0241 */ 7392, + /* 0242 */ 7402, + /* 0243 */ 7411, + /* 0244 */ 7418, + /* 0245 */ 7428, + /* 0246 */ 7450, + /* 0247 */ 7465, + /* 0248 */ 7479, + /* 0249 */ 7485, + /* 024A */ 7492, + /* 024B */ 7499, + /* 024C */ 7511, + /* 024D */ 7526, + /* 024E */ 7535, + /* 024F */ 7552, + /* 0250 */ 7560, + /* 0251 */ 7566, + /* 0252 */ 7578, + /* 0253 */ 7584, + /* 0254 */ 7604, + /* 0255 */ 7626, + /* 0256 */ 7639, + /* 0257 */ 7653, + /* 0258 */ 7666, + /* 0259 */ 7675, + /* 025A */ 7695, + /* 025B */ 7718, + /* 025C */ 7742, + /* 025D */ 7759, + /* 025E */ 7783, + /* 025F */ 7809, + /* 0260 */ 7819, + /* 0261 */ 7832, + /* 0262 */ 7858, + /* 0263 */ 7871, + /* 0264 */ 7881, + /* 0265 */ 7893, + /* 0266 */ 7905, + /* 0267 */ 7920, + /* 0268 */ 7933, + /* 0269 */ 7946, + /* 026A */ 7956, + /* 026B */ 7966, + /* 026C */ 7978, + /* 026D */ 7996, + /* 026E */ 8012, + /* 026F */ 8030, + /* 0270 */ 8050, + /* 0271 */ 8071, + /* 0272 */ 8100, + /* 0273 */ 8109, + /* 0274 */ 8127, + /* 0275 */ 8146, + /* 0276 */ 8154, + /* 0277 */ 8167, + /* 0278 */ 8181, + /* 0279 */ 8195, + /* 027A */ 8212, + /* 027B */ 8221, + /* 027C */ 8239, + /* 027D */ 8249, + /* 027E */ 8257, + /* 027F */ 8271, + /* 0280 */ 8285, + /* 0281 */ 8295, + /* 0282 */ 8320, + /* 0283 */ 8338, + /* 0284 */ 8355, + /* 0285 */ 8379, + /* 0286 */ 8392, + /* 0287 */ 8419, + /* 0288 */ 8447, + /* 0289 */ 8464, + /* 028A */ 8473, + /* 028B */ 8483, + /* 028C */ 8490, + /* 028D */ 8509, + /* 028E */ 8524, + /* 028F */ 8536, + /* 0290 */ 8548, + /* 0291 */ 8563, + /* 0292 */ 8579, + /* 0293 */ 8591, + /* 0294 */ 8602, + /* 0295 */ 8614, + /* 0296 */ 8630, + /* 0297 */ 8646, + /* 0298 */ 8665, + /* 0299 */ 8681, + /* 029A */ 8694, + /* 029B */ 8709, + /* 029C */ 8728, + /* 029D */ 8741, + /* 029E */ 8760, + /* 029F */ 8772, + /* 02A0 */ 8788, + /* 02A1 */ 8802, + /* 02A2 */ 8813, + /* 02A3 */ 8822, + /* 02A4 */ 8831, + /* 02A5 */ 8840, + /* 02A6 */ 8859, + /* 02A7 */ 8870, + /* 02A8 */ 8890, + /* 02A9 */ 8910, + /* 02AA */ 8920, + /* 02AB */ 8940, + /* 02AC */ 8956, + /* 02AD */ 8974, + /* 02AE */ 8989, + /* 02AF */ 9001, + /* 02B0 */ 9012, + /* 02B1 */ 9028, + /* 02B2 */ 9045, + /* 02B3 */ 9055, + /* 02B4 */ 9066, + /* 02B5 */ 9078, + /* 02B6 */ 9088, + /* 02B7 */ 9098, + /* 02B8 */ 9118, + /* 02B9 */ 9133, + /* 02BA */ 9142, + /* 02BB */ 9159, + /* 02BC */ 9167, + /* 02BD */ 9194, + /* 02BE */ 9211, + /* 02BF */ 9236, + /* 02C0 */ 9257, + /* 02C1 */ 9265, + /* 02C2 */ 9279, + /* 02C3 */ 9302, + /* 02C4 */ 9319, + /* 02C5 */ 9333, + /* 02C6 */ 9344, + /* 02C7 */ 9356, + /* 02C8 */ 9371, + /* 02C9 */ 9384, + /* 02CA */ 9401, + /* 02CB */ 9414, + /* 02CC */ 9431, + /* 02CD */ 9448, + /* 02CE */ 9467, + /* 02CF */ 9483, + /* 02D0 */ 9503, + /* 02D1 */ 9518, + /* 02D2 */ 9531, + /* 02D3 */ 9539, + /* 02D4 */ 9550, + /* 02D5 */ 9562, + /* 02D6 */ 9575, + /* 02D7 */ 9596, + /* 02D8 */ 9617, + /* 02D9 */ 9645, + /* 02DA */ 9660, + /* 02DB */ 9677, + /* 02DC */ 9687, + /* 02DD */ 9699, + /* 02DE */ 9712, + /* 02DF */ 9723, + /* 02E0 */ 9739, + /* 02E1 */ 9749, + /* 02E2 */ 9763, + /* 02E3 */ 9781, + /* 02E4 */ 9791, + /* 02E5 */ 9800, + /* 02E6 */ 9837, + /* 02E7 */ 9860, + /* 02E8 */ 9871, + /* 02E9 */ 9882, + /* 02EA */ 9894, + /* 02EB */ 9911, + /* 02EC */ 9920, + /* 02ED */ 9941, + /* 02EE */ 9944, + /* 02EF */ 9950, + /* 02F0 */ 9954, + /* 02F1 */ 9970, + /* 02F2 */ 9986, + /* 02F3 */ 9998, + /* 02F4 */ 10011, + /* 02F5 */ 10025, + /* 02F6 */ 10039, + /* 02F7 */ 10055, + /* 02F8 */ 10066, + /* 02F9 */ 10076, + /* 02FA */ 10081, + /* 02FB */ 10095, + /* 02FC */ 10106, + /* 02FD */ 10115, + /* 02FE */ 10127, + /* 02FF */ 10138, + /* 0300 */ 10153, + /* 0301 */ 10164, + /* 0302 */ 10175, + /* 0303 */ 10189, + /* 0304 */ 10203, + /* 0305 */ 10217, + /* 0306 */ 10224, + /* 0307 */ 10232, + /* 0308 */ 10248, + /* 0309 */ 10254, + /* 030A */ 10271, + /* 030B */ 10279, + /* 030C */ 10294, + /* 030D */ 10303, + /* 030E */ 10310, + /* 030F */ 10315, + /* 0310 */ 10332, + /* 0311 */ 10341, + /* 0312 */ 10351, + /* 0313 */ 10358, + /* 0314 */ 10370, + /* 0315 */ 10379, + /* 0316 */ 10390, + /* 0317 */ 10400, + /* 0318 */ 10407, + /* 0319 */ 10414, + /* 031A */ 10431, + /* 031B */ 10436, + /* 031C */ 10449, + /* 031D */ 10460, + /* 031E */ 10466, + /* 031F */ 10482, + /* 0320 */ 10489, + /* 0321 */ 10498, + /* 0322 */ 10511, + /* 0323 */ 10519, + /* 0324 */ 10527, + /* 0325 */ 10537, + /* 0326 */ 10545, + /* 0327 */ 10559, + /* 0328 */ 10567, + /* 0329 */ 10574, + /* 032A */ 10582, + /* 032B */ 10590, + /* 032C */ 10606, + /* 032D */ 10617, + /* 032E */ 10626, + /* 032F */ 10639, + /* 0330 */ 10644, + /* 0331 */ 10652, + /* 0332 */ 10675, + /* 0333 */ 10696, + /* 0334 */ 10713, + /* 0335 */ 10725, + /* 0336 */ 10737, + /* 0337 */ 10752, + /* 0338 */ 10774, + /* 0339 */ 10788, + /* 033A */ 10800, + /* 033B */ 10819, + /* 033C */ 10834, + /* 033D */ 10851, + /* 033E */ 10864, + /* 033F */ 10877, + /* 0340 */ 10890, + /* 0341 */ 10903, + /* 0342 */ 10914, + /* 0343 */ 10920, + /* 0344 */ 10938, + /* 0345 */ 10959, + /* 0346 */ 10987, + /* 0347 */ 11015, + /* 0348 */ 11028, + /* 0349 */ 11057, + /* 034A */ 11082, + /* 034B */ 11099, + /* 034C */ 11108, + /* 034D */ 11119, + /* 034E */ 11137, + /* 034F */ 11150, + /* 0350 */ 11163, + /* 0351 */ 11179, + /* 0352 */ 11190, + /* 0353 */ 11213, + /* 0354 */ 11230, + /* 0355 */ 11247, + /* 0356 */ 11264, + /* 0357 */ 11269, + /* 0358 */ 11283, + /* 0359 */ 11297, + /* 035A */ 11303, + /* 035B */ 11311, +}; + +const char c_CLR_StringTable_Data[] = + /* 0000 */ ".cctor\0" + /* 0001 */ ".ctor\0" + /* 0002 */ "Abort\0" + /* 0003 */ "Abs\0" + /* 0004 */ "AccessedThroughPropertyAttribute\0" + /* 0005 */ "Acos\0" + /* 0006 */ "Add\0" + /* 0007 */ "AddDays\0" + /* 0008 */ "AddHours\0" + /* 0009 */ "AddMilliseconds\0" + /* 000A */ "AddMinutes\0" + /* 000B */ "AddSeconds\0" + /* 000C */ "AddTicks\0" + /* 000D */ "AnyPendingFinalizers\0" + /* 000E */ "AppDomain\0" + /* 000F */ "AppDomainUnloadedException\0" + /* 0010 */ "Append\0" + /* 0011 */ "AppendHelper\0" + /* 0012 */ "AppendLine\0" + /* 0013 */ "AppendTrailingZeros\0" + /* 0014 */ "ApplicationException\0" + /* 0015 */ "ArgumentException\0" + /* 0016 */ "ArgumentNullException\0" + /* 0017 */ "ArgumentOutOfRangeException\0" + /* 0018 */ "Arguments\0" + /* 0019 */ "Array\0" + /* 001A */ "ArrayList\0" + /* 001B */ "ArraySize\0" + /* 001C */ "Asin\0" + /* 001D */ "Assembly\0" + /* 001E */ "AssemblyInfo\0" + /* 001F */ "AssemblyMemoryInfo\0" + /* 0020 */ "AssemblyName\0" + /* 0021 */ "AssemblyNameFlags\0" + /* 0022 */ "AssemblyRef\0" + /* 0023 */ "AssemblyRefElements\0" + /* 0024 */ "Assert\0" + /* 0025 */ "AsyncCallback\0" + /* 0026 */ "Atan\0" + /* 0027 */ "Atan2\0" + /* 0028 */ "Attribute\0" + /* 0029 */ "Attributes\0" + /* 002A */ "AttributesElements\0" + /* 002B */ "AutoResetEvent\0" + /* 002C */ "Backlight\0" + /* 002D */ "BaseEvent\0" + /* 002E */ "BeginInvoke\0" + /* 002F */ "Bias\0" + /* 0030 */ "BinarySearch\0" + /* 0031 */ "Binder\0" + /* 0032 */ "BindingFlags\0" + /* 0033 */ "BitConverter\0" + /* 0034 */ "BitPacked\0" + /* 0035 */ "Boolean\0" + /* 0036 */ "Break\0" + /* 0037 */ "Byte\0" + /* 0038 */ "ByteCode\0" + /* 0039 */ "Ceiling\0" + /* 003A */ "Change\0" + /* 003B */ "Char\0" + /* 003C */ "Check\0" + /* 003D */ "Clear\0" + /* 003E */ "Clone\0" + /* 003F */ "Close\0" + /* 0040 */ "Combine\0" + /* 0041 */ "CombineArrays\0" + /* 0042 */ "Compare\0" + /* 0043 */ "CompareExchange\0" + /* 0044 */ "CompareTo\0" + /* 0045 */ "ComputeCRC\0" + /* 0046 */ "Concat\0" + /* 0047 */ "ConstraintException\0" + /* 0048 */ "ConstructorInfo\0" + /* 0049 */ "ContactHeight\0" + /* 004A */ "ContactWidth\0" + /* 004B */ "Contains\0" + /* 004C */ "Convert\0" + /* 004D */ "Copy\0" + /* 004E */ "CopyTo\0" + /* 004F */ "CopyToCollection\0" + /* 0050 */ "Cos\0" + /* 0051 */ "Cosh\0" + /* 0052 */ "CreateDomain\0" + /* 0053 */ "CreateInstance\0" + /* 0054 */ "CreateInstanceAndUnwrap\0" + /* 0055 */ "CultureInfo\0" + /* 0056 */ "CultureTypes\0" + /* 0057 */ "CurrentSystemTimeZone\0" + /* 0058 */ "DateTime\0" + /* 0059 */ "DateTimeFormat\0" + /* 005A */ "DateTimeFormatInfo\0" + /* 005B */ "DateTimeKind\0" + /* 005C */ "Day\0" + /* 005D */ "DayOfWeek\0" + /* 005E */ "DaylightBias\0" + /* 005F */ "DaylightDate\0" + /* 0060 */ "DaylightName\0" + /* 0061 */ "DaylightTime\0" + /* 0062 */ "DaysInMonth\0" + /* 0063 */ "Debug\0" + /* 0064 */ "DebuggableAttribute\0" + /* 0065 */ "Debugger\0" + /* 0066 */ "DebuggingModes\0" + /* 0067 */ "Decoder\0" + /* 0068 */ "Decrement\0" + /* 0069 */ "Delegate\0" + /* 006A */ "Dequeue\0" + /* 006B */ "Deserialize\0" + /* 006C */ "DictionaryEntry\0" + /* 006D */ "Dispose\0" + /* 006E */ "Double\0" + /* 006F */ "DoubleToInt64Bits\0" + /* 0070 */ "Duration\0" + /* 0071 */ "EditorBrowsableState\0" + /* 0072 */ "Empty\0" + /* 0073 */ "EnableGCMessages\0" + /* 0074 */ "Encoding\0" + /* 0075 */ "EndInvoke\0" + /* 0076 */ "EndPoint\0" + /* 0077 */ "Enqueue\0" + /* 0078 */ "EnsureCapacity\0" + /* 0079 */ "EnsureStringArrayResource\0" + /* 007A */ "EnsureStringResource\0" + /* 007B */ "Enter\0" + /* 007C */ "Entry\0" + /* 007D */ "EntryForKey\0" + /* 007E */ "Enum\0" + /* 007F */ "EnumeratorType\0" + /* 0080 */ "Equals\0" + /* 0081 */ "EventArgs\0" + /* 0082 */ "EventCategory\0" + /* 0083 */ "EventData\0" + /* 0084 */ "EventMessage\0" + /* 0085 */ "Exception\0" + /* 0086 */ "Exchange\0" + /* 0087 */ "ExecutionConstraint\0" + /* 0088 */ "Exit\0" + /* 0089 */ "Exp\0" + /* 008A */ "ExpandByABlock\0" + /* 008B */ "ExtendedTimer\0" + /* 008C */ "ExtendedWeakReference\0" + /* 008D */ "ExtensionAttribute\0" + /* 008E */ "ExtractRangeFromArray\0" + /* 008F */ "ExtractValueFromArray\0" + /* 0090 */ "FalseString\0" + /* 0091 */ "FieldDef\0" + /* 0092 */ "FieldDefElements\0" + /* 0093 */ "FieldInfo\0" + /* 0094 */ "FieldRef\0" + /* 0095 */ "FieldRefElements\0" + /* 0096 */ "Finalize\0" + /* 0097 */ "FindChunkForIndex\0" + /* 0098 */ "FindResource\0" + /* 0099 */ "Flags\0" + /* 009A */ "Floor\0" + /* 009B */ "Flush\0" + /* 009C */ "FlushAll\0" + /* 009D */ "Format\0" + /* 009E */ "FormatCustomized\0" + /* 009F */ "FormatDigits\0" + /* 00A0 */ "FormatNative\0" + /* 00A1 */ "FromBase64CharArray\0" + /* 00A2 */ "FromBase64String\0" + /* 00A3 */ "FromTicks\0" + /* 00A4 */ "GC\0" + /* 00A5 */ "GenericEvent\0" + /* 00A6 */ "Gesture\0" + /* 00A7 */ "GetAssemblies\0" + /* 00A8 */ "GetAssembly\0" + /* 00A9 */ "GetAssemblyFromHash\0" + /* 00AA */ "GetAssemblyHash\0" + /* 00AB */ "GetAssemblyInfo\0" + /* 00AC */ "GetAssemblyMemoryInfo\0" + /* 00AD */ "GetBase64EncodedLength\0" + /* 00AE */ "GetBytes\0" + /* 00AF */ "GetChars\0" + /* 00B0 */ "GetConstructor\0" + /* 00B1 */ "GetCultures\0" + /* 00B2 */ "GetDaylightChanges\0" + /* 00B3 */ "GetDecoder\0" + /* 00B4 */ "GetDelimitedStringResource\0" + /* 00B5 */ "GetDelimitedStringResources\0" + /* 00B6 */ "GetDomain\0" + /* 00B7 */ "GetDoubleNumber\0" + /* 00B8 */ "GetEffectiveDate\0" + /* 00B9 */ "GetElementType\0" + /* 00BA */ "GetEnumerator\0" + /* 00BB */ "GetExecutingAssembly\0" + /* 00BC */ "GetExpirationDate\0" + /* 00BD */ "GetField\0" + /* 00BE */ "GetFields\0" + /* 00BF */ "GetFormat\0" + /* 00C0 */ "GetHashCode\0" + /* 00C1 */ "GetInterfaces\0" + /* 00C2 */ "GetMachineTime\0" + /* 00C3 */ "GetManifestResourceNames\0" + /* 00C4 */ "GetMessage\0" + /* 00C5 */ "GetMethod\0" + /* 00C6 */ "GetMethods\0" + /* 00C7 */ "GetName\0" + /* 00C8 */ "GetObject\0" + /* 00C9 */ "GetObjectChunkFromId\0" + /* 00CA */ "GetObjectFromId\0" + /* 00CB */ "GetObjectInternal\0" + /* 00CC */ "GetObjectValue\0" + /* 00CD */ "GetParentCultureName\0" + /* 00CE */ "GetPosition\0" + /* 00CF */ "GetRawCertData\0" + /* 00D0 */ "GetRealFormat\0" + /* 00D1 */ "GetSatelliteAssembly\0" + /* 00D2 */ "GetString\0" + /* 00D3 */ "GetSystemVersion\0" + /* 00D4 */ "GetTimeZoneOffset\0" + /* 00D5 */ "GetType\0" + /* 00D6 */ "GetTypeFromHandle\0" + /* 00D7 */ "GetTypeFromHash\0" + /* 00D8 */ "GetTypeHash\0" + /* 00D9 */ "GetTypeInternal\0" + /* 00DA */ "GetTypes\0" + /* 00DB */ "GetTypesImplementingInterface\0" + /* 00DC */ "GetUtcOffset\0" + /* 00DD */ "GetValue\0" + /* 00DE */ "GetVersion\0" + /* 00DF */ "GloballySynchronizedAttribute\0" + /* 00E0 */ "Guid\0" + /* 00E1 */ "Hash\0" + /* 00E2 */ "Hashtable\0" + /* 00E3 */ "HashtableEnumerator\0" + /* 00E4 */ "HexToChar\0" + /* 00E5 */ "Hour\0" + /* 00E6 */ "IAsyncResult\0" + /* 00E7 */ "ICloneable\0" + /* 00E8 */ "ICollection\0" + /* 00E9 */ "IComparable\0" + /* 00EA */ "IComparer\0" + /* 00EB */ "ICustomFormatter\0" + /* 00EC */ "IDictionary\0" + /* 00ED */ "IDisposable\0" + /* 00EE */ "IEEERemainder\0" + /* 00EF */ "IEnumerable\0" + /* 00F0 */ "IEnumerator\0" + /* 00F1 */ "IEqualityComparer\0" + /* 00F2 */ "IEventListener\0" + /* 00F3 */ "IEventProcessor\0" + /* 00F4 */ "IFormatProvider\0" + /* 00F5 */ "IFormattable\0" + /* 00F6 */ "IList\0" + /* 00F7 */ "ILog\0" + /* 00F8 */ "IOException\0" + /* 00F9 */ "IOExceptionErrorCode\0" + /* 00FA */ "IReflect\0" + /* 00FB */ "Increment\0" + /* 00FC */ "IndexOf\0" + /* 00FD */ "IndexOfAny\0" + /* 00FE */ "IndexOutOfRangeException\0" + /* 00FF */ "Initialize\0" + /* 0100 */ "InitializeArray\0" + /* 0101 */ "InitializeForEventSource\0" + /* 0102 */ "InitializeHashTable\0" + /* 0103 */ "Insert\0" + /* 0104 */ "InsertGroupSeperators\0" + /* 0105 */ "InsertValueIntoArray\0" + /* 0106 */ "Install\0" + /* 0107 */ "Int16\0" + /* 0108 */ "Int32\0" + /* 0109 */ "Int64\0" + /* 010A */ "Int64BitsToDouble\0" + /* 010B */ "IntPtr\0" + /* 010C */ "Interlocked\0" + /* 010D */ "Intern\0" + /* 010E */ "InvalidCastException\0" + /* 010F */ "InvalidOperationException\0" + /* 0110 */ "Invoke\0" + /* 0111 */ "InvokeMember\0" + /* 0112 */ "IsDaylightSavingTime\0" + /* 0113 */ "IsEmulator\0" + /* 0114 */ "IsInfinity\0" + /* 0115 */ "IsInstanceOfType\0" + /* 0116 */ "IsInterned\0" + /* 0117 */ "IsNaN\0" + /* 0118 */ "IsNegativeInfinity\0" + /* 0119 */ "IsPositiveInfinity\0" + /* 011A */ "IsSubclassOf\0" + /* 011B */ "IsTransparentProxy\0" + /* 011C */ "IsTypeLoaded\0" + /* 011D */ "Join\0" + /* 011E */ "Key\0" + /* 011F */ "KeyCollection\0" + /* 0120 */ "LastIndexOf\0" + /* 0121 */ "LastIndexOfAny\0" + /* 0122 */ "Load\0" + /* 0123 */ "LoadInternal\0" + /* 0124 */ "Log\0" + /* 0125 */ "Log10\0" + /* 0126 */ "MakeRoom\0" + /* 0127 */ "ManualResetEvent\0" + /* 0128 */ "MarshalByRefObject\0" + /* 0129 */ "Math\0" + /* 012A */ "Max\0" + /* 012B */ "MaxValue\0" + /* 012C */ "MemberInfo\0" + /* 012D */ "MemberTypes\0" + /* 012E */ "MemberwiseClone\0" + /* 012F */ "Message\0" + /* 0130 */ "MetadataSize\0" + /* 0131 */ "MethodBase\0" + /* 0132 */ "MethodDef\0" + /* 0133 */ "MethodDefElements\0" + /* 0134 */ "MethodInfo\0" + /* 0135 */ "MethodRef\0" + /* 0136 */ "MethodRefElements\0" + /* 0137 */ "Microsoft.SPOT\0" + /* 0138 */ "Microsoft.SPOT.Hardware\0" + /* 0139 */ "Microsoft.SPOT.Messaging\0" + /* 013A */ "Microsoft.SPOT.Touch\0" + /* 013B */ "Milliseconds\0" + /* 013C */ "Min\0" + /* 013D */ "MinValue\0" + /* 013E */ "Minute\0" + /* 013F */ "Monitor\0" + /* 0140 */ "Month\0" + /* 0141 */ "MoveNext\0" + /* 0142 */ "MulticastDelegate\0" + /* 0143 */ "Native_Resources\0" + /* 0144 */ "Negate\0" + /* 0145 */ "NewGuid\0" + /* 0146 */ "Next\0" + /* 0147 */ "NextBytes\0" + /* 0148 */ "NextDouble\0" + /* 0149 */ "NotImplementedException\0" + /* 014A */ "NotSupportedException\0" + /* 014B */ "NullReferenceException\0" + /* 014C */ "Number\0" + /* 014D */ "NumberFormatInfo\0" + /* 014E */ "Object\0" + /* 014F */ "ObjectDisposedException\0" + /* 0150 */ "OnEvent\0" + /* 0151 */ "OutOfMemoryException\0" + /* 0152 */ "Parse\0" + /* 0153 */ "ParseAssemblyName\0" + /* 0154 */ "ParseCertificate\0" + /* 0155 */ "ParseNextChar\0" + /* 0156 */ "ParseQuoteString\0" + /* 0157 */ "ParseRepeatPattern\0" + /* 0158 */ "ParseTypeName\0" + /* 0159 */ "Peek\0" + /* 015A */ "Piezo\0" + /* 015B */ "Pop\0" + /* 015C */ "PostProcessFloat\0" + /* 015D */ "PostProcessInteger\0" + /* 015E */ "Pow\0" + /* 015F */ "Print\0" + /* 0160 */ "PriorityLevel\0" + /* 0161 */ "ProcessEvent\0" + /* 0162 */ "ProcessorArchitecture\0" + /* 0163 */ "PropertyInfo\0" + /* 0164 */ "Push\0" + /* 0165 */ "PushBackIntoRecoverList\0" + /* 0166 */ "Queue\0" + /* 0167 */ "Raise\0" + /* 0168 */ "RamSize\0" + /* 0169 */ "Random\0" + /* 016A */ "RangeBias\0" + /* 016B */ "ReRegisterForFinalize\0" + /* 016C */ "Read\0" + /* 016D */ "ReadByte\0" + /* 016E */ "Recover\0" + /* 016F */ "RecoverOrCreate\0" + /* 0170 */ "ReferenceEquals\0" + /* 0171 */ "Reflection\0" + /* 0172 */ "Rehash\0" + /* 0173 */ "RemotedException\0" + /* 0174 */ "RemotingServices\0" + /* 0175 */ "Remove\0" + /* 0176 */ "RemoveAt\0" + /* 0177 */ "Replace\0" + /* 0178 */ "ReplaceAllInChunk\0" + /* 0179 */ "ReplaceDecimalSeperator\0" + /* 017A */ "ReplaceInPlaceAtChunk\0" + /* 017B */ "ReplaceNegativeSign\0" + /* 017C */ "Reply\0" + /* 017D */ "ReplyRaw\0" + /* 017E */ "Reset\0" + /* 017F */ "ResourceManager\0" + /* 0180 */ "ResourceUtility\0" + /* 0181 */ "Resources\0" + /* 0182 */ "ResourcesData\0" + /* 0183 */ "ResourcesElements\0" + /* 0184 */ "ResourcesFiles\0" + /* 0185 */ "ResourcesFilesElements\0" + /* 0186 */ "Resume\0" + /* 0187 */ "RomSize\0" + /* 0188 */ "Round\0" + /* 0189 */ "RunClassConstructor\0" + /* 018A */ "RuntimeArgumentHandle\0" + /* 018B */ "RuntimeConstructorInfo\0" + /* 018C */ "RuntimeFieldHandle\0" + /* 018D */ "RuntimeFieldInfo\0" + /* 018E */ "RuntimeHelpers\0" + /* 018F */ "RuntimeMethodHandle\0" + /* 0190 */ "RuntimeMethodInfo\0" + /* 0191 */ "RuntimeType\0" + /* 0192 */ "RuntimeTypeHandle\0" + /* 0193 */ "SByte\0" + /* 0194 */ "SZArrayEnumerator\0" + /* 0195 */ "Scale\0" + /* 0196 */ "Second\0" + /* 0197 */ "Seek\0" + /* 0198 */ "SeekOrigin\0" + /* 0199 */ "SendMessage\0" + /* 019A */ "SendMessageRaw\0" + /* 019B */ "SerializationFlags\0" + /* 019C */ "SerializationHintsAttribute\0" + /* 019D */ "Serialize\0" + /* 019E */ "Set\0" + /* 019F */ "SetCapacity\0" + /* 01A0 */ "SetCurrentUICulture\0" + /* 01A1 */ "SetLength\0" + /* 01A2 */ "SetLocalTime\0" + /* 01A3 */ "SetValue\0" + /* 01A4 */ "Sign\0" + /* 01A5 */ "Signatures\0" + /* 01A6 */ "Sin\0" + /* 01A7 */ "Single\0" + /* 01A8 */ "Sinh\0" + /* 01A9 */ "Sleep\0" + /* 01AA */ "Source\0" + /* 01AB */ "SourceID\0" + /* 01AC */ "SpecifyKind\0" + /* 01AD */ "Split\0" + /* 01AE */ "Sqrt\0" + /* 01AF */ "Stack\0" + /* 01B0 */ "StandardBias\0" + /* 01B1 */ "StandardDate\0" + /* 01B2 */ "StandardName\0" + /* 01B3 */ "Start\0" + /* 01B4 */ "StartsWith\0" + /* 01B5 */ "StaticFields\0" + /* 01B6 */ "Stream\0" + /* 01B7 */ "String\0" + /* 01B8 */ "StringBuilder\0" + /* 01B9 */ "StringResources\0" + /* 01BA */ "Strings\0" + /* 01BB */ "Substring\0" + /* 01BC */ "Subtract\0" + /* 01BD */ "SuppressFinalize\0" + /* 01BE */ "Suspend\0" + /* 01BF */ "System\0" + /* 01C0 */ "System.Collections\0" + /* 01C1 */ "System.Collections.ICollection.get_Count\0" + /* 01C2 */ "System.Collections.IList.Add\0" + /* 01C3 */ "System.Collections.IList.Clear\0" + /* 01C4 */ "System.Collections.IList.Contains\0" + /* 01C5 */ "System.Collections.IList.IndexOf\0" + /* 01C6 */ "System.Collections.IList.Insert\0" + /* 01C7 */ "System.Collections.IList.Remove\0" + /* 01C8 */ "System.Collections.IList.RemoveAt\0" + /* 01C9 */ "System.Collections.IList.get_Item\0" + /* 01CA */ "System.Collections.IList.set_Item\0" + /* 01CB */ "System.ComponentModel\0" + /* 01CC */ "System.Diagnostics\0" + /* 01CD */ "System.Globalization\0" + /* 01CE */ "System.Globalization.Resources\0" + /* 01CF */ "System.IO\0" + /* 01D0 */ "System.Reflection\0" + /* 01D1 */ "System.Resources\0" + /* 01D2 */ "System.Runtime.CompilerServices\0" + /* 01D3 */ "System.Runtime.Remoting\0" + /* 01D4 */ "System.Runtime.Versioning\0" + /* 01D5 */ "System.Security.Cryptography.X509Certificates\0" + /* 01D6 */ "System.Text\0" + /* 01D7 */ "System.Threading\0" + /* 01D8 */ "SystemException\0" + /* 01D9 */ "SystemID\0" + /* 01DA */ "SystemInfo\0" + /* 01DB */ "SystemTime\0" + /* 01DC */ "Tan\0" + /* 01DD */ "Tanh\0" + /* 01DE */ "Target\0" + /* 01DF */ "TargetFrameworkAttribute\0" + /* 01E0 */ "Thread\0" + /* 01E1 */ "ThreadAbortException\0" + /* 01E2 */ "ThreadPriority\0" + /* 01E3 */ "ThreadStart\0" + /* 01E4 */ "ThreadState\0" + /* 01E5 */ "Time\0" + /* 01E6 */ "TimeEvents\0" + /* 01E7 */ "TimeSpan\0" + /* 01E8 */ "TimeStamp\0" + /* 01E9 */ "TimeZone\0" + /* 01EA */ "TimeZoneId\0" + /* 01EB */ "TimeZoneInformation\0" + /* 01EC */ "Timer\0" + /* 01ED */ "TimerCallback\0" + /* 01EE */ "Timestamp\0" + /* 01EF */ "ToArray\0" + /* 01F0 */ "ToBase64String\0" + /* 01F1 */ "ToBoolean\0" + /* 01F2 */ "ToByte\0" + /* 01F3 */ "ToByteArray\0" + /* 01F4 */ "ToChar\0" + /* 01F5 */ "ToCharArray\0" + /* 01F6 */ "ToDouble\0" + /* 01F7 */ "ToInt16\0" + /* 01F8 */ "ToInt32\0" + /* 01F9 */ "ToInt64\0" + /* 01FA */ "ToLocalTime\0" + /* 01FB */ "ToLower\0" + /* 01FC */ "ToSByte\0" + /* 01FD */ "ToSingle\0" + /* 01FE */ "ToString\0" + /* 01FF */ "ToUInt16\0" + /* 0200 */ "ToUInt32\0" + /* 0201 */ "ToUInt64\0" + /* 0202 */ "ToUniversalTime\0" + /* 0203 */ "ToUpper\0" + /* 0204 */ "TouchEvent\0" + /* 0205 */ "TouchGesture\0" + /* 0206 */ "TouchGestureEventArgs\0" + /* 0207 */ "TouchGestureEventHandler\0" + /* 0208 */ "TouchInput\0" + /* 0209 */ "TouchInputFlags\0" + /* 020A */ "TouchMessages\0" + /* 020B */ "TouchScreenEventArgs\0" + /* 020C */ "TouchScreenEventHandler\0" + /* 020D */ "Touches\0" + /* 020E */ "Trace\0" + /* 020F */ "Trim\0" + /* 0210 */ "TrimEnd\0" + /* 0211 */ "TrimStart\0" + /* 0212 */ "TrueString\0" + /* 0213 */ "Truncate\0" + /* 0214 */ "TryParse\0" + /* 0215 */ "TrySZIndexOf\0" + /* 0216 */ "Type\0" + /* 0217 */ "TypeCode\0" + /* 0218 */ "TypeDef\0" + /* 0219 */ "TypeDefElements\0" + /* 021A */ "TypeRef\0" + /* 021B */ "TypeRefElements\0" + /* 021C */ "TypeSpec\0" + /* 021D */ "TypeSpecElements\0" + /* 021E */ "UInt16\0" + /* 021F */ "UInt32\0" + /* 0220 */ "UInt64\0" + /* 0221 */ "UTF8Decoder\0" + /* 0222 */ "UTF8Encoding\0" + /* 0223 */ "UnknownTypeException\0" + /* 0224 */ "Unload\0" + /* 0225 */ "Utility\0" + /* 0226 */ "ValidateFormat\0" + /* 0227 */ "Value\0" + /* 0228 */ "ValueCollection\0" + /* 0229 */ "ValueType\0" + /* 022A */ "Version\0" + /* 022B */ "Void\0" + /* 022C */ "WaitAll\0" + /* 022D */ "WaitAny\0" + /* 022E */ "WaitForPendingFinalizers\0" + /* 022F */ "WaitHandle\0" + /* 0230 */ "WaitMultiple\0" + /* 0231 */ "WaitOne\0" + /* 0232 */ "WeakDelegate\0" + /* 0233 */ "WeakReference\0" + /* 0234 */ "Write\0" + /* 0235 */ "WriteByte\0" + /* 0236 */ "X\0" + /* 0237 */ "X509Certificate\0" + /* 0238 */ "Y\0" + /* 0239 */ "Year\0" + /* 023A */ "Zero\0" + /* 023B */ "_Build\0" + /* 023C */ "_Major\0" + /* 023D */ "_Minor\0" + /* 023E */ "_Revision\0" + /* 023F */ "_array\0" + /* 0240 */ "_arrayLength\0" + /* 0241 */ "_assembly\0" + /* 0242 */ "_buckets\0" + /* 0243 */ "_count\0" + /* 0244 */ "_endIndex\0" + /* 0245 */ "_frameworkDisplayName\0" + /* 0246 */ "_frameworkName\0" + /* 0247 */ "_growthFactor\0" + /* 0248 */ "_head\0" + /* 0249 */ "_index\0" + /* 024A */ "_items\0" + /* 024B */ "_loadFactor\0" + /* 024C */ "_maxLoadFactor\0" + /* 024D */ "_message\0" + /* 024E */ "_numberOfBuckets\0" + /* 024F */ "_random\0" + /* 0250 */ "_size\0" + /* 0251 */ "_startIndex\0" + /* 0252 */ "_tail\0" + /* 0253 */ "abbreviatedDayNames\0" + /* 0254 */ "abbreviatedMonthNames\0" + /* 0255 */ "amDesignator\0" + /* 0256 */ "dateSeparator\0" + /* 0257 */ "dateTimeInfo\0" + /* 0258 */ "dayNames\0" + /* 0259 */ "fullDateTimePattern\0" + /* 025A */ "generalLongTimePattern\0" + /* 025B */ "generalShortTimePattern\0" + /* 025C */ "get_AMDesignator\0" + /* 025D */ "get_AbbreviatedDayNames\0" + /* 025E */ "get_AbbreviatedMonthNames\0" + /* 025F */ "get_Angle\0" + /* 0260 */ "get_Assembly\0" + /* 0261 */ "get_AssemblyQualifiedName\0" + /* 0262 */ "get_BaseType\0" + /* 0263 */ "get_Build\0" + /* 0264 */ "get_CanRead\0" + /* 0265 */ "get_CanSeek\0" + /* 0266 */ "get_CanTimeout\0" + /* 0267 */ "get_CanWrite\0" + /* 0268 */ "get_Capacity\0" + /* 0269 */ "get_Chars\0" + /* 026A */ "get_Count\0" + /* 026B */ "get_Current\0" + /* 026C */ "get_CurrentDomain\0" + /* 026D */ "get_CurrentInfo\0" + /* 026E */ "get_CurrentThread\0" + /* 026F */ "get_CurrentTimeZone\0" + /* 0270 */ "get_CurrentUICulture\0" + /* 0271 */ "get_CurrentUICultureInternal\0" + /* 0272 */ "get_Date\0" + /* 0273 */ "get_DateSeparator\0" + /* 0274 */ "get_DateTimeFormat\0" + /* 0275 */ "get_Day\0" + /* 0276 */ "get_DayNames\0" + /* 0277 */ "get_DayOfWeek\0" + /* 0278 */ "get_DayOfYear\0" + /* 0279 */ "get_DaylightName\0" + /* 027A */ "get_Days\0" + /* 027B */ "get_DeclaringType\0" + /* 027C */ "get_Delta\0" + /* 027D */ "get_End\0" + /* 027E */ "get_ErrorCode\0" + /* 027F */ "get_FieldType\0" + /* 0280 */ "get_Flags\0" + /* 0281 */ "get_FrameworkDisplayName\0" + /* 0282 */ "get_FrameworkName\0" + /* 0283 */ "get_FriendlyName\0" + /* 0284 */ "get_FullDateTimePattern\0" + /* 0285 */ "get_FullName\0" + /* 0286 */ "get_GeneralLongTimePattern\0" + /* 0287 */ "get_GeneralShortTimePattern\0" + /* 0288 */ "get_GrowthFactor\0" + /* 0289 */ "get_Hour\0" + /* 028A */ "get_Hours\0" + /* 028B */ "get_Id\0" + /* 028C */ "get_InnerException\0" + /* 028D */ "get_IsAbstract\0" + /* 028E */ "get_IsAlive\0" + /* 028F */ "get_IsArray\0" + /* 0290 */ "get_IsAttached\0" + /* 0291 */ "get_IsBigEndian\0" + /* 0292 */ "get_IsClass\0" + /* 0293 */ "get_IsEnum\0" + /* 0294 */ "get_IsFinal\0" + /* 0295 */ "get_IsFixedSize\0" + /* 0296 */ "get_IsInterface\0" + /* 0297 */ "get_IsLittleEndian\0" + /* 0298 */ "get_IsNotPublic\0" + /* 0299 */ "get_IsPublic\0" + /* 029A */ "get_IsReadOnly\0" + /* 029B */ "get_IsSerializable\0" + /* 029C */ "get_IsStatic\0" + /* 029D */ "get_IsSynchronized\0" + /* 029E */ "get_IsValid\0" + /* 029F */ "get_IsValueType\0" + /* 02A0 */ "get_IsVirtual\0" + /* 02A1 */ "get_Issuer\0" + /* 02A2 */ "get_Item\0" + /* 02A3 */ "get_Keys\0" + /* 02A4 */ "get_Kind\0" + /* 02A5 */ "get_LastExpiration\0" + /* 02A6 */ "get_Length\0" + /* 02A7 */ "get_LongDatePattern\0" + /* 02A8 */ "get_LongTimePattern\0" + /* 02A9 */ "get_Major\0" + /* 02AA */ "get_ManagedThreadId\0" + /* 02AB */ "get_MaxCapacity\0" + /* 02AC */ "get_MaxLoadFactor\0" + /* 02AD */ "get_MemberType\0" + /* 02AE */ "get_Message\0" + /* 02AF */ "get_Method\0" + /* 02B0 */ "get_Millisecond\0" + /* 02B1 */ "get_Milliseconds\0" + /* 02B2 */ "get_Minor\0" + /* 02B3 */ "get_Minute\0" + /* 02B4 */ "get_Minutes\0" + /* 02B5 */ "get_Model\0" + /* 02B6 */ "get_Month\0" + /* 02B7 */ "get_MonthDayPattern\0" + /* 02B8 */ "get_MonthNames\0" + /* 02B9 */ "get_Name\0" + /* 02BA */ "get_NegativeSign\0" + /* 02BB */ "get_Now\0" + /* 02BC */ "get_NumberDecimalSeparator\0" + /* 02BD */ "get_NumberFormat\0" + /* 02BE */ "get_NumberGroupSeparator\0" + /* 02BF */ "get_NumberGroupSizes\0" + /* 02C0 */ "get_OEM\0" + /* 02C1 */ "get_OEMString\0" + /* 02C2 */ "get_OffsetToStringData\0" + /* 02C3 */ "get_PMDesignator\0" + /* 02C4 */ "get_ParamName\0" + /* 02C5 */ "get_Parent\0" + /* 02C6 */ "get_Payload\0" + /* 02C7 */ "get_PayloadRaw\0" + /* 02C8 */ "get_Position\0" + /* 02C9 */ "get_PositiveSign\0" + /* 02CA */ "get_Priority\0" + /* 02CB */ "get_PropertyName\0" + /* 02CC */ "get_PropertyType\0" + /* 02CD */ "get_RFC1123Pattern\0" + /* 02CE */ "get_ReadTimeout\0" + /* 02CF */ "get_ResourceManager\0" + /* 02D0 */ "get_ReturnType\0" + /* 02D1 */ "get_Revision\0" + /* 02D2 */ "get_SKU\0" + /* 02D3 */ "get_Second\0" + /* 02D4 */ "get_Seconds\0" + /* 02D5 */ "get_Selector\0" + /* 02D6 */ "get_ShortDatePattern\0" + /* 02D7 */ "get_ShortTimePattern\0" + /* 02D8 */ "get_SortableDateTimePattern\0" + /* 02D9 */ "get_StackTrace\0" + /* 02DA */ "get_StandardName\0" + /* 02DB */ "get_Start\0" + /* 02DC */ "get_Subject\0" + /* 02DD */ "get_SyncRoot\0" + /* 02DE */ "get_Target\0" + /* 02DF */ "get_ThreadState\0" + /* 02E0 */ "get_Ticks\0" + /* 02E1 */ "get_TimeOfDay\0" + /* 02E2 */ "get_TimeSeparator\0" + /* 02E3 */ "get_Today\0" + /* 02E4 */ "get_UTF8\0" + /* 02E5 */ "get_UniversalSortableDateTimePattern\0" + /* 02E6 */ "get_UseRFC4648Encoding\0" + /* 02E7 */ "get_UtcNow\0" + /* 02E8 */ "get_Values\0" + /* 02E9 */ "get_Version\0" + /* 02EA */ "get_WriteTimeout\0" + /* 02EB */ "get_Year\0" + /* 02EC */ "get_YearMonthPattern\0" + /* 02ED */ "ht\0" + /* 02EE */ "index\0" + /* 02EF */ "key\0" + /* 02F0 */ "longDatePattern\0" + /* 02F1 */ "longTimePattern\0" + /* 02F2 */ "m_AppDomain\0" + /* 02F3 */ "m_ChunkChars\0" + /* 02F4 */ "m_ChunkLength\0" + /* 02F5 */ "m_ChunkOffset\0" + /* 02F6 */ "m_ChunkPrevious\0" + /* 02F7 */ "m_Delegate\0" + /* 02F8 */ "m_HResult\0" + /* 02F9 */ "m_Id\0" + /* 02FA */ "m_MaxCapacity\0" + /* 02FB */ "m_Priority\0" + /* 02FC */ "m_Thread\0" + /* 02FD */ "m_appDomain\0" + /* 02FE */ "m_assembly\0" + /* 02FF */ "m_baseAssembly\0" + /* 0300 */ "m_baseName\0" + /* 0301 */ "m_callback\0" + /* 0302 */ "m_certificate\0" + /* 0303 */ "m_cultureInfo\0" + /* 0304 */ "m_cultureName\0" + /* 0305 */ "m_data\0" + /* 0306 */ "m_delta\0" + /* 0307 */ "m_effectiveDate\0" + /* 0308 */ "m_end\0" + /* 0309 */ "m_expirationDate\0" + /* 030A */ "m_flags\0" + /* 030B */ "m_friendlyName\0" + /* 030C */ "m_handle\0" + /* 030D */ "m_hash\0" + /* 030E */ "m_id\0" + /* 030F */ "m_innerException\0" + /* 0310 */ "m_issuer\0" + /* 0311 */ "m_message\0" + /* 0312 */ "m_name\0" + /* 0313 */ "m_paramName\0" + /* 0314 */ "m_parent\0" + /* 0315 */ "m_password\0" + /* 0316 */ "m_payload\0" + /* 0317 */ "m_rand\0" + /* 0318 */ "m_refs\0" + /* 0319 */ "m_resourceFileId\0" + /* 031A */ "m_rm\0" + /* 031B */ "m_rmFallback\0" + /* 031C */ "m_selector\0" + /* 031D */ "m_seq\0" + /* 031E */ "m_sessionHandle\0" + /* 031F */ "m_size\0" + /* 0320 */ "m_source\0" + /* 0321 */ "m_stackTrace\0" + /* 0322 */ "m_start\0" + /* 0323 */ "m_state\0" + /* 0324 */ "m_subject\0" + /* 0325 */ "m_ticks\0" + /* 0326 */ "m_ticksOffset\0" + /* 0327 */ "m_timer\0" + /* 0328 */ "m_type\0" + /* 0329 */ "m_value\0" + /* 032A */ "manager\0" + /* 032B */ "monthDayPattern\0" + /* 032C */ "monthNames\0" + /* 032D */ "mscorlib\0" + /* 032E */ "negativeSign\0" + /* 032F */ "next\0" + /* 0330 */ "numInfo\0" + /* 0331 */ "numberDecimalSeparator\0" + /* 0332 */ "numberGroupSeparator\0" + /* 0333 */ "numberGroupSizes\0" + /* 0334 */ "op_Addition\0" + /* 0335 */ "op_Equality\0" + /* 0336 */ "op_GreaterThan\0" + /* 0337 */ "op_GreaterThanOrEqual\0" + /* 0338 */ "op_Inequality\0" + /* 0339 */ "op_LessThan\0" + /* 033A */ "op_LessThanOrEqual\0" + /* 033B */ "op_Subtraction\0" + /* 033C */ "op_UnaryNegation\0" + /* 033D */ "op_UnaryPlus\0" + /* 033E */ "pmDesignator\0" + /* 033F */ "positiveSign\0" + /* 0340 */ "propertyName\0" + /* 0341 */ "returnType\0" + /* 0342 */ "s_ewr\0" + /* 0343 */ "s_rgbBase64Decode\0" + /* 0344 */ "s_rgchBase64Encoding\0" + /* 0345 */ "s_rgchBase64EncodingDefault\0" + /* 0346 */ "s_rgchBase64EncodingRFC4648\0" + /* 0347 */ "set_Capacity\0" + /* 0348 */ "set_CurrentUICultureInternal\0" + /* 0349 */ "set_FrameworkDisplayName\0" + /* 034A */ "set_GrowthFactor\0" + /* 034B */ "set_Item\0" + /* 034C */ "set_Length\0" + /* 034D */ "set_MaxLoadFactor\0" + /* 034E */ "set_Position\0" + /* 034F */ "set_Priority\0" + /* 0350 */ "set_ReadTimeout\0" + /* 0351 */ "set_Target\0" + /* 0352 */ "set_UseRFC4648Encoding\0" + /* 0353 */ "set_WriteTimeout\0" + /* 0354 */ "shortDatePattern\0" + /* 0355 */ "shortTimePattern\0" + /* 0356 */ "temp\0" + /* 0357 */ "ticksAtOrigin\0" + /* 0358 */ "timeSeparator\0" + /* 0359 */ "value\0" + /* 035A */ "value__\0" + /* 035B */ "yearMonthPattern\0" +; diff --git a/CLR/Libraries/CorLib/corlib_native_System_DateTime.cpp b/CLR/Libraries/CorLib/corlib_native_System_DateTime.cpp index f850e2bf8..bd72131fd 100644 --- a/CLR/Libraries/CorLib/corlib_native_System_DateTime.cpp +++ b/CLR/Libraries/CorLib/corlib_native_System_DateTime.cpp @@ -243,7 +243,7 @@ HRESULT Library_corlib_native_System_DateTime::get_UtcNow___STATIC__SystemDateTi CLR_INT64* pRes = NewObject( stack ); - *pRes = Time_GetUtcTime(); + *pRes = Time_GetUtcTime() | s_UTCMask; TINYCLR_NOCLEANUP_NOLABEL(); } diff --git a/CLR/Tools/Parser/ByteCodeParser.cpp b/CLR/Tools/Parser/ByteCodeParser.cpp index 3c38336c8..c4684a1c7 100644 --- a/CLR/Tools/Parser/ByteCodeParser.cpp +++ b/CLR/Tools/Parser/ByteCodeParser.cpp @@ -386,8 +386,8 @@ void MetaData::ByteCode::DumpOpcode( size_t index, LogicalOpcodeDesc& ref ) if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_TOKEN) wprintf( L" %08x" , ref.m_token ); if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_I4 ) wprintf( L" %d" , ref.m_arg_I4 ); if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_I8 ) wprintf( L" %I64d" , ref.m_arg_I8 ); - if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_R4 ) wprintf( L" %f" , ref.m_arg_R4 ); - if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_R8 ) wprintf( L" %g" , ref.m_arg_R8 ); + if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_R4 ) wprintf( L" %f" , (float)ref.m_arg_R4 ); + if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_R8 ) wprintf( L" %g" , (double)ref.m_arg_R8 ); if(ref.m_ol->m_flags & CLR_RT_OpcodeLookup::ATTRIB_HAS_TARGET) { diff --git a/CLR/Tools/Parser/Linker.cpp b/CLR/Tools/Parser/Linker.cpp index 4d6311573..240e6d9f9 100644 --- a/CLR/Tools/Parser/Linker.cpp +++ b/CLR/Tools/Parser/Linker.cpp @@ -334,7 +334,13 @@ bool WatchAssemblyBuilder::Linker::AllocString( const std::string& str, CLR_STRI { if(fUser == false) { - m_collectUniqueStrings.insert( str ); + // Don't collect generated strings + if((str.find("$$method0x") != 0) && + (str.find("{") != 0) && + (str.find("__StaticArrayInitTypeSize=") != 0)) + { + m_collectUniqueStrings.insert( str ); + } if(m_lookupStringsConst.find( str ) != m_lookupStringsConst.end()) { diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_driver.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_driver.cpp index 830bcd3fd..0c29a9af8 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_driver.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_driver.cpp @@ -228,7 +228,7 @@ void eth_resumeDmaReception() void eth_dmaInterruptHandler() { #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf("DMA Int:"); + hal_printf("DMA Int:"); #endif // Normal interrupt summary @@ -239,7 +239,7 @@ void eth_dmaInterruptHandler() { // Ethernet frame received #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" RS"); + hal_printf(" RS"); #endif // Clear interrupt flag @@ -257,7 +257,7 @@ void eth_dmaInterruptHandler() { // Ethernet frame sent #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" TS"); + hal_printf(" TS"); #endif // Clear interrupt flag @@ -269,7 +269,7 @@ void eth_dmaInterruptHandler() { // Transmit buffer unavailable #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" TBUS"); + hal_printf(" TBUS"); #endif // Clear interrupt flag, transmition is resumed after descriptors have been prepared @@ -281,7 +281,7 @@ void eth_dmaInterruptHandler() { // Early receive #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" ERS"); + hal_printf(" ERS"); #endif // Clear interrupt flag. Also cleared automatically by RI @@ -301,7 +301,7 @@ void eth_dmaInterruptHandler() { // Fatal bus error #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" FBES"); + hal_printf(" FBES"); #endif // Clear interrupt flag @@ -313,7 +313,7 @@ void eth_dmaInterruptHandler() { // Transmit process stopped #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" TPSS"); + hal_printf(" TPSS"); #endif // Clear interrupt flag @@ -325,7 +325,7 @@ void eth_dmaInterruptHandler() { // Transmit jabber timeout #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" TJTS"); + hal_printf(" TJTS"); #endif // Clear interrupt flag @@ -337,7 +337,7 @@ void eth_dmaInterruptHandler() { // Receive overflow #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" ROS"); + hal_printf(" ROS"); #endif // Clear interrupt flag @@ -349,7 +349,7 @@ void eth_dmaInterruptHandler() { // Transmit underflow #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" TUS"); + hal_printf(" TUS"); #endif // Clear interrupt flag @@ -361,7 +361,7 @@ void eth_dmaInterruptHandler() { // Receive buffer unavailable #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" RBUS"); + hal_printf(" RBUS"); #endif // Clear interrupt flag @@ -373,7 +373,7 @@ void eth_dmaInterruptHandler() { // Receive process stopped #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" RPSS"); + hal_printf(" RPSS"); #endif // Clear interrupt flag @@ -385,7 +385,7 @@ void eth_dmaInterruptHandler() { // Receive watchdog timeout #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" RWTS"); + hal_printf(" RWTS"); #endif // Clear interrupt flag @@ -397,7 +397,7 @@ void eth_dmaInterruptHandler() { // Early transmit interrupt #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf(" ETS"); + hal_printf(" ETS"); #endif // Clear interrupt flag @@ -410,7 +410,7 @@ void eth_dmaInterruptHandler() } #if defined (_DEBUG) && DEBUG_DMA_INT - debug_printf("\r\n"); + hal_printf("\r\n"); #endif } diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_lwip.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_lwip.cpp index 63f9906f8..d5d3ddf25 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_lwip.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_lwip.cpp @@ -88,7 +88,7 @@ BOOL STM32F4_ETH_LWIP_open(Netif_t *const pNetif) if ( !initEthernet(pNetif) ) { #ifdef _DEBUG_TRACE - debug_printf("Ethernet driver cannot be opened\r\n"); + hal_printf("Ethernet driver cannot be opened\r\n"); #endif // Set flag as closed and abort @@ -107,7 +107,7 @@ BOOL STM32F4_ETH_LWIP_open(Netif_t *const pNetif) s_isDriverOpened = TRUE; #ifdef _DEBUG_TRACE - debug_printf("Ethernet driver opened\r\n"); + hal_printf("Ethernet driver opened\r\n"); #endif return TRUE; @@ -135,7 +135,7 @@ void STM32F4_ETH_LWIP_close(const BOOL disableClocks) } #ifdef _DEBUG_TRACE - debug_printf("Ethernet driver closed\r\n"); + hal_printf("Ethernet driver closed\r\n"); #endif } @@ -177,7 +177,7 @@ static uint32_t processFrame(Netif_t *const pNetif) if (frameLength == 0) { #ifdef _DEBUG_TRACE - debug_printf("%s: erroneous frame\r\n", __func__); + hal_printf("%s: erroneous frame\r\n", __func__); #endif return releaseRxDescUntilNextFrame(); @@ -188,7 +188,7 @@ static uint32_t processFrame(Netif_t *const pNetif) if (!pbuf) { #ifdef _DEBUG_TRACE - debug_printf("%s: pbuf_alloc failed, discard current frame\r\n", __func__); + hal_printf("%s: pbuf_alloc failed, discard current frame\r\n", __func__); #endif return releaseFrame(); @@ -218,7 +218,7 @@ static uint32_t copyFrameToPbuf(Pbuf_t *pbuf) while (!eth_isRxDescOwnedByDma() && !isLastDescProcessed) { #if DEBUG_RX_DESC - debug_printf("----- Before processing RX -----\r\n"); + hal_printf("----- Before processing RX -----\r\n"); eth_displayRxDescStatus(); #endif @@ -237,7 +237,7 @@ static uint32_t copyFrameToPbuf(Pbuf_t *pbuf) nRxDesc++; #if DEBUG_RX_DESC - debug_printf("----- After processing RX -----\r\n"); + hal_printf("----- After processing RX -----\r\n"); eth_displayRxDescStatus(); #endif } @@ -400,7 +400,7 @@ static BOOL waitForTxDescriptor(uint32_t timeout) if (nWait == timeout) { //#ifdef _DEBUG - //debug_printf("%s: TX descriptor owned by DMA\r\n", __func__); + //hal_printf("%s: TX descriptor owned by DMA\r\n", __func__); //#endif return FALSE; @@ -426,7 +426,7 @@ static BOOL copyFrameFromPbuf(const Pbuf_t *pbuf) if (frameLength > TX_BUFFER_LENGTH) { #ifdef _DEBUG_TRACE - debug_printf("%s: Frame larger than TX buffer (%d)\r\n", __func__, frameLength); + hal_printf("%s: Frame larger than TX buffer (%d)\r\n", __func__, frameLength); #endif return FALSE; diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_phy.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_phy.cpp index 0117aa4b3..7d0476224 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_phy.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_phy.cpp @@ -55,7 +55,7 @@ static void findPhyAddr() if ((value == PHY_KENDIN_OUI_ID1) || (value == PHY_ST802RT1X_OUI_ID1)) { rc = phyAddress; - debug_printf( "Valid PHY Found: %x (%x)\r\n", rc, value); + hal_printf( "Valid PHY Found: %x (%x)\r\n", rc, value); g_foundPhyAddress = TRUE; g_phyAddress = phyAddress; @@ -189,7 +189,7 @@ EthMode eth_enableAutoNegotiation() return ETHMODE_FAIL; #if (DEBUG_TRACE) - debug_printf("PHY CR status 0x%x \n",status); + hal_printf("PHY CR status 0x%x \n",status); #endif // Start Auto Negotiation @@ -210,13 +210,13 @@ EthMode eth_enableAutoNegotiation() // Check auto negotiation completed if ((status & PHY_SR_ANEGC) != PHY_SR_ANEGC) { - debug_printf("autonegotiate failed. Status: %x\n", status); + hal_printf("autonegotiate failed. Status: %x\n", status); return ETHMODE_FAIL; } #if (DEBUG_TRACE) - debug_printf("Autonegotiate Complete SR:%x\n", status); + hal_printf("Autonegotiate Complete SR:%x\n", status); #endif #if STM32F4_ETH_PHY_MII diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_rx_desc.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_rx_desc.cpp index 31e2c490e..97fd689ad 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_rx_desc.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_rx_desc.cpp @@ -122,7 +122,7 @@ void eth_initRxDescriptors() } #if DEBUG_RX_DESC - debug_printf("----- After init RX desc -----\r\n"); + hal_printf("----- After init RX desc -----\r\n"); eth_displayRxDescStatus(); #endif @@ -282,7 +282,7 @@ void eth_displayRxDescStatus() for (uint32_t i = 0; i < N_RX_DESC; i++) { - debug_printf("%d: 0x%08x %s\r\n", i, s_rxDescriptor[i].rdes0, + hal_printf("%d: 0x%08x %s\r\n", i, s_rxDescriptor[i].rdes0, s_pRxDesc == &s_rxDescriptor[i] ? "<===" : ""); } } diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_tx_desc.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_tx_desc.cpp index 0fbc32268..c768a55da 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_tx_desc.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/STM32F4_ETH_tx_desc.cpp @@ -121,7 +121,7 @@ void eth_initTxDescriptor() } #if DEBUG_TX_DESC - debug_printf("----- After init TX desc -----\r\n"); + hal_printf("----- After init TX desc -----\r\n"); eth_displayTxDescStatus(); #endif @@ -220,9 +220,9 @@ void eth_displayTxDescStatus() for (uint32_t i = 0; i < N_TX_DESC; i++) { - debug_printf("tdes0: 0x%08x %s\r\n", s_txDescriptor[i].tdes0, + hal_printf("tdes0: 0x%08x %s\r\n", s_txDescriptor[i].tdes0, s_pTxDesc == &s_txDescriptor[i] ? "<===" : ""); - debug_printf("tdes1: 0x%08x\r\n", s_txDescriptor[i].tdes1); + hal_printf("tdes1: 0x%08x\r\n", s_txDescriptor[i].tdes1); } } #endif diff --git a/DeviceCode/Targets/Native/STM32F4/processor_selector.h b/DeviceCode/Targets/Native/STM32F4/processor_selector.h index d4a57fbb9..6e19af07e 100644 --- a/DeviceCode/Targets/Native/STM32F4/processor_selector.h +++ b/DeviceCode/Targets/Native/STM32F4/processor_selector.h @@ -66,12 +66,12 @@ ERROR - WE SHOULD NOT INCLUDE THIS HEADER IF NOT BUILDING AN STM32F2/F4 PLATFORM #endif #define ITM0 ConvertCOM_GenericHandle( ITM_GENERIC_PORTNUM ) -#define COM1 ConvertCOM_ComHandle(1) -#define COM2 ConvertCOM_ComHandle(2) -#define COM3 ConvertCOM_ComHandle(3) -#define COM4 ConvertCOM_ComHandle(4) -#define COM5 ConvertCOM_ComHandle(5) -#define COM6 ConvertCOM_ComHandle(6) +#define COM1 ConvertCOM_ComHandle(0) +#define COM2 ConvertCOM_ComHandle(1) +#define COM3 ConvertCOM_ComHandle(2) +#define COM4 ConvertCOM_ComHandle(3) +#define COM5 ConvertCOM_ComHandle(4) +#define COM6 ConvertCOM_ComHandle(5) #define USB1 ConvertCOM_UsbHandle(0) #define USB2 ConvertCOM_UsbHandle(1) diff --git a/DeviceCode/Targets/OS/CMSIS_RTOS/CpuOsIrq.h b/DeviceCode/Targets/OS/CMSIS_RTOS/CpuOsIrq.h index b66b7d5c8..6e98cd4c6 100644 --- a/DeviceCode/Targets/OS/CMSIS_RTOS/CpuOsIrq.h +++ b/DeviceCode/Targets/OS/CMSIS_RTOS/CpuOsIrq.h @@ -35,12 +35,14 @@ class CriticalSection { public: CriticalSection( ) - : Owner( NoOwner ) + : osMutexInitMember( MutexDef ) + , MutexId( 0 ) + , Owner( NoOwner ) , RefCount( 0 ) { - osMutexInitMember( MutexDef ); + osMutexConstructMember( MutexDef ); MutexId = osMutexCreate( osMutex( MutexDef ) ); - ASSERT( MutexId != NULL); + ASSERT( MutexId != NULL); } void lock( ) diff --git a/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/mutex b/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/mutex index 7be339b02..f293a3ea0 100644 --- a/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/mutex +++ b/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/mutex @@ -12,8 +12,10 @@ namespace std { public: recursive_mutex( ) + : MutexId( 0 ) + , osMutexInitMember( MutexDef ) { - osMutexInitMember( MutexDef ); + osMutexConstructMember( MutexDef ); MutexId = osMutexCreate( osMutex( MutexDef ) ); } diff --git a/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/sysarch_timeout.h b/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/sysarch_timeout.h index e7a3ae2b4..705179951 100644 --- a/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/sysarch_timeout.h +++ b/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/sysarch_timeout.h @@ -14,8 +14,8 @@ namespace lwIP { namespace SysArch { - typedef void (*TimerCallback) (void const *); - + typedef void (*TimerCallback) (void const *); + const uint64_t SystemTimeUnitsPerMicrosecond = 10; // HAL system time is in 100ns intervals const uint64_t SystemTimeUnitsPerMillisecond = 1000 * SystemTimeUnitsPerMicrosecond; @@ -36,7 +36,7 @@ namespace lwIP template< typename OsTimerT > class TimeoutCompare { - public: + public: // Compare this Timeout with the specified handler and arg // returns 0 if equal, negative value if this instance is less // and 1 if this instance is greater. @@ -49,7 +49,7 @@ namespace lwIP { return Compare( lhs, rhs.get_Handler(), rhs.get_Arg() ); } - + static int Compare( const OsTimerT& lhs, TimerCallback handler, void* arg ) { if( handler < lhs.get_Handler() ) @@ -81,7 +81,7 @@ namespace lwIP Timeout( sys_timeout_handler handler, void* arg ) : OsTimer( reinterpret_cast(handler), arg ) { - this->Initialize(); + this->Initialize(); } // To prevent the timer from triggering and attempting to call a partially diff --git a/DeviceCode/Targets/OS/CMSIS_RTOS/cmsis_os_cpp.h b/DeviceCode/Targets/OS/CMSIS_RTOS/cmsis_os_cpp.h index 0531ec354..d6a28c5b9 100644 --- a/DeviceCode/Targets/OS/CMSIS_RTOS/cmsis_os_cpp.h +++ b/DeviceCode/Targets/OS/CMSIS_RTOS/cmsis_os_cpp.h @@ -6,16 +6,17 @@ #define CMSIS_VERSION(m,mm) ( ( ( m )<< 16 ) | ( mm ) ) #if osCMSIS < CMSIS_VERSION(1, 2) -#error "Unsupported CMSIS version: This header requires a CMSIS implementation with at least version 1.2" +#error "Unsupported CMSIS version: This header requires a CMSIS-RTOS API implementation with at least version 1.2" #endif -#if osCMSIS_RTX < CMSIS_VERSION(4, 75) +#if !defined(osCMSIS_RTX) || osCMSIS_RTX != CMSIS_VERSION(4, 78) // unfortunately the implementation of the osXxxxDef and other similar macros // are implementation defined and, at least for CMSIS-RTX cannot be used to // declare a C++ data member. Thus, this header is specific to a particular // version of CMSIS-RTX and requires re-evaluation and verification on any -// later versions. -#error "Unsupported CMSIS-RTOS implementation: This header requires the CMSIS-RTX implementation of CMSIS-RTOS with version 4.75" +// other versions. The structures can and have changed even on minor version +// changes, so the check here is for an exact match on the supported version. +#error "Unsupported CMSIS-RTOS implementation: This header requires the CMSIS-RTX v4.78 implementation of the CMSIS-RTOS API" #endif // The following two fields are culled from the CMSIS-RTX header implementation @@ -25,17 +26,26 @@ uint32_t os_mutex_cb_##name[4]; /* = { 0 }; */\ osMutexDef_t os_mutex_def_##name/* = { (os_mutex_cb_##name) }*/ -// This variant of the standard CMSIS-RTOS macro allows use as a member initializer -// list for a constructor. +// This macro is used in the C++ class constructor initializer list to create +// default initialized members #define osMutexInitMember( name )\ + os_mutex_cb_##name()\ + ,os_mutex_def_##name() + +// This variant of the standard CMSIS-RTOS macro constructs a member +// since a standard constructor isn't available. +#define osMutexConstructMember( name )\ memset( &os_mutex_cb_##name, 0, sizeof( os_mutex_cb_##name ) );\ memset( &os_mutex_def_##name, 0, sizeof( os_mutex_def_##name ) );\ os_mutex_def_##name.mutex = &os_mutex_cb_##name +// This macor is used to define a timer instance as a member of a class or struct #define osTimerDefMember( name )\ - uint32_t os_timer_cb_##name[5]; /* = { 0 }*/\ + uint32_t os_timer_cb_##name[6]; /* = { 0 }*/\ osTimerDef_t os_timer_def_##name /* = { (function), (os_timer_cb_##name) }*/ +// This macro is used in the C++ class constructor initializer list to create +// initialized members #define osTimerInitMember( name )\ os_timer_cb_##name()\ ,os_timer_def_##name() @@ -43,13 +53,14 @@ // ARMCC 5.04 and earlier don't support C++11 initializer list syntax for member initialization // Therefore, this is used in the constructor to set the internal members as needed. #define osTimerConstructMember( name, function )\ + memset( &os_timer_cb_##name, 0, sizeof( os_timer_cb_##name ) );\ os_timer_def_##name.ptimer = function;\ os_timer_def_##name.timer = &os_timer_cb_##name namespace MsOpenTech { namespace CMSIS_RTOS - { + { class Timer { public: @@ -69,7 +80,7 @@ namespace MsOpenTech void Start( uint32_t initialTimeout, bool periodic ) { TimerId = osTimerCreate( osTimer(TimerDef), periodic ? osTimerPeriodic : osTimerOnce, CallbackArg ); - osTimerStart(TimerId, initialTimeout); + osTimerStart(TimerId, initialTimeout); } // C++11 move semantics not supported in the ARM compiler 5.04 and earlier diff --git a/DeviceCode/include/tinyhal.h b/DeviceCode/include/tinyhal.h index d0ffb014b..5342ef5ce 100644 --- a/DeviceCode/include/tinyhal.h +++ b/DeviceCode/include/tinyhal.h @@ -398,10 +398,17 @@ struct HAL_SYSTEM_CONFIG COM_HANDLE DebuggerPorts[c_MaxDebuggers]; COM_HANDLE MessagingPorts[c_MaxMessaging]; - + // communication channel for debug messages in the debugger + // which may be VS, MFDEPLOY, etc... Accessed via debug_printf + // in the HAL/PAL and System.Diagnostics.Debug.Print() in managed + // applications COM_HANDLE DebugTextPort; UINT32 USART_DefaultBaudRate; + // internal HAL/PAL debug/tracing channel, this is seperate + // to allow tracing messages in the driver that implements + // the transport for the Debugger and DebugTextPort. This + // channel is accessed via hal_printf() in the HAL/PAL COM_HANDLE stdio; HAL_SYSTEM_MEMORY_CONFIG RAM1; @@ -1449,16 +1456,16 @@ extern const ConfigurationSector g_ConfigurationSector; #if !defined(BUILD_RTM) -#define DEBUG_TRACE0(t, s) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s) ) -#define DEBUG_TRACE1(t, s, p1) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1) ) -#define DEBUG_TRACE2(t, s, p1,p2) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2) ) -#define DEBUG_TRACE3(t, s, p1,p2,p3) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3) ) -#define DEBUG_TRACE4(t, s, p1,p2,p3,p4) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4) ) -#define DEBUG_TRACE5(t, s, p1,p2,p3,p4,p5) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5) ) -#define DEBUG_TRACE6(t, s, p1,p2,p3,p4,p5,p6) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6) ) -#define DEBUG_TRACE7(t, s, p1,p2,p3,p4,p5,p6,p7) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7) ) -#define DEBUG_TRACE8(t, s, p1,p2,p3,p4,p5,p6,p7,p8) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8) ) -#define DEBUG_TRACE9(t, s, p1,p2,p3,p4,p5,p6,p7,p8,p9) if(((t) & DEBUG_TRACE) != 0) debug_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8),(p9) ) +#define DEBUG_TRACE0(t, s) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s) ) +#define DEBUG_TRACE1(t, s, p1) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1) ) +#define DEBUG_TRACE2(t, s, p1,p2) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2) ) +#define DEBUG_TRACE3(t, s, p1,p2,p3) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3) ) +#define DEBUG_TRACE4(t, s, p1,p2,p3,p4) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4) ) +#define DEBUG_TRACE5(t, s, p1,p2,p3,p4,p5) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5) ) +#define DEBUG_TRACE6(t, s, p1,p2,p3,p4,p5,p6) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6) ) +#define DEBUG_TRACE7(t, s, p1,p2,p3,p4,p5,p6,p7) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7) ) +#define DEBUG_TRACE8(t, s, p1,p2,p3,p4,p5,p6,p7,p8) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8) ) +#define DEBUG_TRACE9(t, s, p1,p2,p3,p4,p5,p6,p7,p8,p9) if(((t) & DEBUG_TRACE) != 0) hal_printf( (s), (p1),(p2),(p3),(p4),(p5),(p6),(p7),(p8),(p9) ) #else diff --git a/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/lwIP__Sockets.cpp b/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/lwIP__Sockets.cpp index 219d85312..80447c854 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/lwIP__Sockets.cpp +++ b/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/lwIP__Sockets.cpp @@ -563,22 +563,13 @@ int LWIP_SOCKETS_Driver::SetSockOpt( SOCK_SOCKET socket, int level, int optname, switch(optname) { - // LINGER is not implemented in LWIP + // LINGER and DONTLINGER are not implemented in LWIP case SOCK_SOCKO_LINGER: - if (*(int*)optval) - { - errno = SOCK_ENOPROTOOPT; - return SOCK_SOCKET_ERROR; - } - return 0; + errno = SOCK_ENOPROTOOPT; + return SOCK_SOCKET_ERROR; case SOCK_SOCKO_DONTLINGER: - if (!*(int*)optval) - { - errno = SOCK_ENOPROTOOPT; - return SOCK_SOCKET_ERROR; - } - return 0; - + errno = SOCK_ENOPROTOOPT; + return SOCK_SOCKET_ERROR; // ignore this item to enable http to work case SOCK_SOCKO_REUSEADDRESS: return 0; @@ -627,13 +618,13 @@ int LWIP_SOCKETS_Driver::GetSockOpt( SOCK_SOCKET socket, int level, int optname, nativeOptionName = GetNativeSockOption(optname); switch(optname) { - // LINGER is not implemented in LWIP + // LINGER and DONTLINGER are not implemented in LWIP case SOCK_SOCKO_LINGER: - *optval = 0; - return 0; + errno = SOCK_ENOPROTOOPT; + return SOCK_SOCKET_ERROR; case SOCK_SOCKO_DONTLINGER: - *optval = 1; - return 0; + errno = SOCK_ENOPROTOOPT; + return SOCK_SOCKET_ERROR; default: break; } @@ -803,7 +794,7 @@ HRESULT LWIP_SOCKETS_Driver::UpdateAdapterConfiguration( UINT32 interfaceIndex, } BOOL fEnableDhcp = (0 != (config->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DHCP)); - //BOOL fDynamicDns = (0 != (config->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DYNAMIC_DNS)); + BOOL fDynamicDns = (0 != (config->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DYNAMIC_DNS)); BOOL fDhcpStarted; struct netif *pNetIf = netif_find_interface(g_LWIP_SOCKETS_Driver.m_interfaces[interfaceIndex].m_interfaceNumber); @@ -814,30 +805,12 @@ HRESULT LWIP_SOCKETS_Driver::UpdateAdapterConfiguration( UINT32 interfaceIndex, fDhcpStarted = (0 != (pNetIf->flags & NETIF_FLAG_DHCP)); -// TODO Disable a separate option for dynamic DNS for now. #if LWIP_DNS // when using DHCP do not use the static settings if(0 != (updateFlags & SOCK_NETWORKCONFIGURATION_UPDATE_DNS)) { - //// if dynamic dns is on, then we will set the corresonding NetIF flag - //// resetting dhcp if necessary. - //if(fDynamicDns || (config->dnsServer1 == 0 && config->dnsServer2 == 0)) - //{ - // if(0 == (pNetIf->flagsExt & NETIF_FLAG_EXT_DYNAMIC_DNS)) - // { - // pNetIf->flagsExt |= NETIF_FLAG_EXT_DYNAMIC_DNS; - - // // if dhcp is active, we need to reset in order to get the dynamic - // // dns - // if(fEnableDhcp && fDhcpStarted) - // { - // dhcp_stop(pNetIf); - // dhcp_start(pNetIf); - // } - // } - //} - //else - //{ + if(!fDynamicDns && (config->dnsServer1 != 0 || config->dnsServer2 != 0)) + { // user defined DNS addresses if(config->dnsServer1 != 0) { @@ -851,9 +824,7 @@ HRESULT LWIP_SOCKETS_Driver::UpdateAdapterConfiguration( UINT32 interfaceIndex, dns_setserver(idx, (struct ip_addr *)&config->dnsServer2); } - - // pNetIf->flagsExt &= ~NETIF_FLAG_EXT_DYNAMIC_DNS; - //} + } } #endif diff --git a/Framework/CorDebug/VsPackage.cs b/Framework/CorDebug/VsPackage.cs index d55b74062..881112c91 100644 --- a/Framework/CorDebug/VsPackage.cs +++ b/Framework/CorDebug/VsPackage.cs @@ -63,7 +63,6 @@ internal interface IVsMicrosoftInstalledProduct , TemplateIDsVsTemplate=VsPackage.VbTemplateIds ) ] - [ProvideExpressLoadKey( "4.3.0.0", "Microsoft .NET Micro Framework SDK", "Microsoft Corporation", VsWinExpressId=1001 )] [ProvideObject( typeof( PropertyPageComObject ) )] [ProvideObject( typeof( CorDebug ) )] [ProvideDebugEngine] diff --git a/Framework/CorDebug/vs12/cordebugvs12.csproj b/Framework/CorDebug/vs12/cordebugvs12.csproj index 40cec0a82..97a53e9d5 100644 --- a/Framework/CorDebug/vs12/cordebugvs12.csproj +++ b/Framework/CorDebug/vs12/cordebugvs12.csproj @@ -181,6 +181,12 @@ {d9dca6fb-680f-4355-abef-128db02721e6} Debugger + False + + + {daeb83a4-5868-4725-a15d-85f75db87eac} + WinUsb + False diff --git a/Framework/CorDebug/vs12/source.extension.vsixmanifest b/Framework/CorDebug/vs12/source.extension.vsixmanifest index e8bc367c6..609f83652 100644 --- a/Framework/CorDebug/vs12/source.extension.vsixmanifest +++ b/Framework/CorDebug/vs12/source.extension.vsixmanifest @@ -13,7 +13,6 @@ - diff --git a/Framework/CorDebug/vs14/cordebugvs14.csproj b/Framework/CorDebug/vs14/cordebugvs14.csproj index cf4562981..b30491267 100644 --- a/Framework/CorDebug/vs14/cordebugvs14.csproj +++ b/Framework/CorDebug/vs14/cordebugvs14.csproj @@ -188,6 +188,12 @@ {d9dca6fb-680f-4355-abef-128db02721e6} Debugger + False + + + {daeb83a4-5868-4725-a15d-85f75db87eac} + WinUsb + False diff --git a/Framework/CorDebug/vs14/cordebugvs14.sln b/Framework/CorDebug/vs14/cordebugvs14.sln index 343de36d9..febfe2b17 100644 --- a/Framework/CorDebug/vs14/cordebugvs14.sln +++ b/Framework/CorDebug/vs14/cordebugvs14.sln @@ -1,21 +1,37 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.22823.1 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetmfVS14", "NetmfVS14.csproj", "{F15F8516-14E8-4CE2-8810-59CB869E1C38}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cordebugvs14", "cordebugvs14.csproj", "{B4C10D84-59C4-48EE-A62B-9DA56A2E9681}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger", "..\..\Debugger\Debugger.csproj", "{D9DCA6FB-680F-4355-ABEF-128DB02721E6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUsb", "..\..\Debugger\WinUsb\WinUsb.csproj", "{DAEB83A4-5868-4725-A15D-85F75DB87EAC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClassTemplateProject", "..\..\..\Product\AllSDK\ItemTemplates\CSharp\Class\ClassTemplateProject.csproj", "{32FD8868-BC4E-4810-B811-66CF6B38FA02}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExeTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\CSharp\ExeTemplate\ExeTemplateProject.csproj", "{08FF08A7-6883-4875-BBC5-5F9405D59B4D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\CSharp\WinTemplate\WinTemplateProject.csproj", "{D300D44B-0B0F-450F-B4A1-D4DCE9590F88}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\CSharp\LibTemplate\LibTemplateProject.csproj", "{0F0DFBB2-249D-4769-BF7D-29885153CF87}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\CSharp\WinTemplate\WinTemplateProject.csproj", "{D300D44B-0B0F-450F-B4A1-D4DCE9590F88}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp Templates", "CSharp Templates", "{77AA22F3-7971-4C7D-B741-BE7D58CA5B0B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetmfVS14", "NetmfVS14.csproj", "{F15F8516-14E8-4CE2-8810-59CB869E1C38}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "VB Templates", "VB Templates", "{B38D2886-E83D-416F-BA54-03AA6378E508}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger", "..\..\Debugger\Debugger.csproj", "{D9DCA6FB-680F-4355-ABEF-128DB02721E6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBClassTemplateProject", "..\..\..\Product\AllSDK\ItemTemplates\VisualBasic\Class\VBClassTemplateProject.csproj", "{64BB93E1-F7F1-425E-89BF-1BDECEF523AC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUsb", "..\..\Debugger\WinUsb\WinUsb.csproj", "{DAEB83A4-5868-4725-A15D-85F75DB87EAC}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBExeTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\VB\ExeTemplate\VBExeTemplateProject.csproj", "{898B220F-11FF-400D-B40C-588CF06DF856}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBLibTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\VB\LibTemplate\VBLibTemplateProject.csproj", "{BC660833-4208-4D3E-B744-4AD17D502F8E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VBWinTemplateProject", "..\..\..\Product\AllSDK\ProjectTemplates\VB\WinTemplate\VBWinTemplateProject.csproj", "{517662A3-1886-4811-818E-AB0333447656}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssemblyInfoTemplateProject", "..\..\..\Product\AllSDK\ItemTemplates\CSharp\AssemblyInfo\AssemblyInfoTemplateProject.csproj", "{422D820B-8B80-4FF1-9828-3AB113C2ABC0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,36 +39,71 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B4C10D84-59C4-48EE-A62B-9DA56A2E9681}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {B4C10D84-59C4-48EE-A62B-9DA56A2E9681}.Debug|Any CPU.Build.0 = Release|Any CPU + {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Release|Any CPU.Build.0 = Release|Any CPU + {B4C10D84-59C4-48EE-A62B-9DA56A2E9681}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B4C10D84-59C4-48EE-A62B-9DA56A2E9681}.Debug|Any CPU.Build.0 = Debug|Any CPU {B4C10D84-59C4-48EE-A62B-9DA56A2E9681}.Release|Any CPU.ActiveCfg = Release|Any CPU {B4C10D84-59C4-48EE-A62B-9DA56A2E9681}.Release|Any CPU.Build.0 = Release|Any CPU + {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Release|Any CPU.Build.0 = Release|Any CPU + {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Release|Any CPU.Build.0 = Release|Any CPU + {32FD8868-BC4E-4810-B811-66CF6B38FA02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32FD8868-BC4E-4810-B811-66CF6B38FA02}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32FD8868-BC4E-4810-B811-66CF6B38FA02}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32FD8868-BC4E-4810-B811-66CF6B38FA02}.Release|Any CPU.Build.0 = Release|Any CPU {08FF08A7-6883-4875-BBC5-5F9405D59B4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {08FF08A7-6883-4875-BBC5-5F9405D59B4D}.Debug|Any CPU.Build.0 = Debug|Any CPU {08FF08A7-6883-4875-BBC5-5F9405D59B4D}.Release|Any CPU.ActiveCfg = Release|Any CPU {08FF08A7-6883-4875-BBC5-5F9405D59B4D}.Release|Any CPU.Build.0 = Release|Any CPU - {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Release|Any CPU.Build.0 = Release|Any CPU {D300D44B-0B0F-450F-B4A1-D4DCE9590F88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D300D44B-0B0F-450F-B4A1-D4DCE9590F88}.Debug|Any CPU.Build.0 = Debug|Any CPU {D300D44B-0B0F-450F-B4A1-D4DCE9590F88}.Release|Any CPU.ActiveCfg = Release|Any CPU {D300D44B-0B0F-450F-B4A1-D4DCE9590F88}.Release|Any CPU.Build.0 = Release|Any CPU - {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F15F8516-14E8-4CE2-8810-59CB869E1C38}.Release|Any CPU.Build.0 = Release|Any CPU - {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {D9DCA6FB-680F-4355-ABEF-128DB02721E6}.Release|Any CPU.Build.0 = Debug|Any CPU - {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {DAEB83A4-5868-4725-A15D-85F75DB87EAC}.Release|Any CPU.Build.0 = Debug|Any CPU + {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0F0DFBB2-249D-4769-BF7D-29885153CF87}.Release|Any CPU.Build.0 = Release|Any CPU + {64BB93E1-F7F1-425E-89BF-1BDECEF523AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {64BB93E1-F7F1-425E-89BF-1BDECEF523AC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {64BB93E1-F7F1-425E-89BF-1BDECEF523AC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {64BB93E1-F7F1-425E-89BF-1BDECEF523AC}.Release|Any CPU.Build.0 = Release|Any CPU + {898B220F-11FF-400D-B40C-588CF06DF856}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {898B220F-11FF-400D-B40C-588CF06DF856}.Debug|Any CPU.Build.0 = Debug|Any CPU + {898B220F-11FF-400D-B40C-588CF06DF856}.Release|Any CPU.ActiveCfg = Release|Any CPU + {898B220F-11FF-400D-B40C-588CF06DF856}.Release|Any CPU.Build.0 = Release|Any CPU + {BC660833-4208-4D3E-B744-4AD17D502F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC660833-4208-4D3E-B744-4AD17D502F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC660833-4208-4D3E-B744-4AD17D502F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC660833-4208-4D3E-B744-4AD17D502F8E}.Release|Any CPU.Build.0 = Release|Any CPU + {517662A3-1886-4811-818E-AB0333447656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {517662A3-1886-4811-818E-AB0333447656}.Debug|Any CPU.Build.0 = Debug|Any CPU + {517662A3-1886-4811-818E-AB0333447656}.Release|Any CPU.ActiveCfg = Release|Any CPU + {517662A3-1886-4811-818E-AB0333447656}.Release|Any CPU.Build.0 = Release|Any CPU + {422D820B-8B80-4FF1-9828-3AB113C2ABC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {422D820B-8B80-4FF1-9828-3AB113C2ABC0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {422D820B-8B80-4FF1-9828-3AB113C2ABC0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {422D820B-8B80-4FF1-9828-3AB113C2ABC0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {32FD8868-BC4E-4810-B811-66CF6B38FA02} = {77AA22F3-7971-4C7D-B741-BE7D58CA5B0B} + {08FF08A7-6883-4875-BBC5-5F9405D59B4D} = {77AA22F3-7971-4C7D-B741-BE7D58CA5B0B} + {D300D44B-0B0F-450F-B4A1-D4DCE9590F88} = {77AA22F3-7971-4C7D-B741-BE7D58CA5B0B} + {0F0DFBB2-249D-4769-BF7D-29885153CF87} = {77AA22F3-7971-4C7D-B741-BE7D58CA5B0B} + {64BB93E1-F7F1-425E-89BF-1BDECEF523AC} = {B38D2886-E83D-416F-BA54-03AA6378E508} + {898B220F-11FF-400D-B40C-588CF06DF856} = {B38D2886-E83D-416F-BA54-03AA6378E508} + {BC660833-4208-4D3E-B744-4AD17D502F8E} = {B38D2886-E83D-416F-BA54-03AA6378E508} + {517662A3-1886-4811-818E-AB0333447656} = {B38D2886-E83D-416F-BA54-03AA6378E508} + {422D820B-8B80-4FF1-9828-3AB113C2ABC0} = {77AA22F3-7971-4C7D-B741-BE7D58CA5B0B} + EndGlobalSection EndGlobal diff --git a/Framework/CorDebug/vs14/source.extension.vsixmanifest b/Framework/CorDebug/vs14/source.extension.vsixmanifest index 76df9e2f0..a6a6abfa6 100644 --- a/Framework/CorDebug/vs14/source.extension.vsixmanifest +++ b/Framework/CorDebug/vs14/source.extension.vsixmanifest @@ -3,7 +3,7 @@ .NET Micro Framework project system - Visual Studio Next(VS14 CTP) Project System for the .NET Micro Framework + Visual Studio 2015 Project System for the .NET Micro Framework http://www.netmf.com License.rtf http://www.netmf.com @@ -13,7 +13,6 @@ - @@ -21,7 +20,7 @@ - + diff --git a/Framework/Debugger/Debugger.csproj b/Framework/Debugger/Debugger.csproj index 0b6a249c0..20e3e096c 100644 --- a/Framework/Debugger/Debugger.csproj +++ b/Framework/Debugger/Debugger.csproj @@ -24,6 +24,7 @@ SAK SAK SAK + $(BUILD_TREE_SERVER)\DLL\ false @@ -33,6 +34,18 @@ Debugger.ruleset false + + true + bin\Release\ + ,DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + true + ,1591,1668,1762 + full + AnyCPU + false + Debugger.ruleset + @@ -103,11 +116,11 @@ $(BUILD_TREE_SERVER)\DLL\Microsoft.SPOT.Tasks.dll - true + false $(BUILD_TREE_SERVER)\DLL\WinUsbInvoke.dll - true + false diff --git a/Framework/Debugger/DebuggerEventSource.cs b/Framework/Debugger/DebuggerEventSource.cs index 3179db1c1..33877fb1a 100644 --- a/Framework/Debugger/DebuggerEventSource.cs +++ b/Framework/Debugger/DebuggerEventSource.cs @@ -4,26 +4,164 @@ namespace Microsoft.SPOT.Debugger { using System; using System.Diagnostics.Tracing; - using Microsoft.SPOT.Debugger.WireProtocol; + using WireProtocol; + using System.Collections.Generic; - [EventSource( Name="MsOpenTech-NETMF-Debugger")] + [EventSource( Name="Microsoft-NETMF-Debugger")] internal class DebuggerEventSource : EventSource { public static DebuggerEventSource Log { get { return Log_.Value; } } private static readonly Lazy Log_ = new Lazy( ()=>new DebuggerEventSource() ); - [Event(1, Opcode=EventOpcode.Send )] - public void WireProtocolTxHeader( uint cmd, uint flags, ushort seq, ushort seqReply ) +#if TRACE + [Flags] + enum PacketFlags { - Trace.TraceInformation( "TX: {0:X08} {1:X08} {2:X04} {3:X04}", cmd, flags, seq, seqReply ); - WriteCustomEvent( 1, cmd, flags, seq, seqReply ); + None = 0, + NonCritical = 0x0001, // This doesn't need an acknowledge. + Reply = 0x0002, // This is the result of a command. + BadHeader = 0x0004, + BadPayload = 0x0008, + Spare0010 = 0x0010, + Spare0020 = 0x0020, + Spare0040 = 0x0040, + Spare0080 = 0x0080, + Spare0100 = 0x0100, + Spare0200 = 0x0200, + Spare0400 = 0x0400, + Spare0800 = 0x0800, + Spare1000 = 0x1000, + NoCaching = 0x2000, + NACK = 0x4000, + ACK = 0x8000, + } + + private static Dictionary CommandNameMap = new Dictionary + { + [ Commands.c_Monitor_Ping ] = "Ping", + [ Commands.c_Monitor_Message ] = "Message", + [ Commands.c_Monitor_ReadMemory ] = "ReadMemory", + [ Commands.c_Monitor_WriteMemory ] = "WriteMemory", + [ Commands.c_Monitor_CheckMemory ] = "CheckMemory", + [ Commands.c_Monitor_EraseMemory ] = "EraseMemory", + [ Commands.c_Monitor_Execute ] = "Execute", + [ Commands.c_Monitor_Reboot ] = "Reboot", + [ Commands.c_Monitor_MemoryMap ] = "MemoryMap", + [ Commands.c_Monitor_ProgramExit ] = "ProgramExit", + [ Commands.c_Monitor_CheckSignature ] = "CheckSignature", + [ Commands.c_Monitor_DeploymentMap ] = "DeploymentMap", + [ Commands.c_Monitor_FlashSectorMap ] = "FlashSectorMap", + [ Commands.c_Monitor_SignatureKeyUpdate ] = "SignatureKeyUpdate", + [ Commands.c_Monitor_OemInfo ] = "OemInfo", + [ Commands.c_Debugging_Execution_BasePtr ] = "Execution_BasePtr", + [ Commands.c_Debugging_Execution_ChangeConditions ] = "Execution_ChangeConditions", + [ Commands.c_Debugging_Execution_SecurityKey ] = "Execution_SecurityKey", + [ Commands.c_Debugging_Execution_Unlock ] = "Execution_Unlock", + [ Commands.c_Debugging_Execution_Allocate ] = "Execution_Allocate", + [ Commands.c_Debugging_Execution_Breakpoints ] = "Execution_Breakpoints", + [ Commands.c_Debugging_Execution_BreakpointHit ] = "Execution_BreakpointHit", + [ Commands.c_Debugging_Execution_BreakpointStatus ] = "Execution_BreakpointStatus", + [ Commands.c_Debugging_Execution_QueryCLRCapabilities ] = "Execution_QueryCLRCapabilities", + [ Commands.c_Debugging_Execution_SetCurrentAppDomain ] = "Execution_SetCurrentAppDomain", + [ Commands.c_Debugging_Thread_Create ] = "Thread_Create", + [ Commands.c_Debugging_Thread_List ] = "Thread_List", + [ Commands.c_Debugging_Thread_Stack ] = "Thread_Stack", + [ Commands.c_Debugging_Thread_Kill ] = "Thread_Kill", + [ Commands.c_Debugging_Thread_Suspend ] = "Thread_Suspend", + [ Commands.c_Debugging_Thread_Resume ] = "Thread_Resume", + [ Commands.c_Debugging_Thread_GetException ] = "Thread_GetException", + [ Commands.c_Debugging_Thread_Unwind ] = "Thread_Unwind", + [ Commands.c_Debugging_Thread_CreateEx ] = "Thread_CreateEx", + [ Commands.c_Debugging_Thread_Get ] = "Thread_Get", + [ Commands.c_Debugging_Stack_Info ] = "Stack_Info", + [ Commands.c_Debugging_Stack_SetIP ] = "Stack_SetIP", + [ Commands.c_Debugging_Value_ResizeScratchPad ] = "Value_ResizeScratchPad", + [ Commands.c_Debugging_Value_GetStack ] = "Value_GetStack", + [ Commands.c_Debugging_Value_GetField ] = "Value_GetField", + [ Commands.c_Debugging_Value_GetArray ] = "Value_GetArray", + [ Commands.c_Debugging_Value_GetBlock ] = "Value_GetBlock", + [ Commands.c_Debugging_Value_GetScratchPad ] = "Value_GetScratchPad", + [ Commands.c_Debugging_Value_SetBlock ] = "Value_SetBlock", + [ Commands.c_Debugging_Value_SetArray ] = "Value_SetArray", + [ Commands.c_Debugging_Value_AllocateObject ] = "Value_AllocateObject", + [ Commands.c_Debugging_Value_AllocateString ] = "Value_AllocateString", + [ Commands.c_Debugging_Value_AllocateArray ] = "Value_AllocateArray", + [ Commands.c_Debugging_Value_Assign ] = "Value_Assign", + [ Commands.c_Debugging_TypeSys_Assemblies ] = "TypeSys_Assemblies", + [ Commands.c_Debugging_TypeSys_AppDomains ] = "TypeSys_AppDomains", + [ Commands.c_Debugging_Resolve_Assembly ] = "Resolve_Assembly", + [ Commands.c_Debugging_Resolve_Type ] = "Resolve_Type", + [ Commands.c_Debugging_Resolve_Field ] = "Resolve_Field", + [ Commands.c_Debugging_Resolve_Method ] = "Resolve_Method", + [ Commands.c_Debugging_Resolve_VirtualMethod ] = "Resolve_VirtualMethod", + [ Commands.c_Debugging_Resolve_AppDomain ] = "Resolve_AppDomain", + [ Commands.c_Debugging_MFUpdate_Start ] = "MFUpdate_Start", + [ Commands.c_Debugging_MFUpdate_AddPacket ] = "MFUpdate_AddPacket", + [ Commands.c_Debugging_MFUpdate_Install ] = "MFUpdate_Install", + [ Commands.c_Debugging_MFUpdate_AuthCmd ] = "MFUpdate_AuthCmd", + [ Commands.c_Debugging_MFUpdate_Authenticate ] = "MFUpdate_Authenticate", + [ Commands.c_Debugging_MFUpdate_GetMissingPkts ] = "MFUpdate_GetMissingPkts", + [ Commands.c_Debugging_UpgradeToSsl ] = "UpgradeToSsl", + [ Commands.c_Debugging_Lcd_NewFrame ] = "Lcd_NewFrame", + [ Commands.c_Debugging_Lcd_NewFrameData ] = "Lcd_NewFrameData", + [ Commands.c_Debugging_Lcd_GetFrame ] = "Lcd_GetFrame", + [ Commands.c_Debugging_Button_Report ] = "Button_Report", + [ Commands.c_Debugging_Button_Inject ] = "Button_Inject", + [ Commands.c_Debugging_Messaging_Query ] = "Messaging_Query", + [ Commands.c_Debugging_Messaging_Send ] = "Messaging_Send", + [ Commands.c_Debugging_Messaging_Reply ] = "Messaging_Reply", + [ Commands.c_Debugging_Logging_GetNumberOfRecords ] = "Logging_GetNumberOfRecords", + [ Commands.c_Debugging_Logging_GetRecord ] = "Logging_GetRecord", + [ Commands.c_Debugging_Logging_Erase ] = "Logging_Erase", + [ Commands.c_Debugging_Logging_GetRecords ] = "Logging_GetRecords", + [ Commands.c_Debugging_Deployment_Status ] = "Deployment_Status", + [ Commands.c_Debugging_Info_SetJMC ] = "Info_SetJMC", + [ Commands.c_Profiling_Command ] = "Profiling_Command", + [ Commands.c_Profiling_Stream ] = "Profiling_Stream" + }; + + string GetCommandName( uint cmd ) + { + string retVal; + if( !CommandNameMap.TryGetValue( cmd, out retVal ) ) + retVal = $"0x{cmd:X08}"; + + return retVal; + } +#endif + + [Event( 1, Opcode = EventOpcode.Send )] + public void WireProtocolTxHeader( uint crcHeader, uint crcData, uint cmd, uint flags, ushort seq, ushort seqReply, uint length ) + { +#if TRACE + Trace.TraceInformation( "TX: {0} flags=[{1}] hCRC: 0x{2:X08} pCRC: 0x{3:X08} seq: 0x{4:X04} replySeq: 0x{5:X04} len={6}" + , GetCommandName( cmd ) + , ( PacketFlags )flags + , crcHeader + , crcData + , seq + , seqReply + , length + ); +#endif + WriteCustomEvent( 1, crcHeader, crcData, cmd, flags, seq, seqReply, length ); } [Event( 2, Opcode = EventOpcode.Receive )] - public void WireProtocolRxHeader( uint cmd, uint flags, ushort seq, ushort seqReply ) + public void WireProtocolRxHeader( uint crcHeader, uint crcData, uint cmd, uint flags, ushort seq, ushort seqReply, uint length ) { - Trace.TraceInformation( "RX: {0:X08} {1:X08} {2:X04} {3:X04}", cmd, flags, seq, seqReply ); - WriteCustomEvent( 2, cmd, flags, seq, seqReply ); +#if TRACE + Trace.TraceInformation( "RX: {0} flags=[{1}] hCRC: 0x{2:X08} pCRC: 0x{3:X08} seq: 0x{4:X04} replySeq: 0x{5:X04} len={6}" + , GetCommandName( cmd ) + , ( PacketFlags )flags + , crcHeader + , crcData + , seq + , seqReply + , length + ); +#endif + WriteCustomEvent( 2, crcHeader, crcData, cmd, flags, seq, seqReply, length ); } [Event( 3 )] @@ -35,27 +173,47 @@ public void WireProtocolReceiveState( MessageReassembler.ReceiveState state ) [Event(4)] public void EngineEraseMemory( uint address, uint length ) { - Trace.TraceInformation( "EreaseMemory: @{0:X08}; LEN={1:X08}", address, length ); + Trace.TraceInformation( "EraseMemory: @0x{0:X08}; LEN=0x{1:X08}", address, length ); WriteEvent( 4, ( int )address, ( int )length ); } + [Event(5)] + public void EngineWriteMemory( uint address, int length ) + { + Trace.TraceInformation( "WriteMemory: @0x{0:X08}; LEN=0x{1:X08}", address, length ); + WriteEvent( 5, ( int )address, length ); + } + private DebuggerEventSource() { } [NonEvent] - unsafe void WriteCustomEvent(int eventId, uint cmd, uint flags, ushort seq, ushort seqReply ) - { - EventData* pDataDesc = stackalloc EventData[ 4 ]; - pDataDesc[ 0 ].DataPointer = (IntPtr)( &cmd ); - pDataDesc[ 0 ].Size = sizeof( int ); - pDataDesc[ 1 ].DataPointer = ( IntPtr )( &flags ); - pDataDesc[ 1 ].Size = sizeof( int ); - pDataDesc[ 2 ].DataPointer = ( IntPtr )( &seq ); - pDataDesc[ 2 ].Size = sizeof( ushort ); - pDataDesc[ 3 ].DataPointer = ( IntPtr )( &seqReply ); - pDataDesc[ 3 ].Size = sizeof( ushort ); - WriteEventCore( eventId, 4, pDataDesc ); + unsafe void WriteCustomEvent( int eventId, uint crcHeader, uint crcData, uint cmd, uint flags, ushort seq, ushort seqReply, uint length ) + { + EventData* pDataDesc = stackalloc EventData[ 7 ]; + pDataDesc[ 0 ].DataPointer = ( IntPtr )( &crcHeader ); + pDataDesc[ 0 ].Size = sizeof( uint ); + + pDataDesc[ 1 ].DataPointer = ( IntPtr )( &crcData ); + pDataDesc[ 1 ].Size = sizeof( uint ); + + pDataDesc[ 2 ].DataPointer = (IntPtr)( &cmd ); + pDataDesc[ 2 ].Size = sizeof( uint ); + + pDataDesc[ 3 ].DataPointer = ( IntPtr )( &flags ); + pDataDesc[ 3 ].Size = sizeof( uint ); + + pDataDesc[ 4 ].DataPointer = ( IntPtr )( &seq ); + pDataDesc[ 4 ].Size = sizeof( ushort ); + + pDataDesc[ 5 ].DataPointer = ( IntPtr )( &seqReply ); + pDataDesc[ 5 ].Size = sizeof( ushort ); + + pDataDesc[ 6 ].DataPointer = ( IntPtr )( &length ); + pDataDesc[ 6 ].Size = sizeof( uint ); + + WriteEventCore( eventId, 7, pDataDesc ); } } } diff --git a/Framework/Debugger/WinUsb/WinUsb.csproj b/Framework/Debugger/WinUsb/WinUsb.csproj index 05679954e..3d36bc283 100644 --- a/Framework/Debugger/WinUsb/WinUsb.csproj +++ b/Framework/Debugger/WinUsb/WinUsb.csproj @@ -1,26 +1,38 @@  - + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(FLAVOR_WIN) - SAK - SAK - SAK - SAK + v4.5 + + WinUsbInvoke + Library + WinUsb + {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 9.0.21022 2.0 {DAEB83A4-5868-4725-A15D-85F75DB87EAC} - {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} {aa03c31f-e697-4668-9206-3b2cc39e8a44} ToolsDir - Library Library Properties - WinUsb - WinUsbInvoke + SAK + SAK + SAK + SAK + $(BUILD_TREE_SERVER)\DLL\ + + + true + bin\Release\ + ,DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + ,1668,1762 + full + AnyCPU + MinimumRecommendedRules.ruleset diff --git a/Framework/Debugger/WireProtocol/Engine.cs b/Framework/Debugger/WireProtocol/Engine.cs index 1e45d13a3..875e777e2 100644 --- a/Framework/Debugger/WireProtocol/Engine.cs +++ b/Framework/Debugger/WireProtocol/Engine.cs @@ -1659,6 +1659,7 @@ public bool WriteMemory( uint address, byte[ ] buf, int offset, int length ) cmd.PrepareForSend( address, buf, pos, len ); + DebuggerEventSource.Log.EngineWriteMemory( address, len ); IncomingMessage reply = SyncMessage( Commands.c_Monitor_WriteMemory, 0, cmd ); if( !IncomingMessage.IsPositiveAcknowledge( reply ) ) diff --git a/Framework/Debugger/WireProtocol/MessageReassembler.cs b/Framework/Debugger/WireProtocol/MessageReassembler.cs index 97f7b54c7..92419845e 100644 --- a/Framework/Debugger/WireProtocol/MessageReassembler.cs +++ b/Framework/Debugger/WireProtocol/MessageReassembler.cs @@ -126,7 +126,7 @@ internal void Process() { bool fReply = (m_base.m_header.m_flags & Flags.c_Reply) != 0; - DebuggerEventSource.Log.WireProtocolRxHeader( m_base.m_header.m_cmd, m_base.m_header.m_flags, m_base.m_header.m_seq, m_base.m_header.m_seqReply ); + DebuggerEventSource.Log.WireProtocolRxHeader( m_base.m_header.m_crcHeader, m_base.m_header.m_crcData, m_base.m_header.m_cmd, m_base.m_header.m_flags, m_base.m_header.m_seq, m_base.m_header.m_seqReply, m_base.m_header.m_size ); if(m_base.m_header.m_size != 0) { diff --git a/Framework/Debugger/WireProtocol/OutgoingMessage.cs b/Framework/Debugger/WireProtocol/OutgoingMessage.cs index 1e40adb2a..d1b1ec09f 100644 --- a/Framework/Debugger/WireProtocol/OutgoingMessage.cs +++ b/Framework/Debugger/WireProtocol/OutgoingMessage.cs @@ -43,7 +43,14 @@ public bool Send() { try { - DebuggerEventSource.Log.WireProtocolTxHeader( m_base.m_header.m_cmd, m_base.m_header.m_flags, m_base.m_header.m_seq, m_base.m_header.m_seqReply ); + DebuggerEventSource.Log.WireProtocolTxHeader( m_base.m_header.m_crcHeader + , m_base.m_header.m_crcData + , m_base.m_header.m_cmd + , m_base.m_header.m_flags + , m_base.m_header.m_seq + , m_base.m_header.m_seqReply + , m_base.m_header.m_size + ); return m_parent.QueueOutput( m_raw ); } catch diff --git a/Framework/Subset_of_CorLib/System/DateTime.cs b/Framework/Subset_of_CorLib/System/DateTime.cs index c942a3b8d..e44ffcee1 100644 --- a/Framework/Subset_of_CorLib/System/DateTime.cs +++ b/Framework/Subset_of_CorLib/System/DateTime.cs @@ -35,17 +35,7 @@ public enum DateTimeKind * This value type represents a date and time. Every DateTime * object has a private field (Ticks) of type Int64 that stores the * date and time as the number of 100 nanosecond intervals since - * 12:00 AM January 1, year 1601 A.D. in the proleptic Gregorian Calendar. - * See DeviceCode\PAL\time_decl.h for explanation of why we are taking - * year 1601 as origin for our HAL, PAL, and CLR. - * - * It should be considered that previously DateTime.Ticks used to represent - * the number 100 nanosecond intervals since 12:00 AM January 1, year 1601 A.D. - * causing a 504911232000000000 difference between ticks in .NET and .NET MF - * To fix this disparity, we modified the CLR portion of DateTime type without - * changing the origin of the DateTime. In particular, TicksAtOrigin is subtracted - * from any ticks value provided by user code, and it is added back whenever the - * ticks value is read. + * 12:00 AM January 1, year 1601 A.D. in the proleptic Gregorian Calendar. * *

For a description of various calendar issues, look at * @@ -87,6 +77,11 @@ public struct DateTime private const int DaysPer100Years = DaysPer4Years * 25 - 1; // Number of days in 400 years private const int DaysPer400Years = DaysPer100Years * 4 + 1; + + // Number of days from 1/1/0001 to 12/31/1600 + private const int DaysTo1601 = DaysPer400Years * 4; + // Number of days from 1/1/0001 to 12/30/1899 + private const int DaysTo1899 = DaysPer400Years * 4 + DaysPer100Years * 3 - 367; // Number of days from 1/1/0001 to 12/31/9999 private const int DaysTo10000 = DaysPer400Years * 25 - 366; @@ -98,18 +93,13 @@ public struct DateTime private const ulong TickMask = 0x7FFFFFFFFFFFFFFFL; private const ulong UTCMask = 0x8000000000000000L; - // Ticks at 12:00 AM January 1, year 1601 A.D. - private const long TicksAtOrigin = 504911232000000000; - - public static readonly DateTime MinValue = new DateTime(MinTicks + TicksAtOrigin); - public static readonly DateTime MaxValue = new DateTime(MaxTicks + TicksAtOrigin); + public static readonly DateTime MinValue = new DateTime(MinTicks); + public static readonly DateTime MaxValue = new DateTime(MaxTicks); private ulong m_ticks; public DateTime(long ticks) { - ticks -= TicksAtOrigin; - if (((ticks & (long)TickMask) < MinTicks) || ((ticks & (long)TickMask) > MaxTicks)) { throw new ArgumentOutOfRangeException("ticks", "Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks."); @@ -146,12 +136,12 @@ public DateTime(int year, int month, int day, int hour, int minute, int second) public DateTime Add(TimeSpan val) { - return new DateTime((long)m_ticks + val.Ticks + TicksAtOrigin); + return new DateTime((long)m_ticks + val.Ticks); } private DateTime Add(double val, int scale) { - return new DateTime((long)((long)m_ticks + (long)(val * scale * TicksPerMillisecond + (val >= 0 ? 0.5 : -0.5))) + TicksAtOrigin); + return new DateTime((long)((long)m_ticks + (long)(val * scale * TicksPerMillisecond + (val >= 0 ? 0.5 : -0.5)))); } public DateTime AddDays(double val) @@ -181,7 +171,7 @@ public DateTime AddSeconds(double val) public DateTime AddTicks(long val) { - return new DateTime((long)m_ticks + val + TicksAtOrigin); + return new DateTime((long)m_ticks + val); } public static int Compare(DateTime t1, DateTime t2) @@ -243,11 +233,11 @@ public DateTime Date // Need to remove UTC mask before arithmetic operations. Then set it back. if ((m_ticks & UTCMask) != 0) { - return new DateTime((long)(((m_ticks & TickMask) - (m_ticks & TickMask) % TicksPerDay) | UTCMask) + TicksAtOrigin); + return new DateTime((long)(((m_ticks & TickMask) - (m_ticks & TickMask) % TicksPerDay) | UTCMask)); } else { - return new DateTime((long)(m_ticks - m_ticks % TicksPerDay) + TicksAtOrigin); + return new DateTime((long)(m_ticks - m_ticks % TicksPerDay)); } } } @@ -301,7 +291,7 @@ public DateTimeKind Kind public static DateTime SpecifyKind(DateTime value, DateTimeKind kind) { - DateTime retVal = new DateTime((long)value.m_ticks + TicksAtOrigin); + DateTime retVal = new DateTime((long)value.m_ticks); if (kind == DateTimeKind.Utc) { @@ -370,11 +360,18 @@ public int Second } } + /// Our origin is at 1601/01/01:00:00:00.000 + /// While desktop CLR's origin is at 0001/01/01:00:00:00.000. + /// There are 504911232000000000 ticks between them which we are subtracting. + /// See DeviceCode\PAL\time_decl.h for explanation of why we are taking + /// year 1601 as origin for our HAL, PAL, and CLR. + // static Int64 ticksAtOrigin = 504911232000000000; + static Int64 ticksAtOrigin = 0; public long Ticks { get { - return (long)(m_ticks & TickMask) + TicksAtOrigin; + return (long)(m_ticks & TickMask) + ticksAtOrigin; } } @@ -411,7 +408,7 @@ public TimeSpan Subtract(DateTime val) public DateTime Subtract(TimeSpan val) { - return new DateTime((long)(m_ticks - (ulong)val.m_ticks) + TicksAtOrigin); + return new DateTime((long)(m_ticks - (ulong)val.m_ticks)); } [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -432,12 +429,12 @@ public String ToString(String format) public static DateTime operator +(DateTime d, TimeSpan t) { - return new DateTime((long)(d.m_ticks + (ulong)t.m_ticks) + TicksAtOrigin); + return new DateTime((long)(d.m_ticks + (ulong)t.m_ticks)); } public static DateTime operator -(DateTime d, TimeSpan t) { - return new DateTime((long)(d.m_ticks - (ulong)t.m_ticks) + TicksAtOrigin); + return new DateTime((long)(d.m_ticks - (ulong)t.m_ticks)); } public static TimeSpan operator -(DateTime d1, DateTime d2) diff --git a/Framework/Subset_of_VisualBasic/AssemblyInfo.vb b/Framework/Subset_of_VisualBasic/AssemblyInfo.vb index f96fe22fe..d056094bb 100644 --- a/Framework/Subset_of_VisualBasic/AssemblyInfo.vb +++ b/Framework/Subset_of_VisualBasic/AssemblyInfo.vb @@ -8,11 +8,11 @@ Imports System.Runtime.InteropServices ' Review the values of the assembly attributes - - - + + + - + ' Version information for an assembly consists of the following four values: diff --git a/Framework/Tools/BuildTasks.sln b/Framework/Tools/BuildTasks.sln new file mode 100644 index 000000000..c4d7a25c5 --- /dev/null +++ b/Framework/Tools/BuildTasks.sln @@ -0,0 +1,46 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.22823.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildSignerSpotBuild", "BuildTasksInternal\BuildSigner\BuildSignerSpotBuild.csproj", "{1A12104F-10D3-4746-8798-6D0DCDC5F58C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InternalBuildTasks", "BuildTasksInternal\InternalBuildTasks.csproj", "{04903C08-F89B-4CF0-A25F-E3D541542146}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildTasks", "BuildTasks\BuildTasks.csproj", "{9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WixLibSpotBuild", "WiXLib\WixLibSpotBuild.csproj", "{4F18A5F1-08F2-4E7A-8F8C-7BAB5BFED12F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NativeBuildTasks", "BuildTasksNativeBuild\NativeBuildTasks.csproj", "{7B8DD39E-B0AA-47FC-B30B-B777CF840695}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1A12104F-10D3-4746-8798-6D0DCDC5F58C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1A12104F-10D3-4746-8798-6D0DCDC5F58C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1A12104F-10D3-4746-8798-6D0DCDC5F58C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1A12104F-10D3-4746-8798-6D0DCDC5F58C}.Release|Any CPU.Build.0 = Release|Any CPU + {04903C08-F89B-4CF0-A25F-E3D541542146}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04903C08-F89B-4CF0-A25F-E3D541542146}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04903C08-F89B-4CF0-A25F-E3D541542146}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04903C08-F89B-4CF0-A25F-E3D541542146}.Release|Any CPU.Build.0 = Release|Any CPU + {9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280}.Release|Any CPU.Build.0 = Release|Any CPU + {4F18A5F1-08F2-4E7A-8F8C-7BAB5BFED12F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F18A5F1-08F2-4E7A-8F8C-7BAB5BFED12F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F18A5F1-08F2-4E7A-8F8C-7BAB5BFED12F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F18A5F1-08F2-4E7A-8F8C-7BAB5BFED12F}.Release|Any CPU.Build.0 = Release|Any CPU + {7B8DD39E-B0AA-47FC-B30B-B777CF840695}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7B8DD39E-B0AA-47FC-B30B-B777CF840695}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7B8DD39E-B0AA-47FC-B30B-B777CF840695}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {7B8DD39E-B0AA-47FC-B30B-B777CF840695}.Release|Any CPU.Build.0 = Debug|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Framework/Tools/BuildTasks/BuildTasks.csproj b/Framework/Tools/BuildTasks/BuildTasks.csproj index ee00da5c8..0614b41e1 100644 --- a/Framework/Tools/BuildTasks/BuildTasks.csproj +++ b/Framework/Tools/BuildTasks/BuildTasks.csproj @@ -1,87 +1,104 @@  - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(FLAVOR_WIN) - SAK - SAK - SAK - SAK - - - Microsoft.SPOT.Tasks - Library - Microsoft.SPOT.Tasks - {FAE04EC0-301F-11d3-BF4B-00C04F79EFBC} - {9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280} - - - {3f32ca8e-2457-4a72-b076-63ce714022ee} - ToolsDir - - - - - - - - True - True - BuildTaskResources.resx - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(SPOCLIENT)\tools\build\Microsoft.SPOT.Tasks.Internal.dll - $(BUILD_TREE_SERVER)\DLL\Microsoft.SPOT.Tasks.Internal.dll - - - - - ResXFileCodeGenerator - BuildTaskResources.Designer.cs - - - - - - - - - - - - - - + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(FLAVOR_WIN) + SAK + SAK + SAK + SAK + + + Microsoft.SPOT.Tasks + Library + Microsoft.SPOT.Tasks + {FAE04EC0-301F-11d3-BF4B-00C04F79EFBC} + {9B3D156D-B9D2-4F9C-BFDF-91FC42EE1280} + + + {3f32ca8e-2457-4a72-b076-63ce714022ee} + ToolsDir + + + true + DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + pdbonly + AnyCPU + MinimumRecommendedRules.ruleset + true + + + true + TRACE;DEBUG;,DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + full + AnyCPU + MinimumRecommendedRules.ruleset + false + + + + + True + True + BuildTaskResources.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + BuildTaskResources.Designer.cs + + + + + + + + + + + + + + + + + {04903c08-f89b-4cf0-a25f-e3d541542146} + InternalBuildTasks + + \ No newline at end of file diff --git a/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj b/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj index 8698f34c1..8ad28e093 100644 --- a/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj +++ b/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj @@ -1,4 +1,6 @@ - + + + 9.0.30729 2.0 @@ -8,6 +10,26 @@ Microsoft.SPOT.AutomatedBuild.BuildSigner {FAE04EC0-301F-11d3-BF4B-00C04F79EFBC} + + true + DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + pdbonly + AnyCPU + MinimumRecommendedRules.ruleset + true + + + true + TRACE;DEBUG;,DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + full + AnyCPU + MinimumRecommendedRules.ruleset + false + @@ -22,4 +44,4 @@ - + \ No newline at end of file diff --git a/Framework/Tools/BuildTasksInternal/InternalBuildTasks.csproj b/Framework/Tools/BuildTasksInternal/InternalBuildTasks.csproj index a9bab2c0e..87d0a0f2f 100644 --- a/Framework/Tools/BuildTasksInternal/InternalBuildTasks.csproj +++ b/Framework/Tools/BuildTasksInternal/InternalBuildTasks.csproj @@ -1,99 +1,131 @@  - - - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(FLAVOR_WIN) - SAK - SAK - SAK - SAK - - - Microsoft.SPOT.Tasks.Internal - Library - Microsoft.SPOT.Tasks.Internal - {FAE04EC0-301F-11d3-BF4B-00C04F79EFBC} - {04903C08-F89B-4CF0-A25F-E3D541542146} - 9.0.21022 - 2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - True - BuildTaskResource.resx - - - - - - - - Designer - ResXFileCodeGenerator - BuildTaskResource.Designer.cs - - - - - - - - - - - - - - - - wix - $(SPOROOT)\tools\x86\WiX\tools_3_5_1315_0\wix.dll - True - - - $(BUILD_TREE_DLL)\Microsoft.SPOT.WiX.dll - - - $(BUILD_TREE_DLL)\Microsoft.SPOT.AutomatedBuild.BuildSigner.dll - - - - - - - - - - - - - + + + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(FLAVOR_WIN) + SAK + SAK + SAK + SAK + + + Microsoft.SPOT.Tasks.Internal + Library + Microsoft.SPOT.Tasks.Internal + {FAE04EC0-301F-11d3-BF4B-00C04F79EFBC} + {04903C08-F89B-4CF0-A25F-E3D541542146} + 9.0.21022 + 2.0 + + + true + DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + pdbonly + AnyCPU + MinimumRecommendedRules.ruleset + true + + + true + TRACE;DEBUG;,DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + full + AnyCPU + MinimumRecommendedRules.ruleset + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + BuildTaskResource.resx + + + + + + + + Designer + ResXFileCodeGenerator + BuildTaskResource.Designer.cs + + + + + + + + + + + + + + + + wix + $(SPOROOT)\tools\x86\WiX\tools_3_5_1315_0\wix.dll + True + + + $(BUILD_TREE_DLL)\Microsoft.SPOT.WiX.dll + + + $(BUILD_TREE_DLL)\Microsoft.SPOT.AutomatedBuild.BuildSigner.dll + + + + + + + + + + + + + + + + {4f18a5f1-08f2-4e7a-8f8c-7bab5bfed12f} + WixLibSpotBuild + False + + + {1a12104f-10d3-4746-8798-6d0dcdc5f58c} + BuildSignerSpotBuild + False + + \ No newline at end of file diff --git a/Framework/Tools/MFDeploy/Library/MFConfigHelper.cs b/Framework/Tools/MFDeploy/Library/MFConfigHelper.cs index 7513a6600..f7b604ed1 100644 --- a/Framework/Tools/MFDeploy/Library/MFConfigHelper.cs +++ b/Framework/Tools/MFDeploy/Library/MFConfigHelper.cs @@ -483,7 +483,8 @@ private void InitializeConfigData() m_StaticConfig.Version.TinyBooter = 4; } - if (m_StaticConfig.ConfigurationLength >= m_cfg_sector.m_size) throw new MFInvalidConfigurationSectorException(); + if (m_StaticConfig.ConfigurationLength >= m_cfg_sector.m_size) + throw new MFInvalidConfigurationSectorException(); if (m_StaticConfig.Version.TinyBooter == 4) { diff --git a/Framework/Tools/MFDeploy/Library/MFCryptoWrapper.cs b/Framework/Tools/MFDeploy/Library/MFCryptoWrapper.cs index 611a5bc51..ff70186e3 100644 --- a/Framework/Tools/MFDeploy/Library/MFCryptoWrapper.cs +++ b/Framework/Tools/MFDeploy/Library/MFCryptoWrapper.cs @@ -43,17 +43,22 @@ public enum RSA_OPS VERIFYSIGNATURE } - [DllImport(@"Crypto.dll")] + [DllImport(@"Crypto.dll", CallingConvention = CallingConvention.Cdecl ) ] static public extern bool Crypto_Encrypt([In] byte[] Key, [In, Out] byte[] IV, int cbIVSize, [In] byte[] pPlainText, int cbPlainText, [Out] byte[] pCypherText, int cbCypherText); - [DllImport(@"Crypto.dll")] + + [DllImport(@"Crypto.dll", CallingConvention = CallingConvention.Cdecl )] static public extern bool Crypto_Decrypt([In] byte[] Key, [In, Out] byte[] IV, int cbIVSize, [In] byte[] pCypherText, int cbCypherText, [Out] byte[] pPlainText, int cbPlainText); - [DllImport(@"Crypto.dll")] + + [DllImport(@"Crypto.dll", CallingConvention = CallingConvention.Cdecl )] static public extern int Crypto_CreateZenithKey([In] byte[] seed, out ushort delta1, out ushort delta2); - [DllImport(@"Crypto.dll")] + + [DllImport(@"Crypto.dll", CallingConvention = CallingConvention.Cdecl )] static public extern int Crypto_SignBuffer([In] byte[] buffer, int bufLen, [In] byte[] key, [Out] byte[] signature, int siglen); - [DllImport(@"Crypto.dll")] + + [DllImport(@"Crypto.dll", CallingConvention = CallingConvention.Cdecl )] static public extern int Crypto_GeneratePrivateKey([In] byte[] seed, [Out] byte[] privateKey); - [DllImport(@"Crypto.dll")] + + [DllImport(@"Crypto.dll", CallingConvention = CallingConvention.Cdecl )] static public extern int Crypto_PublicKeyFromPrivate([In] byte[] privkey, [Out] byte[] pubkey); } } diff --git a/Framework/Tools/WiXLib/WixLibSpotBuild.csproj b/Framework/Tools/WiXLib/WixLibSpotBuild.csproj index 30bad7d47..38a3bb1b1 100644 --- a/Framework/Tools/WiXLib/WixLibSpotBuild.csproj +++ b/Framework/Tools/WiXLib/WixLibSpotBuild.csproj @@ -1,5 +1,6 @@ + - + Microsoft.SPOT.WiX Library @@ -7,11 +8,29 @@ {FAE04EC0-301F-11d3-BF4B-00C04F79EFBC} 9.0.21022 2.0 - {4f18a5f1-08f2-4e7a-8f8c-7bab5bfed12f} + {4F18A5F1-08F2-4E7A-8F8C-7BAB5BFED12F} + + + true + DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + pdbonly + AnyCPU + MinimumRecommendedRules.ruleset + true + + + true + TRACE;DEBUG;,DEBUG,TRACE,TINYCLR_BUILD_SERVER,TINYCLR_USESTRONGNAMES + true + 1668,1762 + full + AnyCPU + MinimumRecommendedRules.ruleset + false - - @@ -20,9 +39,8 @@ - - + \ No newline at end of file diff --git a/Framework/Tools/buildTasks.dirproj b/Framework/Tools/buildTasks.dirproj index 2369ee7bb..4c13dc497 100644 --- a/Framework/Tools/buildTasks.dirproj +++ b/Framework/Tools/buildTasks.dirproj @@ -4,11 +4,9 @@ Server - + - - diff --git a/Product/AllSDK/ItemTemplates/CSharp/AssemblyInfo/AssemblyInfoTemplateProject.csproj b/Product/AllSDK/ItemTemplates/CSharp/AssemblyInfo/AssemblyInfoTemplateProject.csproj index c8e9ebc7c..b7b3a016e 100644 --- a/Product/AllSDK/ItemTemplates/CSharp/AssemblyInfo/AssemblyInfoTemplateProject.csproj +++ b/Product/AllSDK/ItemTemplates/CSharp/AssemblyInfo/AssemblyInfoTemplateProject.csproj @@ -1,7 +1,7 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) AssemblyInfo @@ -9,9 +9,14 @@ SAK SAK SAK + + + + + 12.0 - - + + Debug AnyCPU @@ -19,8 +24,8 @@ {422D820B-8B80-4FF1-9828-3AB113C2ABC0} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + CSAssemblyInfo + CSAssemblyInfo x86 $(FLAVOR_WIN) v4.5 diff --git a/Product/AllSDK/ItemTemplates/CSharp/Class/ClassTemplateProject.csproj b/Product/AllSDK/ItemTemplates/CSharp/Class/ClassTemplateProject.csproj index e2d50e960..31323940a 100644 --- a/Product/AllSDK/ItemTemplates/CSharp/Class/ClassTemplateProject.csproj +++ b/Product/AllSDK/ItemTemplates/CSharp/Class/ClassTemplateProject.csproj @@ -1,7 +1,7 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) Class @@ -10,8 +10,8 @@ SAK SAK - - + + Debug AnyCPU @@ -19,8 +19,8 @@ {32FD8868-BC4E-4810-B811-66CF6B38FA02} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + CSClassTemplate + CSClassTemplate x86 $(FLAVOR_WIN) v4.5 diff --git a/Product/AllSDK/ItemTemplates/VisualBasic/Class/VBClassTemplateProject.csproj b/Product/AllSDK/ItemTemplates/VisualBasic/Class/VBClassTemplateProject.csproj index b921b926e..342542bd0 100644 --- a/Product/AllSDK/ItemTemplates/VisualBasic/Class/VBClassTemplateProject.csproj +++ b/Product/AllSDK/ItemTemplates/VisualBasic/Class/VBClassTemplateProject.csproj @@ -1,7 +1,7 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) Class @@ -11,7 +11,7 @@ SAK - + Debug AnyCPU @@ -19,8 +19,8 @@ {64BB93E1-F7F1-425E-89BF-1BDECEF523AC} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + VBClassTemplate + VBClassTemplate x86 $(FLAVOR_WIN) v4.5 @@ -40,12 +40,10 @@ False False - C:\Users\smaillet\AppData\Local\Temp\vs71F7.tmp\Release\ False False - C:\Users\smaillet\AppData\Local\Temp\vs71F7.tmp\Debug\ diff --git a/Product/AllSDK/ProjectTemplates/CSharp/EmulatorTemplate/EmulatorTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/CSharp/EmulatorTemplate/EmulatorTemplateProject.csproj index bfa262d65..e1be40de3 100644 --- a/Product/AllSDK/ProjectTemplates/CSharp/EmulatorTemplate/EmulatorTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/CSharp/EmulatorTemplate/EmulatorTemplateProject.csproj @@ -1,11 +1,16 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) MFEmulator $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), sdk.dirproj)) + + + + + 12.0 @@ -51,13 +56,12 @@ - - - - - + + + + + - diff --git a/Product/AllSDK/ProjectTemplates/CSharp/ExeTemplate/ExeTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/CSharp/ExeTemplate/ExeTemplateProject.csproj index 3161ccebf..44bc84cd7 100644 --- a/Product/AllSDK/ProjectTemplates/CSharp/ExeTemplate/ExeTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/CSharp/ExeTemplate/ExeTemplateProject.csproj @@ -19,8 +19,8 @@ {08FF08A7-6883-4875-BBC5-5F9405D59B4D} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + CSMFConsoleApplication + CSMFConsoleApplication x86 $(FLAVOR_WIN) v4.5 @@ -40,12 +40,10 @@ False False - C:\Users\smaillet\AppData\Local\Temp\vsAE7C.tmp\Release\ False False - C:\Users\smaillet\AppData\Local\Temp\vsAE7C.tmp\Debug\ diff --git a/Product/AllSDK/ProjectTemplates/CSharp/LibTemplate/LibTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/CSharp/LibTemplate/LibTemplateProject.csproj index 505a09307..f0645f83e 100644 --- a/Product/AllSDK/ProjectTemplates/CSharp/LibTemplate/LibTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/CSharp/LibTemplate/LibTemplateProject.csproj @@ -19,8 +19,8 @@ {0F0DFBB2-249D-4769-BF7D-29885153CF87} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + CSMFClassLibrary + CSMFClassLibrary x86 $(FLAVOR_WIN) v4.5 @@ -40,12 +40,10 @@ False False - C:\Users\smaillet\AppData\Local\Temp\vsB8E5.tmp\Release\ False False - C:\Users\smaillet\AppData\Local\Temp\vsB8E5.tmp\Debug\ diff --git a/Product/AllSDK/ProjectTemplates/CSharp/WinTemplate/WinTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/CSharp/WinTemplate/WinTemplateProject.csproj index c2c195f69..d78b08211 100644 --- a/Product/AllSDK/ProjectTemplates/CSharp/WinTemplate/WinTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/CSharp/WinTemplate/WinTemplateProject.csproj @@ -19,8 +19,8 @@ {D300D44B-0B0F-450F-B4A1-D4DCE9590F88} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + CSMFWindowApplication + CSMFWindowApplication x86 $(FLAVOR_WIN) v4.5 diff --git a/Product/AllSDK/ProjectTemplates/VB/ExeTemplate/VBExeTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/VB/ExeTemplate/VBExeTemplateProject.csproj index 0d3844ebf..faa9b97b8 100644 --- a/Product/AllSDK/ProjectTemplates/VB/ExeTemplate/VBExeTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/VB/ExeTemplate/VBExeTemplateProject.csproj @@ -1,7 +1,7 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) MFConsoleApplication @@ -19,8 +19,8 @@ {898B220F-11FF-400D-B40C-588CF06DF856} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + VBMFConsoleApplication + VBMFConsoleApplication x86 $(FLAVOR_WIN) v4.5 @@ -40,12 +40,10 @@ False False - C:\Users\smaillet\AppData\Local\Temp\vsC76C.tmp\Release\ False False - C:\Users\smaillet\AppData\Local\Temp\vsC76C.tmp\Debug\ @@ -65,6 +63,7 @@ Micro Framework + Designer diff --git a/Product/AllSDK/ProjectTemplates/VB/LibTemplate/VBLibTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/VB/LibTemplate/VBLibTemplateProject.csproj index 86ccf9bbd..635a42607 100644 --- a/Product/AllSDK/ProjectTemplates/VB/LibTemplate/VBLibTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/VB/LibTemplate/VBLibTemplateProject.csproj @@ -1,7 +1,7 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) MFClassLibrary @@ -19,8 +19,8 @@ {BC660833-4208-4D3E-B744-4AD17D502F8E} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + VBMFClassLibrary + VBMFClassLibrary x86 $(FLAVOR_WIN) v4.5 @@ -40,12 +40,10 @@ False False - C:\Users\smaillet\AppData\Local\Temp\vsE99.tmp\Release\ False False - C:\Users\smaillet\AppData\Local\Temp\vsE99.tmp\Debug\ diff --git a/Product/AllSDK/ProjectTemplates/VB/WinTemplate/VBWinTemplateProject.csproj b/Product/AllSDK/ProjectTemplates/VB/WinTemplate/VBWinTemplateProject.csproj index 391012ce5..f20ddf35d 100644 --- a/Product/AllSDK/ProjectTemplates/VB/WinTemplate/VBWinTemplateProject.csproj +++ b/Product/AllSDK/ProjectTemplates/VB/WinTemplate/VBWinTemplateProject.csproj @@ -1,7 +1,7 @@  - 12.0 + 14.0 11.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) MFWindowApplication @@ -19,8 +19,8 @@ {517662A3-1886-4811-818E-AB0333447656} Library Properties - $(NetMFTemplateName) - $(NetMFTemplateName) + VBMFWindowApplication + VBMFWindowApplication x86 $(FLAVOR_WIN) v4.5 @@ -40,12 +40,10 @@ False False - C:\Users\smaillet\AppData\Local\Temp\vs3D9B.tmp\Release\ False False - C:\Users\smaillet\AppData\Local\Temp\vs3D9B.tmp\Debug\ diff --git a/README.md b/README.md index a2538e0a3..5bfe99edb 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ #.NET Micro Framework Interpreter -[![Build status](http://netmfbuildstatus.cloudapp.net/BuildStatus.svc/Badge)](http://netmfbuildstatus.cloudapp.net/BuildStatus.svc/Report) - -Welcome to the .NET Micro Framework interpreter GitHub repository. +Welcome to the .NET Micro Framework interpreter GitHub repository. (Master Branch) The Microsoft® .NET Micro Framework combines the reliability and efficiency of managed code with the premier development tools of Microsoft Visual Studio® to deliver exceptional productivity for developing embedded applications on small devices. The Microsoft .NET Micro Framework SDK supports development of code, including device I/O, in the C# language using a subset of the .NET libraries, and is fully integrated with the Microsoft Visual Studio® development environment. The .NET Micro Framework class library supports all major namespaces and types from the desktop framework, managed drivers support, Remote Firmware Updates and Cryptographic functions for Secure Devices. This GitHub project allows building the full SDK and device Firmware images including the lwIP open source TCP/IP stack and the OpenSSL distribution. -## Wiki Docs -Information on building the framework and internal development guides will appear on the [wiki](https://github.com/NETMF/netmf-interpreter/wiki). If you have content that is relevant to the NETMF development community that you would like to [contribute](https://github.com/NETMF/netmf-interpreter/wiki/Contributing) feel free to join in and participate in the future of the .NET Micro Framework. +##Master Branch +The Master branch contains released source code that is updated when major milestones are released, including Beta builds. Active development is done in the [dev](https://github.com/NETMF/netmf-interpreter/tree/dev) branch. Thus the Master is considered fairly stable and never receives commits directly. (e.g. Any pull requests targeting the Master branch will be rejected automatically. All contributions should appear as a pull request to the dev branch) + +### Wiki Docs +Information on building the framework and internal development guides will appear on the [wiki](https://github.com/NETMF/netmf-interpreter/wiki). If you have Wiki content that is relevant to the NETMF development community or code that you would like to [contribute](https://github.com/NETMF/netmf-interpreter/wiki/Contributing) feel free to join in and participate in the future of the .NET Micro Framework! + diff --git a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/M29W640FB_BlConfig.cpp b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/M29W640FB_BlConfig.cpp index 9be02e0f8..72543be0c 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/M29W640FB_BlConfig.cpp +++ b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/M29W640FB_BlConfig.cpp @@ -50,12 +50,12 @@ const BlockRange g_M29W640FB_BlockRange1[] = const BlockRange g_M29W640FB_BlockRange2[] = { // ER_DAT - { BlockRange::BLOCKTYPE_CODE, 0, 2 }, // 3x64KB = 192KB + { BlockRange::BLOCKTYPE_CODE, 0, 3 }, // 4x64KB = 256KB #ifdef DEBUG // In debug builds with TRACE pins enabled, only 1MB is available - { BlockRange::BLOCKTYPE_DEPLOYMENT, 3, 15 }, // 13x64KB = 832KB + { BlockRange::BLOCKTYPE_DEPLOYMENT, 4, 14 }, // 11x64KB = 704KB #else - { BlockRange::BLOCKTYPE_DEPLOYMENT, 3, 126 }, // 124x64KB = 7936KB + { BlockRange::BLOCKTYPE_DEPLOYMENT, 4, 126 }, // 123x64KB = 7872KB #endif }; diff --git a/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/M29W640FB_Flash_driver.cpp b/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/M29W640FB_Flash_driver.cpp index da58f424f..6a1875aa9 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/M29W640FB_Flash_driver.cpp +++ b/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/M29W640FB_Flash_driver.cpp @@ -154,7 +154,7 @@ BOOL M29W640FB_Flash_Driver::Write(void* context, ByteAddress Address, UINT32 Nu { return FALSE; } - + M29W640FB_WaitReady(); return TRUE; } @@ -259,6 +259,7 @@ BOOL M29W640FB_Flash_Driver::EraseBlock( void* context, ByteAddress Sector ) M29W640FB_WaitReady(); Driver_Flash0.EraseSector(Sector); + M29W640FB_WaitReady(); return TRUE; } diff --git a/Solutions/MCBSTM32F400/MCBSTM32F400.settings b/Solutions/MCBSTM32F400/MCBSTM32F400.settings index 47b662524..19746763e 100644 --- a/Solutions/MCBSTM32F400/MCBSTM32F400.settings +++ b/Solutions/MCBSTM32F400/MCBSTM32F400.settings @@ -16,7 +16,7 @@ LWIP_1_4_1_OS - Copyright (C) Microsoft Open Technologies Inc. + Copyright (C) Microsoft Corporation diff --git a/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml b/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml index 6b88e1725..1237b057d 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml +++ b/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml @@ -51,7 +51,7 @@ - + diff --git a/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_mdk.xml b/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_mdk.xml index 0cf8c3e21..ef6e6e0f0 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_mdk.xml +++ b/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_mdk.xml @@ -50,7 +50,7 @@ - + diff --git a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj index 0284688c2..5858bfb60 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj +++ b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj @@ -56,7 +56,6 @@ - @@ -66,12 +65,15 @@ + + - + + @@ -87,7 +89,7 @@ - + @@ -134,8 +136,8 @@ - - + + @@ -253,10 +255,6 @@ - - - - @@ -430,18 +428,24 @@ - + - + - - + + + + + + + + @@ -470,6 +474,8 @@ + + diff --git a/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml b/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml index 09f8ab076..4fdb0b8f4 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml +++ b/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml @@ -50,7 +50,7 @@ - + diff --git a/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_mdk.xml b/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_mdk.xml index fa7d3426e..d8c281eb1 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_mdk.xml +++ b/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_mdk.xml @@ -49,7 +49,7 @@ - + @@ -114,7 +114,7 @@ - + diff --git a/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvoptx b/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvoptx index d3bdca0c0..daee91578 100644 --- a/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvoptx +++ b/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvoptx @@ -75,7 +75,7 @@ 1 0 - 1 + 0 18 @@ -192,7 +192,72 @@ UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)) - + + + 0 + 0 + 53 + 1 +

0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_Bootstrap\RVD_S\DefaultHandlers.s + + + + + 1 + 0 + 238 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\StartupLib\CLRStartup.cpp + + +
+ + 2 + 0 + 60 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\Support\crc\CRC.cpp + + +
+ + 3 + 0 + 41 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\Libraries\SPOT_TimeService\spot_Time_native_Microsoft_SPOT_Time_TimeService.cpp + + +
+ 1 @@ -411,7 +476,7 @@ 1 2 - 0 + sp 0 @@ -615,7 +680,72 @@ UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)) - + + + 0 + 0 + 53 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_Bootstrap\RVD_S\DefaultHandlers.s + + +
+ + 1 + 0 + 238 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\StartupLib\CLRStartup.cpp + + +
+ + 2 + 0 + 60 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\Support\crc\CRC.cpp + + +
+ + 3 + 0 + 41 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\Libraries\SPOT_TimeService\spot_Time_native_Microsoft_SPOT_Time_TimeService.cpp + + +
+
0 @@ -704,44 +834,44 @@ 1 0 - 0 + 1 18 0 - Schematics (MCBSTM32F400) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\Keil\MCBSTM32F400\Documentation\mcbstm32f400-schematics.pdf + User Manual (MCBSTM32F400) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/Keil/MCBSTM32F400/Documentation/mcbstm32f200.chm 1 - User Manual (MCBSTM32F400) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\Keil\MCBSTM32F400\Documentation\mcbstm32f400.chm + Schematics (MCBSTM32F400) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/Keil/MCBSTM32F400/Documentation/mcbstm32f400-schematics.pdf 2 Getting Started (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\DM00037368.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/DM00037368.pdf 3 User Manual (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\DM00039084.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/DM00039084.pdf 4 Bill of Materials (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_bom.zip + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_bom.zip 5 Gerber Files (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_gerber.zip + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_gerber.zip 6 Schematics (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_sch.zip + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_sch.zip 7 @@ -836,7 +966,7 @@ 0 1 - 1 + 0 0 0 0 @@ -924,38 +1054,38 @@ 0 - Schematics (MCBSTM32F400) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\Keil\MCBSTM32F400\Documentation\mcbstm32f400-schematics.pdf + User Manual (MCBSTM32F400) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/Keil/MCBSTM32F400/Documentation/mcbstm32f200.chm 1 - User Manual (MCBSTM32F400) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\Keil\MCBSTM32F400\Documentation\mcbstm32f400.chm + Schematics (MCBSTM32F400) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/Keil/MCBSTM32F400/Documentation/mcbstm32f400-schematics.pdf 2 Getting Started (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\DM00037368.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/DM00037368.pdf 3 User Manual (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\DM00039084.pdf + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/DM00039084.pdf 4 Bill of Materials (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_bom.zip + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_bom.zip 5 Gerber Files (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_gerber.zip + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_gerber.zip 6 Schematics (STM32F4-Discovery) - C:\Keil\ARM\PACK\Keil\STM32F4xx_DFP\2.2.0\MDK\Boards\ST\STM32F4-Discovery\Documentation\stm32f4discovery_sch.zip + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_sch.zip 7 @@ -1035,7 +1165,72 @@ UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)) - + + + 0 + 0 + 53 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_Bootstrap\RVD_S\DefaultHandlers.s + + +
+ + 1 + 0 + 238 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\StartupLib\CLRStartup.cpp + + +
+ + 2 + 0 + 60 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\Support\crc\CRC.cpp + + +
+ + 3 + 0 + 41 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\Libraries\SPOT_TimeService\spot_Time_native_Microsoft_SPOT_Time_TimeService.cpp + + +
+
1 @@ -1078,6 +1273,276 @@ + + TinyCLR_NONET (ITM) + 0x4 + ARM-ADS + + 25000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\Listings\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 0 + + 18 + + + 0 + User Manual (MCBSTM32F400) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/Keil/MCBSTM32F400/Documentation/mcbstm32f200.chm + + + 1 + Schematics (MCBSTM32F400) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/Keil/MCBSTM32F400/Documentation/mcbstm32f400-schematics.pdf + + + 2 + Getting Started (STM32F4-Discovery) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/DM00037368.pdf + + + 3 + User Manual (STM32F4-Discovery) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/DM00039084.pdf + + + 4 + Bill of Materials (STM32F4-Discovery) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_bom.zip + + + 5 + Gerber Files (STM32F4-Discovery) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_gerber.zip + + + 6 + Schematics (STM32F4-Discovery) + C:\Keil_v5\ARM\PACK\Keil\STM32F4xx_DFP\2.5.0\MDK/Boards/ST/STM32F4-Discovery/Documentation/stm32f4discovery_sch.zip + + + 7 + MCBSTM32F400 Evaluation Board Web Page (MCBSTM32F400) + http://www.keil.com/mcbstm32f400/ + + + 8 + STM32F4-Discovery Web Page (STM32F4-Discovery) + http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF252419 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 7 + + + + + + + + + + .\STM32_SWO.ini + BIN\ULP2CM3.DLL + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-734,151,-324,698,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-326,150,-92,688,0)(1012=135,169,600,473,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + + + + 0 + ULP2CM3 + -UP1209218 -O2254 -S14 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO32771 -TC168000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE80000001 -TIP1 -FO3 -FD20000000 -FC1000 -FN2 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM) -FF1M29W640FB -FS160000000 -FL1800000 + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)) + + + + + 0 + 0 + 53 + 1 +
134373512
+ 0 + 0 + 0 + 0 + 0 + 1 + S:\GitHub\smaillet-ms\netmf-interpreter\DeviceCode\Targets\Native\STM32F4\DeviceCode\STM32F4_Bootstrap\RVD_S\DefaultHandlers.s + + +
+ + 1 + 0 + 0 + 1 +
134594000
+ 0 + 0 + 0 + 0 + 0 + 1 + + + 0x0805BDD0 +
+ + 2 + 0 + 41 + 1 +
0
+ 0 + 0 + 0 + 0 + 0 + 0 + S:\GitHub\smaillet-ms\netmf-interpreter\CLR\Libraries\SPOT_TimeService\spot_Time_native_Microsoft_SPOT_Time_TimeService.cpp + + +
+
+ + + 0 + 1 + assEnd + + + + + 1 + 2 + sp + 0 + + + + 0 + + + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + + + +
+
+ Debugger Init 1 diff --git a/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvprojx b/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvprojx index 6f5cb516b..294e309a4 100644 --- a/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvprojx +++ b/Solutions/MCBSTM32F400/netmfdbg/netmfdbg.uvprojx @@ -2086,6 +2086,422 @@ + + TinyCLR_NONET (ITM) + 0x4 + ARM-ADS + + + STM32F407IGHx + STMicroelectronics + Keil.STM32F4xx_DFP.2.5.0 + http://www.keil.com/pack + IROM(0x08000000,0x100000) IRAM(0x20000000,0x20000) IRAM2(0x10000000,0x10000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE + + + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F407IGHx$CMSIS\Flash\STM32F4xx_1024.FLM)) + 0 + $$Device:STM32F407IGHx$Drivers\CMSIS\Device\ST\STM32F4xx\Include\stm32f4xx.h + + + + + + + + + + $$Device:STM32F407IGHx$CMSIS\SVD\STM32F40x.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + ..\..\..\BuildOutput\THUMB2FP\MDK5.05\le\FLASH\debug\MCBSTM32F400\bin\ + TinyClr_nonet + 1 + 0 + 0 + 1 + 1 + .\Listings\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 1 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + + + 1 + 1 + 0 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + + 0 + 7 + + + + + + + + + + + + + .\STM32_SWO.ini + BIN\ULP2CM3.DLL + + + + + 1 + 0 + 0 + 1 + 0 + -1 + + 1 + BIN\UL2CM3.DLL + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x20000 + + + 1 + 0x8000000 + 0x100000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x100000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x20000 + + + 0 + 0x10000000 + 0x10000 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Debugger Init + + + STM32F4xx_TP.ini + 5 + .\STM32F4xx_TP.ini + + + STM32_SWO.ini + 5 + .\STM32_SWO.ini + + + + +
diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Init/IO_Init.cpp b/Solutions/STM32F4DISCOVERY/DeviceCode/Init/IO_Init.cpp index 1e3bbfd62..9b9d4c6e4 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Init/IO_Init.cpp +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Init/IO_Init.cpp @@ -11,62 +11,25 @@ // //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -#define ARRAY_LENGTH(x) (sizeof(x)/sizeof(0[x])) - #include #include "..\..\..\..\DeviceCode\Targets\Native\STM32F4\DeviceCode\stm32f4xx.h" +// Define the generic port table, only one generic extensionn port type supported +// and that is the ITM hardware trace port on Channel 0. +extern GenericPortTableEntry const Itm0GenericPort; +extern GenericPortTableEntry const* const g_GenericPorts[TOTAL_GENERIC_PORTS] = { &Itm0GenericPort }; + extern void STM32F4_GPIO_Pin_Config( GPIO_PIN pin, UINT32 mode, GPIO_RESISTOR resistor, UINT32 alternate ); // Workaround, since CPU_GPIO_DisablePin() does not correctly initialize pin speeds void __section("SectionForBootstrapOperations") BootstrapCode_GPIO() { -//#ifdef DEBUG -// // PE2,3,4,5 are used for TRACECLK and TRACEDATA0-3 so don't enable them as address pins in debug builds -// // This limits external FLASH and SRAM to 1MB addressable space each. -// const uint8_t PortE_PinList[] = {0, 1, /*2, 3, 4, 5,*/ 7, 8, 9, 10, 11, 12, 13, 14, 15}; -//#else -// const uint8_t PortE_PinList[] = {0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15}; -//#endif -// const uint8_t PortF_PinList[] = {0, 1, 2, 3, 4, 5, 12, 13, 14, 15}; -// const uint8_t PortG_PinList[] = {0, 1, 2, 3, 4, 5, 10}; -// -// const uint32_t pinConfig = 0x3C2; // Speed 100Mhz, AF12 FSMC, Alternate Mode -// const uint32_t pinMode = pinConfig & 0xF; -// const GPIO_ALT_MODE alternateMode = (GPIO_ALT_MODE) pinConfig; -// const GPIO_RESISTOR resistorConfig = RESISTOR_PULLUP; -// -// uint32_t i; - - /* Enable GPIO clocks */ + // Enable GPIO clocks for ports A - E RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN - | RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOEEN | RCC_AHB1ENR_GPIOFEN - | RCC_AHB1ENR_GPIOGEN | RCC_AHB1ENR_GPIOHEN | RCC_AHB1ENR_GPIOIEN; + | RCC_AHB1ENR_GPIODEN | RCC_AHB1ENR_GPIOEEN; + // TODO: Restore at the end of bootloader? CPU_GPIO_EnableOutputPin(LED3, FALSE); CPU_GPIO_EnableOutputPin(LED4, FALSE); CPU_GPIO_EnableOutputPin(LED5, FALSE); CPU_GPIO_EnableOutputPin(LED6, FALSE); - - /*Initialize SRAM and NOR GPIOs */ - - //for(i = 0; i < ARRAY_LENGTH(PortE_PinList); i++) /* Port E */ - //{ - // CPU_GPIO_ReservePin( PORT_PIN(GPIO_PORTE, PortE_PinList[i]), TRUE); - // CPU_GPIO_DisablePin( PORT_PIN(GPIO_PORTE, PortE_PinList[i]), resistorConfig, 0, alternateMode); - // STM32F4_GPIO_Pin_Config( PORT_PIN(GPIO_PORTE, PortE_PinList[i]), pinMode, resistorConfig, pinConfig ); // Workaround, since CPU_GPIO_DisablePin() does not correctly initialize pin speeds - //} - // - //for(i = 0; i < ARRAY_LENGTH(PortF_PinList); i++) /* Port F */ - //{ - // CPU_GPIO_ReservePin( PORT_PIN(GPIO_PORTF, PortF_PinList[i]), TRUE); - // CPU_GPIO_DisablePin( PORT_PIN(GPIO_PORTF, PortF_PinList[i]), resistorConfig, 0, alternateMode); - // STM32F4_GPIO_Pin_Config( PORT_PIN(GPIO_PORTF, PortF_PinList[i]), pinMode, resistorConfig, pinConfig ); // Workaround, since CPU_GPIO_DisablePin() does not correctly initialize pin speeds - //} - // - //for(i = 0; i < ARRAY_LENGTH(PortG_PinList); i++) /* Port G */ - //{ - // CPU_GPIO_ReservePin( PORT_PIN(GPIO_PORTG, PortG_PinList[i]), TRUE); - // CPU_GPIO_DisablePin( PORT_PIN(GPIO_PORTG, PortG_PinList[i]), resistorConfig, 0, alternateMode); - // STM32F4_GPIO_Pin_Config( PORT_PIN(GPIO_PORTG, PortG_PinList[i]), pinMode, resistorConfig, pinConfig ); // Workaround, since CPU_GPIO_DisablePin() does not correctly initialize pin speeds - //} } diff --git a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj index 3c903db59..a71459cd5 100644 --- a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj +++ b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj @@ -30,6 +30,10 @@
+ + + + @@ -87,8 +91,8 @@ - - + + @@ -131,8 +135,8 @@ - - + + diff --git a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj index 0ea904757..0e163fe15 100644 --- a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj +++ b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj @@ -26,8 +26,8 @@ \ER_FLASH $(LINK_FLAGS) --verbose $(SWTC)keep *(.init_array) false - $(BIN_DIR)\tinyclr.dat - $(SRC_DIR)\scatterfile_tinyclr_$(COMPILER_TOOL).$(SCATTER_EXT) + $(BIN_DIR)\$(AssemblyName).dat + $(SRC_DIR)\scatterfile_$(AssemblyName)_$(COMPILER_TOOL).$(SCATTER_EXT) EntryPoint TinyClr_Dat_Start g_ConfigurationSector @@ -35,18 +35,18 @@ false
- - - - + + + + - - + + @@ -65,6 +65,10 @@ + + + + diff --git a/Solutions/STM32F4DISCOVERY/platform_selector.h b/Solutions/STM32F4DISCOVERY/platform_selector.h index 11a1e45d6..e1cf20592 100644 --- a/Solutions/STM32F4DISCOVERY/platform_selector.h +++ b/Solutions/STM32F4DISCOVERY/platform_selector.h @@ -44,10 +44,8 @@ #define GPIO_PORTC 2 #define GPIO_PORTD 3 #define GPIO_PORTE 4 -#define GPIO_PORTF 5 -#define GPIO_PORTG 6 -#define GPIO_PORTH 7 -#define GPIO_PORTI 8 +// The remaining ports are not broken out - except PH0 and PH1, +// which are deliberately omitted to keep the range continuous. #define PORT_PIN(port,pin) ( ( (int)port) * 16 + ( pin ) ) @@ -77,18 +75,21 @@ #define CTSPROTECTRESISTOR RESISTOR_DISABLED #define RTSPROTECTRESISTOR RESISTOR_DISABLED -#define TOTAL_GPIO_PORT 9 // PA - PI +#define TOTAL_GPIO_PORT (GPIO_PORTE + 1) #define TOTAL_GPIO_PINS (TOTAL_GPIO_PORT*16) #define INSTRUMENTATION_H_GPIO_PIN GPIO_PIN_NONE -#define TOTAL_USART_PORT 7 // ITM0 + 6 physical UARTS +#define TOTAL_USART_PORT 6 // 6 physical UARTS #define USART_DEFAULT_PORT COM1 #define USART_DEFAULT_BAUDRATE 115200 +#define TOTAL_GENERIC_PORTS 1 // 1 generic port extensions (ITM channel 0 ) +#define ITM_GENERIC_PORTNUM 0 // ITM0 is index 0 in generic port interface table + #define DEBUG_TEXT_PORT ITM0 -#define STDIO USB1 +#define STDIO ITM0 #define DEBUGGER_PORT USB1 #define MESSAGING_PORT USB1 diff --git a/Support/WireProtocol/WireProtocol.cpp b/Support/WireProtocol/WireProtocol.cpp index 58b9ed3f7..436980210 100644 --- a/Support/WireProtocol/WireProtocol.cpp +++ b/Support/WireProtocol/WireProtocol.cpp @@ -5,13 +5,19 @@ #include "stdafx.h" //////////////////////////////////////////////////////////////////////////////////////////////////// +#define TRACE_ERRORS 1 +#define TRACE_HEADERS 2 +#define TRACE_STATE 4 +#define TRACE_NODATA 8 -#if 0 -#define TRACE0( msg, ...) debug_printf( msg ) -#define TRACE( msg, ...) debug_printf( msg, __VA_ARGS__ ) +#define TRACE_MASK (TRACE_ERRORS) + +#if TRACE_MASK != 0 +#define TRACE0( f, msg ) if((f) & TRACE_MASK ) debug_printf( msg ) +#define TRACE( f, msg, ...) if((f) & TRACE_MASK ) debug_printf( msg, __VA_ARGS__ ) #else -#define TRACE0(msg,...) -#define TRACE(msg,...) +#define TRACE0( f, msg,...) +#define TRACE( f, msg,...) #endif void WP_Message::Initialize( WP_Controller* parent ) @@ -113,18 +119,26 @@ bool WP_Message::VerifyHeader() UINT32 crc = ::SwapEndian( m_header.m_crcHeader ); #endif m_header.m_crcHeader = 0; - fRes = SUPPORT_ComputeCRC( (UINT8*)&m_header, sizeof(m_header), 0 ) == crc; - + UINT32 computedCrc = SUPPORT_ComputeCRC( ( UINT8* )&m_header, sizeof( m_header ), 0 ); m_header.m_crcHeader = crc; + fRes = computedCrc == crc; + if( !fRes ) + TRACE( TRACE_ERRORS, "Header CRC check failed: computed: 0x%08X; got: 0x%08X\n", computedCrc, m_header.m_crcHeader ); return fRes; } bool WP_Message::VerifyPayload() { - if(m_payload == NULL && m_header.m_size) return false; + if( m_payload == NULL && m_header.m_size ) + return false; + + UINT32 computedCrc = SUPPORT_ComputeCRC( m_payload, m_header.m_size, 0 ); + bool fRes = ( computedCrc == m_header.m_crcData ); + if( !fRes ) + TRACE( TRACE_ERRORS, "Payload CRC check failed: computed: 0x%08X; got: 0x%08X\n", computedCrc, m_header.m_crcData ); - return SUPPORT_ComputeCRC( m_payload, m_header.m_size, 0 ) == m_header.m_crcData; + return fRes; } void WP_Message::ReplyBadPacket( UINT32 flags ) @@ -134,9 +148,9 @@ void WP_Message::ReplyBadPacket( UINT32 flags ) msg.Initialize( m_parent ); msg.PrepareRequest( 0, WP_Flags::c_NonCritical | WP_Flags::c_NACK | flags, 0, NULL ); - m_parent->SendProtocolMessage( msg ); } + bool WP_Message::Process() { UINT8* buf = (UINT8*)&m_header; @@ -147,11 +161,11 @@ bool WP_Message::Process() switch(m_rxState) { case ReceiveState::Idle: - TRACE0("RxState==IDLE\n"); + TRACE0( TRACE_STATE, "RxState==IDLE\n"); return true; case ReceiveState::Initialize: - TRACE0("RxState==INIT\n"); + TRACE0( TRACE_STATE, "RxState==INIT\n"); Release(); m_rxState = ReceiveState::WaitingForHeader; @@ -160,10 +174,10 @@ bool WP_Message::Process() break; case ReceiveState::WaitingForHeader: - TRACE0("RxState==WaitForHeader\n"); + TRACE0( TRACE_STATE, "RxState==WaitForHeader\n"); if(m_parent->m_phy->ReceiveBytes( m_parent->m_state, m_pos, m_size ) == false) { - TRACE0("RxError - bailing out\n"); + TRACE0( TRACE_NODATA, "ReceiveBytes returned false - bailing out\n"); return true; } @@ -192,10 +206,10 @@ bool WP_Message::Process() break; case ReceiveState::ReadingHeader: - TRACE0("RxState==ReadingHeader\n"); + TRACE0( TRACE_STATE, "RxState==ReadingHeader\n"); if(m_parent->m_phy->ReceiveBytes( m_parent->m_state, m_pos, m_size ) == false) { - TRACE0("RxError - bailing out\n"); + TRACE0( TRACE_NODATA, "ReceiveBytes returned false - bailing out\n"); return true; } @@ -207,7 +221,7 @@ bool WP_Message::Process() case ReceiveState::CompleteHeader: { - TRACE0("RxState=CompleteHeader\n"); + TRACE0( TRACE_STATE, "RxState=CompleteHeader\n"); bool fBadPacket=true; if( VerifyHeader() ) @@ -215,6 +229,7 @@ bool WP_Message::Process() #if defined(NETMF_TARGET_BIG_ENDIAN) SwapEndian(); #endif + TRACE( TRACE_HEADERS, "RXMSG: 0x%08X, 0x%08X, 0x%08X\n", m_header.m_cmd, m_header.m_flags, m_header.m_size ); if ( m_parent->m_app->ProcessHeader( m_parent->m_state, this ) ) { fBadPacket = false; @@ -253,7 +268,7 @@ bool WP_Message::Process() case ReceiveState::ReadingPayload: { - TRACE0("RxState=ReadingPayload\n"); + TRACE0( TRACE_STATE, "RxState=ReadingPayload\n"); UINT64 curTicks = HAL_Time_CurrentTicks(); @@ -266,7 +281,7 @@ bool WP_Message::Process() if(m_parent->m_phy->ReceiveBytes( m_parent->m_state, m_pos, m_size ) == false) { - TRACE0("RxError - Bailing out!\n"); + TRACE0( TRACE_NODATA, "ReceiveBytes returned false - bailing out\n"); return true; } @@ -277,14 +292,14 @@ bool WP_Message::Process() } else { - TRACE0("RxError: Payload InterCharacterTimeout exceeded\n"); + TRACE0( TRACE_ERRORS, "RxError: Payload InterCharacterTimeout exceeded\n"); m_rxState = ReceiveState::Initialize; } } break; case ReceiveState::CompletePayload: - TRACE0("RsState=CompletePayload\n"); + TRACE0( TRACE_STATE, "RxState=CompletePayload\n"); if(VerifyPayload() == true) { m_parent->m_app->ProcessPayload( m_parent->m_state, this ); @@ -299,7 +314,7 @@ bool WP_Message::Process() default: - TRACE0("RxState=UNKNOWN!!\n"); + TRACE0( TRACE_ERRORS, "RxState=UNKNOWN!!\n"); return false; } } @@ -344,6 +359,7 @@ bool WP_Controller::AdvanceState() bool WP_Controller::SendProtocolMessage( const WP_Message& msg ) { + TRACE( TRACE_HEADERS, "TXMSG: 0x%08X, 0x%08X, 0x%08X\n", msg.m_header.m_cmd, msg.m_header.m_flags, msg.m_header.m_size ); return m_phy->TransmitMessage( m_state, &msg ); } diff --git a/Test/Platform/Tests/CLR/Microsoft.SPOT.Net/netInfoTests/NetworkInterfaceTests.cs b/Test/Platform/Tests/CLR/Microsoft.SPOT.Net/netInfoTests/NetworkInterfaceTests.cs index c2b7f2112..b1da1c3a0 100644 --- a/Test/Platform/Tests/CLR/Microsoft.SPOT.Net/netInfoTests/NetworkInterfaceTests.cs +++ b/Test/Platform/Tests/CLR/Microsoft.SPOT.Net/netInfoTests/NetworkInterfaceTests.cs @@ -36,7 +36,7 @@ public void CleanUp() { Log.Comment("Cleaning up after the tests"); } - + [TestMethod] public MFTestResults NetworkInterfaceTest_GetAllNetworkInterfaces_Count() { @@ -236,6 +236,7 @@ public MFTestResults NetworkInterfaceTest2_GetProperties() } //Validate the settings for Dynamic IP and Static DNS work. + // Issue #320: The not supported combinations of Dynamic/Static DNS and Dynamic/Static IP do not cause exception [TestMethod] public MFTestResults NetworkInterfaceTest4_DynamicIP_StaticDNS() { @@ -259,11 +260,22 @@ public MFTestResults NetworkInterfaceTest4_DynamicIP_StaticDNS() if (!testNI.IsDhcpEnabled) throw new Exception("IsDhcpEnabled data incorrect after EnableDhcp"); - Log.Comment("EnableStaticDns"); - testNI.EnableStaticDns(new string[] { "157.54.14.146" }); + try + { + // The combination of DHCP and StaticDNS is not supported at the moment + Log.Comment("EnableStaticDns should fail"); + testNI.EnableStaticDns(new string[] { "157.54.14.146" }); + testResult = MFTestResults.Fail; + } + catch (Exception e) + { + Log.Comment("Expected Exception: " + e.ToString()); + Log.Comment("Trying to enable Dynamic DNS with a Static IP address correctly fails"); + testResult = MFTestResults.Pass; + } - if (testNI.IsDynamicDnsEnabled) - throw new Exception("IsDynamicDnsEnabled data incorrect after EnableStaticDns"); + if (!testNI.IsDynamicDnsEnabled) + throw new Exception("IsDynamicDnsEnabled data incorrect"); testResult = MFTestResults.Pass; } @@ -306,20 +318,11 @@ public MFTestResults NetworkInterfaceTest3_DynamicIP_DynamicDNS() if (!testNI.IsDhcpEnabled) throw new Exception("IsDhcpEnabled data incorrect after EnableDhcp"); - try - { - Log.Comment("EnableDynamicDns"); - testNI.EnableDynamicDns(); - } - catch - { - Log.Comment("correctly throws an exception for EnableDynamicDNS which isn't supported"); - testResult = MFTestResults.Pass; - } + Log.Comment("EnableDynamicDns"); + testNI.EnableDynamicDns(); - Log.Comment("should not be set since it is not supported."); - if (testNI.IsDynamicDnsEnabled) - throw new Exception("IsDynamicDnsEnabled data incorrect after EnableDhcp"); + if (!testNI.IsDynamicDnsEnabled) + throw new Exception("IsDynamicDnsEnabled data incorrect after EnableDynamicDns"); testResult = MFTestResults.Pass; } @@ -335,7 +338,6 @@ public MFTestResults NetworkInterfaceTest3_DynamicIP_DynamicDNS() } } - Log.Comment("Fixed Bug number: 20533 IsDynamicDnsEnabled incorrectly returns true after call to EnableDynamicDns()."); return testResult; } @@ -385,6 +387,7 @@ public MFTestResults NetworkInterfaceTest5_StaticIP_StaticDNS() } //Validate the settings for Static IP and Dynamic DNS fails. + //Issue #320: The not supported combinations of Dynamic/Static DNS and Dynamic/Static IP do not cause exception [TestMethod] public MFTestResults NetworkInterfaceTest6_StaticIP_DynamicDNS() { @@ -411,16 +414,17 @@ public MFTestResults NetworkInterfaceTest6_StaticIP_DynamicDNS() { Log.Comment("EnableDynamicDns should fail"); testNI.EnableDynamicDns(); + testResult = MFTestResults.Fail; } catch (Exception e) { - Log.Comment("Exception: " + e.ToString()); + Log.Comment("Expected Exception: " + e.ToString()); Log.Comment("Trying to enable Dynamic DNS with a Static IP address correctly fails"); testResult = MFTestResults.Pass; } if (testNI.IsDynamicDnsEnabled) - testResult = MFTestResults.Fail; + throw new Exception("IsDynamicDnsEnabled data incorrect"); } catch (Exception e) @@ -433,7 +437,7 @@ public MFTestResults NetworkInterfaceTest6_StaticIP_DynamicDNS() ipSettings.Restore(testNI); } } - Log.Comment("Fixed Bug number: 20533 IsDynamicDnsEnabled incorrectly returns true after call to EnableDynamicDns()."); + return testResult; } @@ -492,70 +496,70 @@ public MFTestResults NetworkInterfaceTest7_DhcpRenewRelease() return testResult; } - [TestMethod] - public MFTestResults NetworkInterfaceTest8_GetHostEntry() - { - /// - /// 1. Save network configuration - /// 2. Enable Static IP (bad address) - /// 3. Enable Static DNS - /// 4. Test GetHostEntry - /// 5. Restore network configuration - /// - /// - MFTestResults testResult = MFTestResults.Pass; - - //don't run these tests on the emulator. The emulator is SKU # 3 - if (Microsoft.SPOT.Hardware.SystemInfo.SystemID.SKU == 3) - return MFTestResults.Skip; - - try - { - for (int i = 0; i < NetworkInterface.GetAllNetworkInterfaces().Length; ++i) - { - NetworkInterface testNI = NetworkInterface.GetAllNetworkInterfaces()[i]; - IPSettings ipConfig = new IPSettings(testNI); - - try - { - Log.Comment("EnableDhcp"); - testNI.EnableDhcp(); - - // leave the addresses alone, they are supposed to be somewhat bogus - Log.Comment("misconfigure the static IP configuration"); - testNI.EnableStaticIP(testNI.IPAddress, testNI.SubnetMask, testNI.GatewayAddress); - testNI.EnableStaticDns(new string[] { "157.54.14.146", "157.54.14.178" }); - - Log.Comment("get a DNS server host entry"); - IPHostEntry entry = Dns.GetHostEntry("msw.dns.microsoft.com"); + //[TestMethod] + //public MFTestResults NetworkInterfaceTest8_GetHostEntry() + //{ + // /// + // /// 1. Save network configuration + // /// 2. Enable Static IP (bad address) + // /// 3. Enable Static DNS + // /// 4. Test GetHostEntry + // /// 5. Restore network configuration + // /// + // /// + // MFTestResults testResult = MFTestResults.Pass; + + // //don't run these tests on the emulator. The emulator is SKU # 3 + // if (Microsoft.SPOT.Hardware.SystemInfo.SystemID.SKU == 3) + // return MFTestResults.Skip; + + // try + // { + // for (int i = 0; i < NetworkInterface.GetAllNetworkInterfaces().Length; ++i) + // { + // NetworkInterface testNI = NetworkInterface.GetAllNetworkInterfaces()[i]; + // IPSettings ipConfig = new IPSettings(testNI); + + // try + // { + // Log.Comment("EnableDhcp"); + // testNI.EnableDhcp(); + + // // leave the addresses alone, they are supposed to be somewhat bogus + // Log.Comment("misconfigure the static IP configuration"); + // testNI.EnableStaticIP(testNI.IPAddress, testNI.SubnetMask, testNI.GatewayAddress); + // testNI.EnableStaticDns(new string[] { "157.54.14.146", "157.54.14.178" }); + + // Log.Comment("get a DNS server host entry"); + // IPHostEntry entry = Dns.GetHostEntry("msw.dns.microsoft.com"); - } - catch (SocketException e) - { - Log.Comment("SocketException error code: " + e.ErrorCode); - Log.Comment(e.Message); - testResult = MFTestResults.Fail; - } - catch (Exception e) - { - Log.Comment("Caught exception: " + e.Message); - testResult = MFTestResults.Fail; - } - finally - { - ipConfig.Restore(testNI); - } - } - - } - catch (Exception e) - { - Log.Comment("Caught exception: " + e.Message); - testResult = MFTestResults.Fail; - } - Log.Comment("Bug number: 20845 GetHostEntry(\"msw.dns.microsoft.com\") fails with socket error code -1 on imxs_net platform"); - return testResult; - } + // } + // catch (SocketException e) + // { + // Log.Comment("SocketException error code: " + e.ErrorCode); + // Log.Comment(e.Message); + // testResult = MFTestResults.Fail; + // } + // catch (Exception e) + // { + // Log.Comment("Caught exception: " + e.Message); + // testResult = MFTestResults.Fail; + // } + // finally + // { + // ipConfig.Restore(testNI); + // } + // } + + // } + // catch (Exception e) + // { + // Log.Comment("Caught exception: " + e.Message); + // testResult = MFTestResults.Fail; + // } + + // return testResult; + //} [TestMethod] public MFTestResults NetworkInterfaceTest0_EnableStaticDnsTwice() diff --git a/Test/Platform/Tests/CLR/Microsoft.SPOT.Time/TimeServiceTests/ServiceTests.cs b/Test/Platform/Tests/CLR/Microsoft.SPOT.Time/TimeServiceTests/ServiceTests.cs index e8a81405e..067050ed1 100644 --- a/Test/Platform/Tests/CLR/Microsoft.SPOT.Time/TimeServiceTests/ServiceTests.cs +++ b/Test/Platform/Tests/CLR/Microsoft.SPOT.Time/TimeServiceTests/ServiceTests.cs @@ -127,19 +127,28 @@ public MFTestResults TimeServiceConfigTest0() return result; } - private void UpdateTimeNow() + private IPAddress GetTimeServiceAddress() { - for (int i = 0; i < 10; i++) + IPHostEntry entry = Dns.GetHostEntry("time.nist.gov"); + if (entry == null || entry.AddressList == null) { - TimeServiceStatus status = TimeService.UpdateNow(new byte[] { 192, 43, 244, 18 }, 10); + throw new ApplicationException("Get time service ip failed"); ; + } - if (status.Flags == TimeServiceStatus.TimeServiceStatusFlags.SyncSucceeded) - { + IPAddress timeServiceAddress = null; + for (int i = 0; i < entry.AddressList.Length; ++i) + { + timeServiceAddress = entry.AddressList[i]; + if (timeServiceAddress != null) break; - } + } - Thread.Sleep(100); + if (timeServiceAddress == null) + { + throw new ApplicationException("Get time service ip failed"); ; } + + return timeServiceAddress; } [TestMethod] @@ -149,7 +158,7 @@ public MFTestResults TimeServiceUpdateTest0() try { /// Now call UpdateNow this should set the time back to correct one. - UpdateTimeNow(); + TimeService.UpdateNow(GetTimeServiceAddress().GetAddressBytes(), 10); DateTime now = DateTime.Now; DateTime nowEbs = now; @@ -166,9 +175,9 @@ public MFTestResults TimeServiceUpdateTest0() TimeService.SetUtcTime(119600064000000000); /// 1/1/1980. /// DateTime old = DateTime.Now; - + /// Now call UpdateNow this should set the time back to correct one. - UpdateTimeNow(); + TimeService.UpdateNow(GetTimeServiceAddress().GetAddressBytes(), 10); DateTime end = DateTime.Now; @@ -201,7 +210,7 @@ public MFTestResults TimeServiceUpdateTest1() timerEvent.Reset(); TimeService.SystemTimeChanged += handler; - UpdateTimeNow(); + TimeService.UpdateNow(GetTimeServiceAddress().GetAddressBytes(), 10); if (!timerEvent.WaitOne(60 * 1000, false)) /// Wait some time for the event to be fired. { result = MFTestResults.Fail; @@ -226,14 +235,13 @@ public MFTestResults TimeServiceUpdateTest2() { /// This failure only happens in device. Skipping it for now. MFTestResults result = MFTestResults.Skip; - TimeSyncFailedEventHandler handler = new TimeSyncFailedEventHandler(TimeService_TimeSyncFailed); try { syncEvent.Reset(); TimeService.TimeSyncFailed += handler; - UpdateTimeNow(); + TimeService.UpdateNow(GetTimeServiceAddress().GetAddressBytes(), 10); if (!syncEvent.WaitOne(5 * 1000, false)) /// Wait some time for the event to be fired. { result = MFTestResults.Skip; @@ -322,11 +330,8 @@ public MFTestResults TimeServiceStartTest0() TimeService.SystemTimeChanged += handler; - byte[] primaryServer = new byte[] { 192, 43, 244, 18 }; - byte[] alternateServer = new byte[] { 129, 6, 15, 28 }; TimeServiceSettings settings = new TimeServiceSettings(); - settings.PrimaryServer = primaryServer; - settings.AlternateServer = alternateServer; + settings.PrimaryServer = GetTimeServiceAddress().GetAddressBytes(); settings.Tolerance = 100; settings.RefreshTime = 60; @@ -368,11 +373,8 @@ public MFTestResults TimeServiceStartTest1() TimeService.SetUtcTime(119600064000000000); /// 1/1/1980. /// - byte[] primaryServer = new byte[] { 192, 43, 244, 18 }; - byte[] alternateServer = new byte[] { 129, 6, 15, 28 }; TimeServiceSettings settings = new TimeServiceSettings(); - settings.PrimaryServer = primaryServer; - settings.AlternateServer = alternateServer; + settings.PrimaryServer = GetTimeServiceAddress().GetAddressBytes(); settings.Tolerance = 100; settings.RefreshTime = 60; @@ -415,11 +417,8 @@ public MFTestResults TimeServiceLastSyncStatusTest0() TimeService.SetUtcTime(119600064000000000); /// 1/1/1980. /// - byte[] primaryServer = new byte[] { 192, 43, 244, 18 }; - byte[] alternateServer = new byte[] { 129, 6, 15, 28 }; TimeServiceSettings settings = new TimeServiceSettings(); - settings.PrimaryServer = primaryServer; - settings.AlternateServer = alternateServer; + settings.PrimaryServer = GetTimeServiceAddress().GetAddressBytes(); settings.Tolerance = 100; settings.RefreshTime = 60; TimeServiceStatus status = null; diff --git a/Test/Platform/Tests/CLR/System/Http/FunctionalTests.cs b/Test/Platform/Tests/CLR/System/Http/FunctionalTests.cs index 7c333d22e..70fcda844 100644 --- a/Test/Platform/Tests/CLR/System/Http/FunctionalTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/FunctionalTests.cs @@ -45,7 +45,7 @@ public MFTestResults VisitMicrosoft() { Log.Comment("Small web page - redirect"); // Print for now, Parse later - string data = new string(Encoding.UTF8.GetChars(GetRequested("http://www.microsoft.com", "IIS"))); + string data = new string(Encoding.UTF8.GetChars(GetRequested("http://www.microsoft.com", "APACHE"))); } catch (Exception ex) { @@ -197,9 +197,6 @@ private byte[] GetRequested(string uri, params string[] servers) // Create request. HttpWebRequest request = HttpWebRequest.Create(uri) as HttpWebRequest; - // Set proxy information - WebProxy itgProxy = new WebProxy(HttpTests.Proxy, true); - request.Proxy = itgProxy; // Get response from server. WebResponse resp = null; try diff --git a/Test/Platform/Tests/CLR/System/Http/HttpKnownHeaderNamesTests.cs b/Test/Platform/Tests/CLR/System/Http/HttpKnownHeaderNamesTests.cs index 4076f1be4..2acd1c21e 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpKnownHeaderNamesTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/HttpKnownHeaderNamesTests.cs @@ -15,7 +15,14 @@ public class HttpKnownHeaderNamesTests : IMFTestInterface public InitializeResult Initialize() { Log.Comment("Adding set up for the tests."); - // Add your functionality here. + try + { + Microsoft.SPOT.Net.NetworkInformation.NetworkInterface[] nis = Microsoft.SPOT.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces(); + } + catch + { + return InitializeResult.Skip; + } return InitializeResult.ReadyToGo; } @@ -83,7 +90,7 @@ private bool VerifyHeaderIsLegal(WebHeaderCollection wrc, string header, string public MFTestResults TestSetHTTPRequestHeaderAfterCreateHTTP1_1() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -121,7 +128,7 @@ public MFTestResults TestSetHTTPRequestHeaderAfterCreateHTTP1_1() public MFTestResults ValidateAbleToSetPropertiesValueHTTP1_1() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -217,7 +224,7 @@ public MFTestResults ValidateAbleToSetPropertiesValueHTTP1_1() public MFTestResults TestSetHTTPRequestHeaderAfterCreateHTTP1_0() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -256,7 +263,7 @@ public MFTestResults TestSetHTTPRequestHeaderAfterCreateHTTP1_0() public MFTestResults ValidateAbleToSetPropertiesValueHTTP1_0() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 diff --git a/Test/Platform/Tests/CLR/System/Http/HttpRequestHeaderTests.cs b/Test/Platform/Tests/CLR/System/Http/HttpRequestHeaderTests.cs index 069acf98b..26af738a6 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpRequestHeaderTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/HttpRequestHeaderTests.cs @@ -82,7 +82,7 @@ private MFTestResults Verify(System.Net.WebHeaderCollection wrc, System.Net.WebH public MFTestResults ValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_1() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -166,7 +166,7 @@ public MFTestResults ValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_1_Http public MFTestResults InValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_1_Https() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("https://127.0.0.1:443/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("https://"+ Utilities.GetLocalIpAddress() + ":443/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Negative Test case 1:"); @@ -309,7 +309,7 @@ public MFTestResults InvalidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_1() public MFTestResults ValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_0() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -351,7 +351,7 @@ public MFTestResults ValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_0() public MFTestResults ValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_0_HTTPS() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("https://127.0.0.1:443/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("https://"+ Utilities.GetLocalIpAddress() + ":443/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -393,7 +393,7 @@ public MFTestResults ValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_0_HTTP public MFTestResults InValidDefaultTestGetHTTPRequestHeaderAfterCreateHTTP1_0_HTTPS() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("https://127.0.0.1:443/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("https://"+ Utilities.GetLocalIpAddress() + ":443/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Negative Test case 4:"); diff --git a/Test/Platform/Tests/CLR/System/Http/HttpServer.cs b/Test/Platform/Tests/CLR/System/Http/HttpServer.cs index 2ad2f258e..9deba9ceb 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpServer.cs +++ b/Test/Platform/Tests/CLR/System/Http/HttpServer.cs @@ -65,6 +65,8 @@ public void StartServer() s_CurrentPort++; throw new Exception("StartServer failed"); } + + s_CurrentPort++; } diff --git a/Test/Platform/Tests/CLR/System/Http/HttpStatusCodeTests.cs b/Test/Platform/Tests/CLR/System/Http/HttpStatusCodeTests.cs index b261ef743..9577bf5a8 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpStatusCodeTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/HttpStatusCodeTests.cs @@ -44,7 +44,7 @@ public MFTestResults ValidDefaultTestHTTPStatusCodeHTTP1_1() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -98,7 +98,7 @@ public MFTestResults DefaultTestHTTPStatusCodeHTTP1_1_Unauthorized() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/Unauth.html"); //expect 401 - Unauthorized + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/Unauth.html"); //expect 401 - Unauthorized wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -150,7 +150,7 @@ public MFTestResults DefaultTestHTTPStatusCodeHTTP1_1_NotFound() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotFound.html"); //expect 404 - NotFound + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotFound.html"); //expect 404 - NotFound wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -205,7 +205,7 @@ public MFTestResults DefaultTestHTTPStatusCodeHTTP1_1_NotExistUriPath() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotExistUriPath.html"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotExistUriPath.html"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -258,7 +258,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_SetChunked() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -288,7 +288,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_SendChunked_WithTransferEncoding( { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -361,7 +361,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Ambiguous() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/index.html"); //expect 300 - Ambiguous + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/index.html"); //expect 300 - Ambiguous wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -413,7 +413,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_BadGateway() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/Gateway.html"); //expect 502 - BadGateway + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/Gateway.html"); //expect 502 - BadGateway wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -467,7 +467,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Conflict() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/conflict.html"); //expect 409 - Conflict + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/conflict.html"); //expect 409 - Conflict wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -521,7 +521,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Moved() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/moved.html"); //expect 301 - Moved + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/moved.html"); //expect 301 - Moved wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -575,7 +575,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Redirect() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/redirect.html"); //expect 302 - Redirect + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/redirect.html"); //expect 302 - Redirect wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -629,7 +629,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_PaymentRequired() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/payment.html"); //expect 402 - PaymentRequired + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/payment.html"); //expect 402 - PaymentRequired wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -683,7 +683,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_RequestTimeout() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/testTimeOut.html"); //expect 408 - RequestTimeout + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/testTimeOut.html"); //expect 408 - RequestTimeout wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -739,7 +739,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_RequestUriTooLong() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/local/webpages/mysubdir/index.html"); //expect 414 - RequestUriTooLong + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/local/webpages/mysubdir/index.html"); //expect 414 - RequestUriTooLong wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -795,7 +795,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_ServiceUnavailable() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/service.html"); //expect 503 - ServiceUnavailable + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/service.html"); //expect 503 - ServiceUnavailable wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -851,7 +851,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_TemporaryRedirect() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/tempRedir.html"); //expect 307 - TemporaryRedirect + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/tempRedir.html"); //expect 307 - TemporaryRedirect wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -906,7 +906,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Accepted() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/accepted.html"); //expect 202 - Accepted + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/accepted.html"); //expect 202 - Accepted wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -961,7 +961,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_BadRequest() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/badRequest.html"); //expect 400 - BadRequest + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/badRequest.html"); //expect 400 - BadRequest wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1016,7 +1016,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Continue() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/continue.html"); //expect 100 - Continue + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/continue.html"); //expect 100 - Continue wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1073,7 +1073,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Created() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/created.html"); //expect 201 - Created + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/created.html"); //expect 201 - Created wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1128,7 +1128,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_ExpectationFailed() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/expfailed.html"); //expect 417 - ExpectationFailed + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/expfailed.html"); //expect 417 - ExpectationFailed wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1183,7 +1183,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Forbidden() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/forbidden.html"); //expect 403 - Forbidden + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/forbidden.html"); //expect 403 - Forbidden wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1238,7 +1238,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Found() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/found.html"); //expect 302 - Found + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/found.html"); //expect 302 - Found wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1293,7 +1293,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_GatewayTimeout() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/gateway.html"); //expect - GatewayTimeout + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/gateway.html"); //expect - GatewayTimeout wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1348,7 +1348,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Gone() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/gone.html"); //expect 410 - Gone + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/gone.html"); //expect 410 - Gone wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1402,7 +1402,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_HttpVersionNotSupported() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/httpversion.html"); //expect 505 - HttpVersionNotSupported + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/httpversion.html"); //expect 505 - HttpVersionNotSupported wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1457,7 +1457,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_InternalServerError() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/iserror.html"); //expect 500 - InternalServerError + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/iserror.html"); //expect 500 - InternalServerError wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1512,7 +1512,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_LengthRequired() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/lrequired.html"); //expect 411 - LengthRequired + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/lrequired.html"); //expect 411 - LengthRequired wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1567,7 +1567,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_MethodNotAllowed() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/method.html"); //expect 405 - MethodNotAllowed + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/method.html"); //expect 405 - MethodNotAllowed wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1622,7 +1622,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_NoContent() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/NoContent.html"); //expect 204 - NoContent + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/NoContent.html"); //expect 204 - NoContent wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1677,7 +1677,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_NonAuthoritativeInformation() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/nonauthInfo.html"); //expect 203 - NonAuthoritativeInformation + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/nonauthInfo.html"); //expect 203 - NonAuthoritativeInformation wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1732,7 +1732,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_NotAcceptable() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotAccept.html"); //expect - NotAcceptable + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotAccept.html"); //expect - NotAcceptable wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1787,7 +1787,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_NotImplemented() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotImplement.html"); //expect 501 - NotImplemented + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotImplement.html"); //expect 501 - NotImplemented wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1842,7 +1842,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_NotModified() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotModified.html"); //expect - NotModified + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/NotModified.html"); //expect - NotModified wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1897,7 +1897,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_PartialContent() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/PContent.html"); //expect 206 - PartialContent + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/PContent.html"); //expect 206 - PartialContent wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -1952,7 +1952,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_PreconditionFailed() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/Precond.html"); //expect 412 - PreconditionFailed + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/Precond.html"); //expect 412 - PreconditionFailed wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2007,7 +2007,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_ProxyAuthenticationRequired() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/ProxyAuth.html"); //expect - ProxyAuthenticationRequired + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/ProxyAuth.html"); //expect - ProxyAuthenticationRequired wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2062,7 +2062,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_RedirectMethod() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/RMethod.html"); //expect - RedirectMethod + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/RMethod.html"); //expect - RedirectMethod wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2117,7 +2117,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_RequestedRangeNotSatisfiable() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/reqRange.html"); //expect 416 - RequestedRangeNotSatisfiable + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/reqRange.html"); //expect 416 - RequestedRangeNotSatisfiable wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2172,7 +2172,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_RequestEntityTooLarge() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/reqEntity.html"); //expect 413 - RequestEntityTooLarge + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/reqEntity.html"); //expect 413 - RequestEntityTooLarge wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2227,7 +2227,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_ResetContent() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/ResetContent.html"); //expect - ResetContent + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/ResetContent.html"); //expect - ResetContent wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2282,7 +2282,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_SeeOther() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/SeeOther.html"); //expect - SeeOther + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/SeeOther.html"); //expect - SeeOther wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2337,7 +2337,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_SwitchingProtocols() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/SwitchProt.html"); //expect - SwitchingProtocols + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/SwitchProt.html"); //expect - SwitchingProtocols wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2392,7 +2392,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Unauthorized() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/Unauth.html"); //expect - Unauthorized + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/Unauth.html"); //expect - Unauthorized wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2447,7 +2447,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_Unused() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/Unused.html"); //expect - Unused + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/Unused.html"); //expect - Unused wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2502,7 +2502,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_1_UseProxy() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webpages/UseProxy.html"); //expect - UseProxy + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webpages/UseProxy.html"); //expect - UseProxy wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "GET"; @@ -2556,7 +2556,7 @@ public MFTestResults TestHTTPStatusCodeHTTP1_0_SendChunked_WithTransferEncoding( { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 diff --git a/Test/Platform/Tests/CLR/System/Http/HttpTests.csproj b/Test/Platform/Tests/CLR/System/Http/HttpTests.csproj index de5b1aec8..a8f1abe8f 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpTests.csproj +++ b/Test/Platform/Tests/CLR/System/Http/HttpTests.csproj @@ -1,4 +1,5 @@ - + + Microsoft.SPOT.Platform.Tests.HttpTests Exe @@ -25,6 +26,7 @@ + @@ -63,4 +65,4 @@ $(BUILD_TREE_DLL)\System.Xml.dll - + \ No newline at end of file diff --git a/Test/Platform/Tests/CLR/System/Http/HttpVersionTests.cs b/Test/Platform/Tests/CLR/System/Http/HttpVersionTests.cs index 1b46fb0bc..97611d538 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpVersionTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/HttpVersionTests.cs @@ -40,25 +40,16 @@ private MFTestResults Verify(HttpWebRequest Request, Version ExpectedVersion) { MFTestResults result = MFTestResults.Pass; - // Assign Proxy - Request.Proxy = new WebProxy(HttpTests.Proxy, true); - HttpWebResponse myResponse = (HttpWebResponse)Request.GetResponse(); Log.Comment("Version after assignment:" + Request.ProtocolVersion); Log.Comment("Response version:" + myResponse.ProtocolVersion); - if (Request.ProtocolVersion.Major != ExpectedVersion.Major && Request.ProtocolVersion.Minor != ExpectedVersion.Major) + if (Request.ProtocolVersion.Major != ExpectedVersion.Major || Request.ProtocolVersion.Minor != ExpectedVersion.Minor) { Log.Exception("Expected Request Version " + ExpectedVersion); result = MFTestResults.Fail; } - if (myResponse.ProtocolVersion != HttpVersion.Version11) - { - Log.Exception("Expected Response Version 1.1"); - result = MFTestResults.Fail; - } - return result; } @@ -73,11 +64,6 @@ public MFTestResults VerifyDefault() try { HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://www.microsoft.com"); - if (myRequest.ProtocolVersion != HttpVersion.Version11) - { - Log.Exception("Expected Version 1.1, but got " + myRequest.ProtocolVersion); - return MFTestResults.Fail; - } result = Verify(myRequest, HttpVersion.Version11); } catch (Exception ex) diff --git a/Test/Platform/Tests/CLR/System/Http/HttpWebRequestTests.cs b/Test/Platform/Tests/CLR/System/Http/HttpWebRequestTests.cs index 203f12857..3d4f3a24f 100644 --- a/Test/Platform/Tests/CLR/System/Http/HttpWebRequestTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/HttpWebRequestTests.cs @@ -25,7 +25,6 @@ public InitializeResult Initialize() return InitializeResult.Skip; } - return InitializeResult.ReadyToGo; } @@ -69,14 +68,14 @@ public MFTestResults ConstructorTestsNullArgs() { Log.Comment("Create string request"); string URL = null; - try - { + try + { HttpWebRequest strRequest = (HttpWebRequest)HttpWebRequest.Create(URL); Log.Exception("Expected ArgumentNullException"); result = MFTestResults.Fail; } - catch (Exception ex) - { + catch (Exception ex) + { /* pass case */ if (!HttpTests.ValidateException(ex, typeof(ArgumentNullException))) result = MFTestResults.Fail; @@ -84,8 +83,8 @@ public MFTestResults ConstructorTestsNullArgs() Log.Comment("Create URI request"); Uri uri = null; - try - { + try + { HttpWebRequest uriRequest = (HttpWebRequest)HttpWebRequest.Create(uri); Log.Exception("Expected ArgumentNullException"); result = MFTestResults.Fail; @@ -114,8 +113,8 @@ public MFTestResults ConstructorTestsEmptyArgs() { Log.Comment("Create string request"); string URL = ""; - try - { + try + { HttpWebRequest strRequest = (HttpWebRequest)HttpWebRequest.Create(URL); Log.Exception("Expected ArgumentException"); result = MFTestResults.Fail; @@ -159,7 +158,7 @@ public MFTestResults AddRangeValidTests() { Log.Exception("Expected bytes=-1, but got " + wr.Headers["Range"]); result = MFTestResults.Fail; - } + } Log.Comment("AddRange(100, 500)"); wr = (HttpWebRequest)WebRequest.Create(HttpTests.MSUrl); wr.AddRange(100, 500); @@ -216,8 +215,8 @@ public MFTestResults AddRangeInvalidTests() { Log.Comment("invalid from - AddRange(-1, 500)"); wr = (HttpWebRequest)WebRequest.Create(HttpTests.MSUrl); - try - { + try + { wr.AddRange(-1, 500); Log.Exception("Expected ArgumentOutOfRangeException"); result = MFTestResults.Fail; @@ -339,7 +338,7 @@ private bool TestCheckBadHeaders(string value) public MFTestResults AcceptHeaderTest() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(HttpTests.MSUrl);; + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create(HttpTests.MSUrl); ; try { Log.Comment("Initial value should be null"); @@ -470,13 +469,13 @@ public MFTestResults ProtocolVersion() public MFTestResults SetHeadersAfterRequest() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpTestServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://" + Utilities.GetLocalIpAddress() + ":" + HttpTestServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; - HttpTestServer server = new HttpTestServer("http", ref result) - { + HttpTestServer server = new HttpTestServer("http", ref result) + { RequestUri = wr.RequestUri, RequestHeaders = wr.Headers, - ResponseString = "SetHeadersAfterRequest" + ResponseString = "SetHeadersAfterRequest" }; try @@ -569,7 +568,8 @@ public MFTestResults SetHeadersAfterRequest() public MFTestResults FunctionalChunkTests() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpTestServer.s_CurrentPort.ToString() + "/"); + string currentPort = HttpTestServer.s_CurrentPort.ToString(); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + currentPort + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.KeepAlive = true; HttpTestServer server = new HttpTestServer("http", ref result) @@ -606,10 +606,10 @@ public MFTestResults FunctionalChunkTests() result = MFTestResults.Fail; Log.Exception("[Client] Expected stream, but got null"); } - } + } Log.Comment("Send Chunked"); - wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpTestServer.s_CurrentPort.ToString() + "/"); + wr = (HttpWebRequest)WebRequest.Create("http://" + Utilities.GetLocalIpAddress() + ":" + currentPort + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.SendChunked = true; server.SendChunked = true; diff --git a/Test/Platform/Tests/CLR/System/Http/TestServer.cs b/Test/Platform/Tests/CLR/System/Http/TestServer.cs index a4bfd07ec..db3ddc044 100644 --- a/Test/Platform/Tests/CLR/System/Http/TestServer.cs +++ b/Test/Platform/Tests/CLR/System/Http/TestServer.cs @@ -45,6 +45,8 @@ public void StartServer() s_CurrentPort++; throw new Exception("Unable to start server"); } + + s_CurrentPort++; } public void StopServer() diff --git a/Test/Platform/Tests/CLR/System/Http/Utilities.cs b/Test/Platform/Tests/CLR/System/Http/Utilities.cs new file mode 100644 index 000000000..7c803cd21 --- /dev/null +++ b/Test/Platform/Tests/CLR/System/Http/Utilities.cs @@ -0,0 +1,28 @@ +using System; +using Microsoft.SPOT; +using Microsoft.SPOT.Net.NetworkInformation; +using System.Threading; + +namespace Microsoft.SPOT.Platform.Tests +{ + class Utilities + { + internal static string GetLocalIpAddress() + { + while (true) + { + var netifs = NetworkInterface.GetAllNetworkInterfaces(); + foreach (var itf in netifs) + { + if (itf.IPAddress == "0.0.0.0" || itf.IPAddress == "127.0.0.1") + continue; + + Debug.Print("Found IP: " + itf.IPAddress); + return itf.IPAddress; + } + + Thread.Sleep(1000); + } + } + } +} diff --git a/Test/Platform/Tests/CLR/System/Http/WebExceptionTests.cs b/Test/Platform/Tests/CLR/System/Http/WebExceptionTests.cs index 05b4cb01b..35c7f1021 100644 --- a/Test/Platform/Tests/CLR/System/Http/WebExceptionTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/WebExceptionTests.cs @@ -24,7 +24,6 @@ public InitializeResult Initialize() return InitializeResult.Skip; } - return InitializeResult.ReadyToGo; } @@ -74,7 +73,7 @@ public MFTestResults TestWebExceptionHTTP1_1_ConnectionClosed() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/ConnClose.html"); //expect ConnectionClosed + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/ConnClose.html"); //expect ConnectionClosed wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -122,7 +121,7 @@ public MFTestResults TestWebExceptionHTTP1_1_KeepAliveFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/KeepAliveFailure.html"); //expect KeepAliveFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/KeepAliveFailure.html"); //expect KeepAliveFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -170,7 +169,7 @@ public MFTestResults TestWebExceptionHTTP1_1_Pending() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/Pending.html"); //expect Pending + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/Pending.html"); //expect Pending wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -217,7 +216,7 @@ public MFTestResults TestWebExceptionHTTP1_1_PipelineFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/PipelineFailure.html"); //expect PipelineFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/PipelineFailure.html"); //expect PipelineFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -264,7 +263,7 @@ public MFTestResults TestWebExceptionHTTP1_1_ProxyNameResolutionFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/ProxyNameResolutionFailure.html"); //expect ProxyNameResolutionFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/ProxyNameResolutionFailure.html"); //expect ProxyNameResolutionFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -312,7 +311,7 @@ public MFTestResults TestWebExceptionHTTP1_1_ReceiveFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/ReceiveFailure.html"); //expect ReceiveFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/ReceiveFailure.html"); //expect ReceiveFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -360,7 +359,7 @@ public MFTestResults TestWebExceptionHTTP1_1_RequestCanceled() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/RequestCanceled.html"); //expect RequestCanceled + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/RequestCanceled.html"); //expect RequestCanceled wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -408,7 +407,7 @@ public MFTestResults TestWebExceptionHTTP1_1_SecureChannelFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/SecureChannelFailure.html"); //expect SecureChannelFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/SecureChannelFailure.html"); //expect SecureChannelFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -456,7 +455,7 @@ public MFTestResults TestWebExceptionHTTP1_1_SendFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/SendFailure.html"); //expect SendFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/SendFailure.html"); //expect SendFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -504,7 +503,7 @@ public MFTestResults TestWebExceptionHTTP1_1_Success() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/Success.html"); //expect Success + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/Success.html"); //expect Success wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -552,7 +551,7 @@ public MFTestResults TestWebExceptionHTTP1_1_Timeout() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/Timeout.html"); //expect Timeout + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/Timeout.html"); //expect Timeout wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -600,7 +599,7 @@ public MFTestResults TestWebExceptionHTTP1_1_TrustFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/TrustFailure.html"); //expect TrustFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/TrustFailure.html"); //expect TrustFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -648,7 +647,7 @@ public MFTestResults TestWebExceptionHTTP1_1_ConnectFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/ConnectFailure.html"); //expect ConnectFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/ConnectFailure.html"); //expect ConnectFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -696,7 +695,7 @@ public MFTestResults TestWebExceptionHTTP1_1_NameResolutionFailure() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/NameResolutionFailure.html"); //expect NameResolutionFailure + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/NameResolutionFailure.html"); //expect NameResolutionFailure wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -744,7 +743,7 @@ public MFTestResults TestWebExceptionHTTP1_1_ProtocolError() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/ProtocolError.html"); //expect ProtocolError + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/ProtocolError.html"); //expect ProtocolError wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; @@ -792,7 +791,7 @@ public MFTestResults TestWebExceptionHTTP1_1_ServerProtocolViolation() MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/webexception/ServerProtocolViolation.html"); //expect ServerProtocolViolation + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/webexception/ServerProtocolViolation.html"); //expect ServerProtocolViolation wr.UserAgent = ".Net Micro Framwork Device/4.0"; wr.Method = "HEAD"; diff --git a/Test/Platform/Tests/CLR/System/Http/WebHeaderCollectionTests.cs b/Test/Platform/Tests/CLR/System/Http/WebHeaderCollectionTests.cs index 01eac8dd3..0adef01fc 100644 --- a/Test/Platform/Tests/CLR/System/Http/WebHeaderCollectionTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/WebHeaderCollectionTests.cs @@ -119,7 +119,7 @@ public MFTestResults TestWebHeaderCollectionAddIllegal() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -162,7 +162,7 @@ public MFTestResults TestWebHeaderCollectionAddIllegal2() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -204,7 +204,7 @@ public MFTestResults TestWebHeaderCollectionAddIllegal2() public MFTestResults TestWebHeaderCollectionAddLegal2() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -301,7 +301,7 @@ public MFTestResults TestWebHeaderCollectionIsRestricted() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); //expect 200 - OK wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 @@ -343,7 +343,7 @@ public MFTestResults TestWebHeaderCollectionIsRestricted() public MFTestResults TestWebHeaderCollectionRemove() { MFTestResults result = MFTestResults.Pass; - HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); wr.UserAgent = ".Net Micro Framwork Device/4.0"; Log.Comment("Initial version: " + wr.ProtocolVersion); //Default version is 1.1 diff --git a/Test/Platform/Tests/CLR/System/Http/WebResponseTests.cs b/Test/Platform/Tests/CLR/System/Http/WebResponseTests.cs index 8a995c6dd..227dadbc3 100644 --- a/Test/Platform/Tests/CLR/System/Http/WebResponseTests.cs +++ b/Test/Platform/Tests/CLR/System/Http/WebResponseTests.cs @@ -24,7 +24,6 @@ public InitializeResult Initialize() return InitializeResult.Skip; } - return InitializeResult.ReadyToGo; } @@ -43,7 +42,7 @@ public MFTestResults NotSupportExceptionTest() try { Log.Comment("WebResponse Test"); - HttpWebRequest wrStr = (HttpWebRequest)WebRequest.Create("http://127.0.0.1:" + HttpServer.s_CurrentPort.ToString() + "/"); + HttpWebRequest wrStr = (HttpWebRequest)WebRequest.Create("http://"+ Utilities.GetLocalIpAddress() + ":" + HttpServer.s_CurrentPort.ToString() + "/"); HttpServer server = new HttpServer("http", ref result) { diff --git a/Test/Platform/Tests/CLR/System/Text/Regexp/GroupTests.cs b/Test/Platform/Tests/CLR/System/Text/Regexp/GroupTests.cs index 021572fe8..f069c1028 100644 --- a/Test/Platform/Tests/CLR/System/Text/Regexp/GroupTests.cs +++ b/Test/Platform/Tests/CLR/System/Text/Regexp/GroupTests.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.SPOT; using Microsoft.SPOT.Platform.Test; using System.Text.RegularExpressions; @@ -63,23 +63,23 @@ public MFTestResults RegExpTest_6_Group_Test_1_GroupCollection() { /* // The example displays the following output: - // �: Microsoft - // �: Excel - // �: Access - // �: Outlook - // �: PowerPoint - // �: Silverlight + // ®: Microsoft + // ®: Excel + // ®: Access + // ®: Outlook + // ®: PowerPoint + // ™: Silverlight // Found 6 trademarks or registered trademarks. */ bool result = true; int expectedCount = 6; - string pattern = @"\b(\w+?)([��])"; - string input = "Microsoft� Office Professional Edition combines several office " + - "productivity products, including Word, Excel�, Access�, Outlook�, " + - "PowerPoint�, and several others. Some guidelines for creating " + + string pattern = @"\b(\w+?)([®™])"; + string input = "Microsoft® Office Professional Edition combines several office " + + "productivity products, including Word, Excel®, Access®, Outlook®, " + + "PowerPoint®, and several others. Some guidelines for creating " + "corporate documents using these productivity tools are available " + - "from the documents created using Silverlight� on the corporate " + + "from the documents created using Silverlight™ on the corporate " + "intranet site."; Regex test = new Regex(pattern); MatchCollection matches = test.Matches(input); @@ -96,27 +96,27 @@ public MFTestResults RegExpTest_6_Group_Test_1_GroupCollection() result = false; } - if (matches[0].ToString() != "Microsoft�") + if (matches[0].ToString() != "Microsoft®") { result = false; } - else if (matches[1].ToString() != "Excel�") + else if (matches[1].ToString() != "Excel®") { result = false; } - else if (matches[2].ToString() != "Access�") + else if (matches[2].ToString() != "Access®") { result = false; } - else if (matches[3].ToString() != "Outlook�") + else if (matches[3].ToString() != "Outlook®") { result = false; } - else if (matches[4].ToString() != "PowerPoint�") + else if (matches[4].ToString() != "PowerPoint®") { result = false; } - else if (matches[5].ToString() != "Silverlight�") + else if (matches[5].ToString() != "Silverlight™") { result = false; } diff --git a/Test/Platform/Tests/CLR/mscorlib/interfaces/InterfaceTests.cs b/Test/Platform/Tests/CLR/mscorlib/interfaces/InterfaceTests.cs index 7aec38262..035b63c2f 100644 --- a/Test/Platform/Tests/CLR/mscorlib/interfaces/InterfaceTests.cs +++ b/Test/Platform/Tests/CLR/mscorlib/interfaces/InterfaceTests.cs @@ -513,7 +513,8 @@ public MFTestResults Interface_ifreimp_01_Test() } else { - return MFTestResults.Fail; + Log.Comment("This in a known bug captured in Issue #95"); + return MFTestResults.KnownFailure; } } [TestMethod] @@ -527,7 +528,8 @@ public MFTestResults Interface_ifreimp_02_Test() } else { - return MFTestResults.Fail; + Log.Comment("This in a known bug captured in Issue #95"); + return MFTestResults.KnownFailure; } } [TestMethod] diff --git a/Test/Platform/Tests/CLR/mscorlib/systemlib/systemlib2/SystemDateTimeTests.cs b/Test/Platform/Tests/CLR/mscorlib/systemlib/systemlib2/SystemDateTimeTests.cs index 00579c4e7..a077209ef 100644 --- a/Test/Platform/Tests/CLR/mscorlib/systemlib/systemlib2/SystemDateTimeTests.cs +++ b/Test/Platform/Tests/CLR/mscorlib/systemlib/systemlib2/SystemDateTimeTests.cs @@ -11,10 +11,6 @@ namespace Microsoft.SPOT.Platform.Tests { public class SystemDateTimeTests : IMFTestInterface { - // Ticks at 12:00 AM January 1, year 1601 A.D. - private const long TicksAtOrigin = 504911232000000000; - private const long MaxTicks = 946708127990000000; - [SetUp] public InitializeResult Initialize() { @@ -119,7 +115,7 @@ public MFTestResults DateTime_ConstructorTest3() Log.Comment("Creating Minimum DateTime and verifying"); DateTime minDT1 = DateTime.MinValue; DateTime minDT2 = new DateTime(); - DateTime minDT3 = new DateTime(TicksAtOrigin); + DateTime minDT3 = new DateTime(0); DateTime minDT4 = new DateTime(1601, 1, 1, 0, 0, 0, 0); if ((DateTime.Compare(minDT1, minDT2) != 0) || @@ -135,10 +131,10 @@ public MFTestResults DateTime_ConstructorTest3() } Log.Comment("Creating Maximum DateTime and verifying"); - DateTime maxDateTime = new DateTime(MaxTicks); + DateTime maxDateTime = new DateTime(441796895990000000); if (!DateTime.MaxValue.Equals(maxDateTime)) { - Log.Comment("Expected Ticks '946708127990000000' but got '" + DateTime.MaxValue.Ticks + "'"); + Log.Comment("Expected Ticks '441796895990000000' but got '" + DateTime.MaxValue.Ticks + "'"); testResult = MFTestResults.Fail; } } @@ -1320,7 +1316,7 @@ public MFTestResults DateTime_op_Subtraction_DateTimeTest31() for (int i = 0; i < dtArr.Length; i++) { DateTime dt1 = dtArr[i]; - DateTime dt2 = new DateTime(random.Next(1000) + 1 + TicksAtOrigin); + DateTime dt2 = new DateTime(random.Next(1000) + 1); TimeSpan ts = dt1 - dt2; if (ts.Ticks != (dt1.Ticks - dt2.Ticks)) { @@ -1566,9 +1562,9 @@ public MFTestResults DateTime_MinValueTest39() { Log.Comment("Getting the Min. DateTime and Verifying"); DateTime field = DateTime.MinValue; - if (field.Ticks != TicksAtOrigin) + if (field.Ticks != 0) { - Log.Comment("Failure : expected DateTime.MinValue = '504911232000000000' but got '" + field.Ticks + "'"); + Log.Comment("Failure : expected DateTime.MinValue = '0' but got '" + field.Ticks + "'"); testResult = MFTestResults.Fail; } } @@ -1594,9 +1590,9 @@ public MFTestResults DateTime_MaxValueTest40() Log.Comment("Getting the Max. DateTime and Verifying"); DateTime field = DateTime.MaxValue; Log.Comment(field.Ticks.ToString()); - if (field.Ticks != MaxTicks) + if (field.Ticks != 441796895990000000) { - Log.Comment("Failure : expected DateTime.MaxValue = '946708127990000000'" + + Log.Comment("Failure : expected DateTime.MinValue = '441796895990000000'" + " but got '" + field.Ticks + "'"); testResult = MFTestResults.Fail; } @@ -1944,15 +1940,12 @@ public MFTestResults DateTime_TicksTest52() MFTestResults testResult = MFTestResults.Pass; try { - // This is an arbitrary ticks value which corresponds to a point of time in year 2015 - long testTicks = 635688622030533832; - Log.Comment("Creating a DateTime, getting the Ticks and Verifying"); - DateTime testDateTime = new System.DateTime(testTicks); + DateTime testDateTime = new System.DateTime(0); long _ticks = testDateTime.Ticks; - if (_ticks != testTicks) + if (_ticks != 0) { - Log.Comment("Failure : Expected ticks '635688622030533832' but got '" + _ticks + "'"); + Log.Comment("Failure : Expected ticks '0' but got '" + _ticks + "'"); testResult = MFTestResults.Fail; } } diff --git a/crypto/dotNetMF.proj b/crypto/dotNetMF.proj index 828a422f3..e786c22f7 100644 --- a/crypto/dotNetMF.proj +++ b/crypto/dotNetMF.proj @@ -52,39 +52,46 @@ true true + + thumb2 + $(INSTRUCTION_SET) CryptoLib - CryptoLibX86 + CryptoLibX86 - - lib\$(INSTRUCTION_SET)\$(DOTNETMF_COMPILER)\crypto.$(LIB_EXT) - lib\$(INSTRUCTION_SET)\RVDS4.0\crypto.$(LIB_EXT) - lib\$(INSTRUCTION_SET)\RVDS3.1\crypto.$(LIB_EXT) - lib\$(INSTRUCTION_SET)\MTWR8.0\crypto.$(LIB_EXT) + + lib\$(CryptoInstructionSet)\$(DOTNETMF_COMPILER)\crypto.$(LIB_EXT) + lib\$(CryptoInstructionSet)\RVDS4.0\crypto.$(LIB_EXT) + lib\$(CryptoInstructionSet)\RVDS3.1\crypto.$(LIB_EXT) + lib\$(CryptoInstructionSet)\MTWR8.0\crypto.$(LIB_EXT) $(LIB_DIR)\crypto_stub.$(LIB_EXT) crypto.$(LIB_EXT) - - + + crypto.lib - + crypto.pdb - + crypto.lib - + - + diff --git a/crypto/inc/crypto.h b/crypto/inc/crypto.h index 75f036305..795ac6619 100644 --- a/crypto/inc/crypto.h +++ b/crypto/inc/crypto.h @@ -159,8 +159,14 @@ extern ALIGN const RSABuffer dotNetMFPublicKeyModulus; // For RSA_VERIFYSIGNATURE pass the buffer in pSourceText and the signature in pDestText // -CRYPTO_RESULT Crypto_StartRSAOperationWithKey(enum RSAOperations operation, RSAKey *pRSAKey, BYTE *pSourceText, DWORD cbSourceText, BYTE *pDestText, DWORD cbDestText, - void **ppHandle); +CRYPTO_RESULT Crypto_StartRSAOperationWithKey( enum RSAOperations operation + , RSAKey *pRSAKey + , BYTE *pSourceText + , DWORD cbSourceText + , BYTE *pDestText + , DWORD cbDestText + , void **ppHandle + ); // diff --git a/setup/Features/Tools.wxs b/setup/Features/Tools.wxs index 814f12863..efe5405f9 100644 --- a/setup/Features/Tools.wxs +++ b/setup/Features/Tools.wxs @@ -11,6 +11,7 @@ + - 160 - 150 - gokulk;richh + 400 + 100040160 + 272 + smaillet;mortezag + + + + + + + + + + x.ItemSpec)); + System.IO.File.AppendAllText(File, text); + ]]> + + + @@ -159,8 +188,10 @@ - - + + + + diff --git a/tools/Targets/Microsoft.Spot.system.mdk.targets b/tools/Targets/Microsoft.Spot.system.mdk.targets index 2292907a9..924952a8d 100644 --- a/tools/Targets/Microsoft.Spot.system.mdk.targets +++ b/tools/Targets/Microsoft.Spot.system.mdk.targets @@ -89,10 +89,10 @@ $(SWTC)asm $(SWTC)interleave - $(CC_CPP_TARGETTYPE_FLAGS) $(SWTC)no_debug $(SWTC)dwarf2 $(SWTC)no_debug_macros -O3 $(SWTC)inline -Otime $(SWTC)no_autoinline $(CC_CPP_ASM_INTERLEAVE) - $(CC_CPP_TARGETTYPE_FLAGS) $(SWTC)debug $(SWTC)dwarf2 $(SWTC)debug_macros -O0 $(SWTC)inline $(CC_CPP_ASM_INTERLEAVE) - $(CC_CPP_TARGETTYPE_FLAGS) $(SWTC)debug $(SWTC)dwarf2 $(SWTC)debug_macros -O0 $(SWTC)inline $(CC_CPP_ASM_INTERLEAVE) - $(CC_CPP_TARGETTYPE_FLAGS) $(SWTC)no_debug $(SWTC)dwarf2 $(SWTC)no_debug_macros -O2 $(SWTC)inline -Otime $(SWTC)no_autoinline $(CC_CPP_ASM_INTERLEAVE) + $(CC_CPP_TARGETTYPE_FLAGS) -g -O3 $(SWTC)inline -Otime $(SWTC)no_autoinline $(CC_CPP_ASM_INTERLEAVE) + $(CC_CPP_TARGETTYPE_FLAGS) -g -O0 $(SWTC)inline $(CC_CPP_ASM_INTERLEAVE) + $(CC_CPP_TARGETTYPE_FLAGS) -g -O0 $(SWTC)inline $(CC_CPP_ASM_INTERLEAVE) + $(CC_CPP_TARGETTYPE_FLAGS) -g -O2 $(SWTC)inline -Otime $(SWTC)no_autoinline $(CC_CPP_ASM_INTERLEAVE) $(AS_FLAGS) $(SWTC)diag_suppress A1658 @@ -125,8 +125,8 @@ - $(AS_TARGETTYPE_FLAGS) $(SWTC)PD "BUILD_RTM SETS \"1\"" - $(AS_TARGETTYPE_FLAGS) $(SWTC)PD "BUILD_RTM SETS \"0\"" + $(AS_TARGETTYPE_FLAGS) $(SWTC)PD "BUILD_RTM SETS \"1\"" -g + $(AS_TARGETTYPE_FLAGS) $(SWTC)PD "BUILD_RTM SETS \"0\"" -g $(AS_TARGETTYPE_FLAGS) $(SWTC)PD "BUILD_RTM SETS \"0\"" -g $(AS_TARGETTYPE_FLAGS) $(SWTC)PD "BUILD_RTM SETS \"0\"" -g diff --git a/tools/bin/BLANK.KEY b/tools/bin/BLANK.KEY new file mode 100644 index 000000000..4d9eb097f --- /dev/null +++ b/tools/bin/BLANK.KEY @@ -0,0 +1,5 @@ + + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8= + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8= + \ No newline at end of file diff --git a/tools/bin/tinybooter_metadataprocessor_key_readme.txt b/tools/bin/tinybooter_metadataprocessor_key_readme.txt new file mode 100644 index 000000000..4bcd97d93 --- /dev/null +++ b/tools/bin/tinybooter_metadataprocessor_key_readme.txt @@ -0,0 +1,16 @@ +this is an example of how to use the signature facilities in the metadata processor to be uploaded to the device with the tinybooter +the bin file must be signed and upload must use the hex file + +the public key is heardcoded in the tinybooter and must match the private key + +of course a decent Key management strategy generates the private key only once and does not keep it in the source tree + +use the sign_file script to sign files after building them +remember to sign the binary files and to upload the corresponding hex files +if the signature files are placed in the same directory where the hex files are and if they have the same name plus the ".sig" extension, than FlashLiteClient will load the signature automatically + +MetaDataProcessor.exe +-dump_key tinybooter_public_key.bin +-dump_key tinybooter_private_key.bin +-sign_file %SPOCLIENT%_BUILD\arm\FLASH\release\AUXD\bin\tinyclr.bin\ER_DAT tinybooter_private_key.bin %SPOCLIENT%_BUILD\arm\FLASH\release\AUXD\bin\tinyclr.hex\ER_DAT.sig +-verify_signature %SPOCLIENT%_BUILD\arm\FLASH\release\AUXD\bin\tinyclr.bin\ER_DAT tinybooter_public_key.bin %SPOCLIENT%_BUILD\arm\FLASH\release\AUXD\bin\tinyclr.hex\ER_DAT.sig diff --git a/tools/bin/tinybooter_private_key.bin b/tools/bin/tinybooter_private_key.bin new file mode 100644 index 0000000000000000000000000000000000000000..ac9a14065e137911e500d564968227429db25bb1 GIT binary patch literal 260 zcmV+f0sHMD3Onk~UIFolLew5l%$r0!eDcr+0vkev!~H$UNE zR;>r&=f;}HGE%knm-E32`X0b}&S769iR_Y?21npGo3nUh5Bn+OZC}3uG3`#9<`N*d zBcNi)yk?iTfMo4tW=SZvIX~3sX$F5>1p2+-dAp6-lMDF)yy%a6dm^E)=i&hr><-%> z8D42JU8X@DyE0{}*gH&W^d_!(M2&t+ue8L^3lt?tuxMsTy{ zOu>G!JkS(ya1r9E-YKVsUd5Z)S}vxxID#PPz$^rbMTH1kDjfsn+0A!wVE>sN>SKpf zQR*09E~j?g7Ip@rNLw%{C2P;IGPKfb7Q4!NCTn=SmJZ)}d?(AYMVMO&M-^MhAl=eU zJ^(N~CEa?!b?JoQz}P#;REx*IIAnfs(ot)_;Yt=>UTU3`mAG$+Zioa#pvSj&TuOPW z!>&gO;52PN;ZANvRf&;h-iWQL1;V9_CB$P)=jj*#=Ci)Tg6?`#hqI9zu$=HPPq!M~ K20PS~e@6=dcYPxO literal 0 HcmV?d00001 diff --git a/tools/bin/tinybooter_public_key.bin b/tools/bin/tinybooter_public_key.bin new file mode 100644 index 0000000000000000000000000000000000000000..69d54aaafba8cbd8d6d8dbe24d8908560a26027d GIT binary patch literal 260 zcmZQ%U|{e)CHPR_bd}cUS6UUOvvdy{8??4LZds+zzT{o>i3$@zwFz^%3eD{wCWNhJ zfB5{^tm8&OTfa^Je30vx+=0q-iSa6(Zzj!PbAMnydvirH|8LF5x$*lM4d43BekP=_ xLwP~ci9Ko4w>PA`O-b|A*k);eo(e45Gg1Se6;eO=JK|D=`Gu4(WLO=fDTKiYb!^zmMrtLn`g@l68_JWeU;oE x9QaBiUT=BXU9mE@MIO-x8mignHyUlZlr6UVRFztG#hz(=_Zb-&fvy-h002A^J`ex^ literal 0 HcmV?d00001 diff --git a/tools/scripts/compile_stringtable.cmd b/tools/scripts/compile_stringtable.cmd deleted file mode 100644 index b27644881..000000000 --- a/tools/scripts/compile_stringtable.cmd +++ /dev/null @@ -1,12 +0,0 @@ -@echo off -SETLOCAL - -call %~dp0\init.cmd - -if not exist %BUILD_TREE_CLIENT%\Stubs md %BUILD_TREE_CLIENT%\Stubs - -@rem ################################################################################ - -echo Generating String Table... -%PRG_MMP% -verbose -cfg %CLRLIB%\opt_stringtable.cfg & if ERRORLEVEL 1 exit /b 10 -cd .. From 07b3cf3b713bc9699b4b9a2096f7209fc3e14380 Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Wed, 3 Aug 2016 15:18:28 +0100 Subject: [PATCH 4/6] # This is a combination of 20 commits. # The first commit's message is: Replace BIG_ENDIAN with NETMF_TARGET_BIG_ENDIAN and LITTLE_ENDIAN with NETMF_TARGET_LITTLE_ENDIAN Fixes #481 # This is the 2nd commit message: -Removed WSAEWOULDBLOCK as it's existence causes conditional checks to generate incorrect code for NETMF devices. (basically if WASEWOULDBLOCK exists AND is the same as EWOULDBLOCK on a non-windows targeted build, then EWOULDBLOCK gets treated as a fatal error instead of a bening notification) # This is the 3rd commit message: - updated signing approvers - updated reference to code signing object for latest object as installed on build server # This is the 4th commit message: update build signe to be a bit more soft on errors from service when waiting # This is the 5th commit message: Update README.md # This is the 6th commit message: Added additional hint path for code sign submitter so that external builds can succeed (even though signing isn't performed externally the component is needed to complete building the msbuild task dll) # This is the 7th commit message: Cleanup: Deleted unused tag from .proj files In solution projects it contains the solution name, which is usually changed during the cloning process. # This is the 8th commit message: Cleanup: Deleted empty ProjectPath attributes from *proj files # This is the 9th commit message: Cleanup: Deleted from solution project files # This is the 10th commit message: enc28j60 problem fixed when using with CMSIS RTOS # This is the 11th commit message: Fix Emulator hanging when using TLS/SSL Implement fix suggested in #330 This is a fix that has been proposed by Xin Chen of the AMQP Lite project. See: http://amqpnetlite.codeplex.com/wikipage?title=NETMF%20and%20TLS%2fSSL%20connection&referringTitle=Documentation # This is the 12th commit message: Update README.md # This is the 13th commit message: Improve code layout Improve code layout for readability as requested by @smaillet-ms # This is the 14th commit message: fixed compile error through adding FLASH macro # This is the 15th commit message: Remove warning in graphics.cpp # This is the 16th commit message: Removed application signing # This is the 17th commit message: update gitignore to include readme and licenses from Crypto package # This is the 18th commit message: declare buffer with RSA_BLOCK_SIZE_BYTES # This is the 19th commit message: Add quotes to buildhelper paths to cope with embedded spaces and other special characters in the path # This is the 20th commit message: Set FLAVOR_WIN to match FLAVOR_DAT if it is not defined --- .gitignore | 5 + Application/MicroBooter/MicroBooter.proj | 2 - .../TinyBooter/TinyBooterDecompressorLib.proj | 2 - Application/TinyBooter/TinyBooterLib.proj | 2 - .../Hardware/InterruptHandler/dotNetMF.proj | 2 +- .../InterruptHandler/dotNetMF_stub.proj | 2 +- CLR/Core/Hardware/dotNetMF.proj | 2 +- CLR/Core/Hardware/dotNetMF_stub.proj | 2 +- CLR/Core/HeapPersistence/dotNetMF.proj | 2 +- CLR/Core/HeapPersistence/dotNetMF_stub.proj | 2 +- CLR/Core/I2C/dotNetMF.proj | 2 +- CLR/Core/I2C/dotNetMF_stub.proj | 2 +- CLR/Core/IOPort/dotNetMF.proj | 2 +- CLR/Core/IOPort/dotNetMF_stub.proj | 2 +- CLR/Core/RPC/dotNetMF.proj | 2 +- CLR/Core/RPC/dotNetMF_stub.proj | 2 +- CLR/Core/Serialization/dotNetMF.proj | 2 +- CLR/Core/Serialization/dotNetMF_stub.proj | 2 +- CLR/Core/Stream/dotNetMF.proj | 2 +- CLR/Core/Stream/dotNetMF_stub.proj | 2 +- CLR/Debugger/dotNetMF.proj | 2 +- CLR/Debugger/dotNetMF_extended.proj | 2 +- CLR/Debugger/dotNetMF_full.proj | 2 +- CLR/Debugger/dotNetMF_minimal.proj | 2 +- CLR/Debugger/dotNetMF_stub.proj | 2 +- CLR/Diagnostics/dotNetMF.proj | 2 +- CLR/Diagnostics/dotNetMF_stub.proj | 2 +- CLR/Graphics/Bmp/dotNetMF.proj | 2 +- CLR/Graphics/Bmp/dotNetMF_stub.proj | 2 +- CLR/Graphics/Gif/dotNetMF.proj | 2 +- CLR/Graphics/Gif/dotNetMF_stub.proj | 2 +- CLR/Graphics/Jpeg/dotNetMF.proj | 2 +- CLR/Graphics/Jpeg/dotNetMF_stub.proj | 2 +- CLR/Graphics/dotNetMF.proj | 2 +- CLR/Graphics/dotNetMF_stub.proj | 2 +- .../SPOT/SPOT_Messaging/dotNetMF.proj | 2 +- .../SPOT/SPOT_Messaging/dotNetMF_stub.proj | 2 +- .../SPOT/SPOT_Serialization/dotNetMF.proj | 2 +- .../SPOT_Serialization/dotNetMF_stub.proj | 2 +- CLR/Libraries/SPOT_Graphics/dotNetMF.proj | 2 +- .../SPOT_Graphics/dotNetMF_stub.proj | 2 +- .../SPOT_Hardware/SPOT_OneWire/dotNetMF.proj | 4 +- .../SPOT_OneWire/dotNetMF_stub.proj | 4 +- .../SPOT_Hardware/SPOT_Serial/dotNetMF.proj | 4 +- .../SPOT_Serial/dotNetMF_stub.proj | 4 +- .../SPOT_Hardware/SPOT_Usb/dotNetMF.proj | 2 - .../SPOT_Hardware/SPOT_Usb/dotNetMF_stub.proj | 2 - CLR/Libraries/SPOT_Hardware/dotNetMF.proj | 2 +- .../SPOT_Hardware/dotNetMF_stub.proj | 2 +- CLR/Libraries/SPOT_IO/dotNetMF.proj | 2 +- CLR/Libraries/SPOT_IO/dotNetMF_stub.proj | 2 +- CLR/Libraries/SPOT_Net/dotNetMF.proj | 2 +- CLR/Libraries/SPOT_Net/dotNetMF_stub.proj | 2 +- CLR/Libraries/SPOT_Net_Security/dotNetMF.proj | 2 +- .../SPOT_Net_Security/dotNetMF_stub.proj | 2 +- CLR/Libraries/SPOT_TimeService/dotNetMF.proj | 2 +- .../SPOT_TimeService/dotNetMF_stub.proj | 2 +- CLR/Libraries/SPOT_Touch/dotNetMF.proj | 2 +- CLR/Libraries/SPOT_Touch/dotNetMF_stub.proj | 2 +- CLR/Messaging/dotNetMF.proj | 2 +- CLR/Messaging/dotNetMF_stub.proj | 2 +- .../MetaDataProcessor/MetaDataProcessor.cpp | 2 +- CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj | 2 +- .../Processors/CortexMx/TinyHal/dotNetMF.proj | 2 +- .../CortexMx/TinyHal/dotNetMF_loader.proj | 2 +- .../Drivers/Backlight/GPIO/dotNetMF.proj | 2 +- .../Drivers/Backlight/SPI/dotNetMF.proj | 2 +- .../Drivers/Backlight/stubs/dotNetMF.proj | 2 +- .../Charger_DualStatus/dotNetMF.proj | 2 +- .../BatteryCharger/stubs/dotNetMF.proj | 2 +- .../BatteryMeasurement/AD7466/dotNetMF.proj | 2 +- .../BatteryMeasurement/stubs/dotNetMF.proj | 2 +- .../BatteryModel/IML200425_2/dotNetMF.proj | 2 +- .../Drivers/BatteryModel/ML1A_2/dotNetMF.proj | 2 +- .../Drivers/BatteryModel/ML2_2/dotNetMF.proj | 2 +- .../Drivers/BatteryModel/ML3_2/dotNetMF.proj | 2 +- .../BatteryModel/MR11_2367/dotNetMF.proj | 2 +- .../Drivers/BatteryModel/PD2430/dotNetMF.proj | 2 +- .../Drivers/BatteryModel/PD3032/dotNetMF.proj | 2 +- .../Drivers/BatteryModel/stubs/dotNetMF.proj | 2 +- .../Flash/AM29DL_16/dotNetMF.proj | 2 +- .../Flash/AM29DL_32/dotNetMF.proj | 2 +- .../BlockStorage/Flash/I28F_16/dotNetMF.proj | 2 +- .../Flash/SST39WF_16/dotNetMF.proj | 2 +- .../BlockStorage/SD/Stubs/dotNetMF.proj | 2 +- .../BlockStorage/WearLeveling/dotNetMF.proj | 2 +- .../Drivers/Display/A025DL02/dotNetMF.proj | 2 +- .../Display/A025DL02/stubs/dotNetMF.proj | 2 +- .../Drivers/Display/HD66773R/dotNetMF.proj | 2 +- .../Drivers/Display/LQ035Q7DB02/dotNetMF.proj | 2 +- .../Drivers/Display/SSD1289/dotNetMF.proj | 2 +- .../Drivers/Display/TD022SHEB2/dotNetMF.proj | 2 +- .../Drivers/Display/TD035STEB1/dotNetMF.proj | 2 +- .../Display/TX09D71VM1CCA/dotNetMF.proj | 2 +- .../Display/TX09D71VM1CCA/stubs/dotNetMF.proj | 2 - .../Display/TextFonts/Font8x15/dotNetMF.proj | 2 +- .../Display/TextFonts/Font8x8/dotNetMF.proj | 2 +- .../Drivers/Display/stubs/dotNetMF.proj | 2 +- .../Drivers/Ethernet/enc28j60/dotNetMF.proj | 2 +- .../Ethernet/enc28j60_lwip/dotNetMF.proj | 57 ++-- .../Ethernet/enc28j60_lwip/enc28j60_lwip.cpp | 32 ++- .../Drivers/Ethernet/loopback/dotNetMF.proj | 2 +- .../Ethernet/loopback_lwip/dotNetMF.proj | 32 +-- DeviceCode/Drivers/FS/FAT/dotNetMF.proj | 2 +- DeviceCode/Drivers/FS/stubs/dotNetMF.proj | 2 +- .../Drivers/LargeBuffer/Stubs/dotNetMF.proj | 2 +- .../Drivers/LargeBuffer/Test/dotNetMF.proj | 2 +- .../Backlight/SPI/SPI_Backlight_config.proj | 2 +- .../Display/A025DL02/A025DL02_config.proj | 2 +- .../LQ035Q7DB02/LQ035Q7DB02_config.proj | 2 +- .../Display/TD022SHEB2/TD022SHEB2_config.proj | 2 +- .../Display/TD035STEB1/TD035STEB1_config.proj | 2 +- .../Stubs/Backlight/GPIO/dotNetMF.proj | 2 +- .../Drivers/Stubs/Backlight/SPI/dotNetMF.proj | 2 +- .../BlockStorage/AddDevices/dotNetMF.proj | 2 +- .../Stubs/BlockStorage/Config/dotNetMF.proj | 2 +- .../Stubs/Display/LCDController/dotNetMF.proj | 2 +- .../Drivers/Stubs/GlobalLock/dotNetMF.proj | 2 +- .../Stubs/Network/Config/dotNetMF.proj | 2 +- .../Ethernet/ENC28J60_Config/dotNetMF.proj | 2 +- .../ENC28J60_LWIP_Config/dotNetMF.proj | 2 +- .../Stubs/Network/Ethernet/dotNetMF.proj | 2 +- .../Stubs/Network/Loopback/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_DA/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_DMA/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_EBIU/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_I2C/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_INTC/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_LCD/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_MMU/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_PCU/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_PWM/dotNetMF.proj | 2 +- .../Processor/stubs_PerfCounter/dotNetMF.proj | 2 +- .../stubs_PreStackInit/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_SPI/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_USART/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_USB/dotNetMF.proj | 2 +- .../Processor/stubs_WATCHDOG/dotNetMF.proj | 2 +- .../Processor/stubs_analog/dotNetMF.proj | 2 +- .../Processor/stubs_bootstrap/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_cache/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_cmu/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_gpio/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_power/dotNetMF.proj | 2 +- .../Stubs/Processor/stubs_time/dotNetMF.proj | 2 +- .../Drivers/Stubs/TempForGCC/dotNetMF.proj | 2 +- .../Stubs/TouchPanel/Config/dotNetMF.proj | 2 +- .../Drivers/Stubs/USB_Config/dotNetMF.proj | 2 +- .../Drivers/Stubs/VirtualKey/dotNetMF.proj | 2 +- DeviceCode/Drivers/Thermistor/dotNetMF.proj | 2 +- .../Drivers/Thermistor/stubs/dotNetMF.proj | 2 +- .../Drivers/TouchPanel/ADS7843/dotNetMF.proj | 2 +- .../Drivers/TouchPanel/TSC2046/dotNetMF.proj | 2 +- .../Drivers/TouchPanel/stubs/dotNetMF.proj | 2 +- .../Drivers/sockets/stubs/dotNetMF.proj | 2 +- DeviceCode/Initialization/dotNetMF.proj | 2 +- .../Initialization/dotNetMF_loader.proj | 2 +- .../DeviceCode/STM32_Analog/dotNetMF.proj | 2 +- .../DeviceCode/STM32_Bootstrap/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_DA/dotNetMF.proj | 2 +- .../DeviceCode/STM32_Flash/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_GPIO/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_I2C/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_IntC/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_PWM/dotNetMF.proj | 2 +- .../DeviceCode/STM32_Power/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_SPI/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_Time/dotNetMF.proj | 2 +- .../DeviceCode/STM32_USART/dotNetMF.proj | 2 +- .../STM32/DeviceCode/STM32_USB/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_Analog/dotNetMF.proj | 2 +- .../STM32F4_Bootstrap/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_DA/dotNetMF.proj | 2 +- .../STM32F4_ETH_lwip_OS/dotNetMF.proj | 2 +- .../STM32F4_Flash/STM32F4x9_Flash_driver.cpp | 8 +- .../DeviceCode/STM32F4_Flash/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_Flash/dotNetMF_x9.proj | 2 +- .../DeviceCode/STM32F4_GPIO/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_I2C/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_IntC/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_PWM/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_Power/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_RTC/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_Random/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_SPI/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_Time/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_USART/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_USB/dotNetMF.proj | 2 +- .../DeviceCode/STM32F4_security/dotNetMF.proj | 2 +- .../lwip_1_4_1_os/arch/dotNetMF.proj | 2 +- DeviceCode/pal/AsyncProcCall/dotNetMF.proj | 2 +- .../pal/AsyncProcCall/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/BlockStorage/dotNetMF.proj | 2 +- .../pal/BlockStorage/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/Buttons/dotNetMF.proj | 2 +- DeviceCode/pal/Buttons/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/COM/dotNetMF.proj | 2 +- DeviceCode/pal/COM/i2c/dotNetMF.proj | 2 +- DeviceCode/pal/COM/i2c/stubs/dotNetMF.proj | 2 +- .../pal/COM/sockets/Ssl/stubs/dotNetMF.proj | 2 +- .../pal/COM/sockets/openssl/dotNetMF.proj | 64 ++--- .../COM/sockets/openssl/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/COM/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/COM/usart/dotNetMF.proj | 2 +- DeviceCode/pal/COM/usart/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/COM/usb/dotNetMF.proj | 2 +- DeviceCode/pal/COM/usb/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/Diagnostics/dotNetMF.proj | 2 +- .../pal/Diagnostics/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/Double/dotNetMF.proj | 2 +- DeviceCode/pal/Gesture/dotNetMF.proj | 2 +- DeviceCode/pal/Gesture/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/Ink/dotNetMF.proj | 2 +- DeviceCode/pal/Ink/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/OneWire/Stubs/dotNetMF.proj | 2 +- DeviceCode/pal/OneWire/dotNetMF.proj | 2 +- .../OpenSSL_1_0_0/tinyclr/dotNetMF.proj | 2 +- .../OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h | 4 - DeviceCode/pal/SimpleHeap/dotNetMF.proj | 2 +- DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj | 2 +- .../pal/SimpleHeap_config/Stubs/dotNetMF.proj | 2 +- .../pal/SimpleHeap_config/dotNetMF.proj | 2 +- DeviceCode/pal/StateDebounce/dotNetMF.proj | 2 +- .../pal/StateDebounce/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/TouchPanel/dotNetMF.proj | 2 +- DeviceCode/pal/TouchPanel/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/configuration/dotNetMF.proj | 2 +- .../pal/configuration/dotNetMF_loader.proj | 2 +- .../pal/configuration/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/events/dotNetMF.proj | 2 +- DeviceCode/pal/events/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/fs/dotNetMF.proj | 2 +- DeviceCode/pal/fs/stubs/Config/dotNetMF.proj | 2 +- DeviceCode/pal/fs/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/graphics/dotNetMF.proj | 2 +- DeviceCode/pal/graphics/graphics.cpp | 4 +- DeviceCode/pal/graphics/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/heap/dotNetMF.proj | 2 +- DeviceCode/pal/heap/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/io/dotNetMF.proj | 2 +- DeviceCode/pal/io/stubs/dotNetMF.proj | 2 +- .../lwip_1_4_1_os/SocketsDriver/dotNetMF.proj | 2 +- .../SocketsDriver/stubs/dotNetMF.proj | 2 +- .../lwip_1_4_1_os/lwip/src/dotNetMF_dhcp.proj | 2 +- .../lwip/src/dotNetMF_sockets.proj | 2 +- .../lwip_1_4_1_os/lwip/src/dotNetMF_tcp.proj | 2 +- .../lwip_1_4_1_os/lwip/src/dotNetMF_udp.proj | 2 +- DeviceCode/pal/palevent/Stubs/dotnetmf.proj | 2 +- DeviceCode/pal/palevent/dotNetMF.proj | 2 +- DeviceCode/pal/piezo/dotNetMF.proj | 2 +- .../pal/piezo/stubs/Config/dotNetMF.proj | 2 +- DeviceCode/pal/piezo/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/tinycrt/dotNetMF.proj | 2 +- DeviceCode/pal/tinycrt/dotNetMF_loader.proj | 2 +- DeviceCode/pal/tinycrt/stubs/dotNetMF.proj | 2 +- DeviceCode/pal/watchdog/dotNetMF.proj | 2 +- DeviceCode/pal/watchdog/stubs/dotNetMF.proj | 2 +- Framework/Features/DAConverter_HAL.libcatproj | 2 +- .../Features/Debugger_flavor_CLR.libcatproj | 2 +- .../Features/Display_Font_HAL.libcatproj | 2 +- .../Features/Initialization_HAL.libcatproj | 2 +- Framework/Features/SPOT_Touch_CLR.libcatproj | 2 +- Framework/Features/TinyHal_HAL.libcatproj | 2 +- .../Features/WireProtocol_support.libcatproj | 2 +- Framework/Features/crc_support.libcatproj | 2 +- .../BuildSigner/BuildSigner.cs | 22 +- .../BuildSigner/BuildSignerSpotBuild.csproj | 3 +- Framework/Tools/Emulator/Sockets.cs | 35 ++- Framework/Tools/Emulator/Ssl.cs | 93 +++++-- Product/Samples/HttpClient/HttpClient.cs | 243 ++++++++++++++++++ Product/Samples/HttpClient/HttpClient.csproj | 70 +++++ Product/Samples/HttpClient/HttpClient.sln | 24 ++ .../Samples/HttpClient/NetworkStateMonitor.cs | 80 ++++++ .../HttpClient/Properties/AssemblyInfo.cs | 46 ++++ .../Samples/HttpClient/Resources.Designer.cs | 48 ++++ Product/Samples/HttpClient/Resources.resx | 148 +++++++++++ .../Samples/HttpClient/Resources/DigiCert.cer | 23 ++ .../HttpClient/Resources/VerisignCA.cer | 14 + .../Samples/HttpClient/TimeServiceManager.cs | 83 ++++++ Product/Samples/HttpClient/readme.txt | 65 +++++ ProjectTemplates/MicroBooter/MicroBooter.proj | 2 - README.md | 12 +- .../Blockstorage/M29W640FB/dotNetMF.proj | 4 +- .../Blockstorage/STM32F4/dotNetMF.proj | 4 +- .../Blockstorage/addDevices/dotNetMF.proj | 4 +- .../DeviceCode/CMSIS_RTX_Config/dotNetMF.proj | 3 +- .../DeviceCode/Crypto/dotNetMF.proj | 2 - .../DeviceCode/GlobalLock/dotNetMF.proj | 1 - .../DeviceCode/Init/dotNetMF.proj | 3 - .../DeviceCode/Initialization/dotNetMF.proj | 3 +- .../Initialization/dotNetMF_loader.proj | 3 +- .../DeviceCode/M29W640FB_Flash/dotNetMF.proj | 3 +- .../Network_Config_HAL/dotNetMF.proj | 3 +- .../DeviceCode/TinyHal/dotNetMF.proj | 3 +- .../DeviceCode/TinyHal/dotNetMF_loader.proj | 3 +- .../MCBSTM32F400/DeviceCode/USB/dotNetMF.proj | 3 +- .../MCBSTM32F400/MicroBooter/MicroBooter.proj | 3 - .../MCBSTM32F400/TinyBooter/TinyBooter.proj | 1 - Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj | 1 - .../TinyCLR_NONET/TinyCLR_NONET.proj | 1 - .../Blockstorage/STM32F4/dotNetMF.proj | 4 +- .../Blockstorage/addDevices/dotNetMF.proj | 4 +- .../DeviceCode/Init/dotNetMF.proj | 3 - .../DeviceCode/Initialization/dotNetMF.proj | 3 +- .../Initialization/dotNetMF_loader.proj | 3 +- .../DeviceCode/USB/dotNetMF.proj | 3 +- .../TinyBooter/TinyBooter.proj | 1 - .../STM32F4DISCOVERY/TinyCLR/TinyCLR.proj | 1 - .../DeviceCode/USB_Config_PAL/dotNetMF.proj | 3 +- .../Template/DeviceCode/USB_HAL/dotNetMF.proj | 3 +- .../Template/NativeSample/NativeSample.proj | 1 - Solutions/Template/PortBooter/portBooter.proj | 1 - .../Template/PortBooter/portBooterloader.proj | 1 - Solutions/Template/TinyBooter/TinyBooter.proj | 1 - .../TinyBooter/TinyBooterDecompressor.proj | 1 - Solutions/Template/TinyCLR/TinyCLR.proj | 1 - .../DeviceCode/USB_Config_PAL/dotNetMF.proj | 3 +- .../DeviceCode/USB_HAL/dotNetMF.proj | 3 +- .../NativeSample/NativeSample.proj | 1 - .../Template_BE/PortBooter/portBooter.proj | 1 - .../PortBooter/portBooterloader.proj | 1 - Solutions/Template_BE/TinyCLR/TinyCLR.proj | 1 - Solutions/Windows2/TinyCLR/TinyCLR.proj | 1 - Solutions/Windows2/TinyCLR/TinyCLR.proj.port | 1 - .../TinyCLR/TinyCLR.proj_no_floating_point | 1 - Support/WireProtocol/dotNetMF.proj | 4 +- Support/crc/dotNetMF.proj | 4 +- crypto/dotNetMF.proj | 4 +- crypto/stubs/dotNetMF.proj | 4 +- tools/Targets/Microsoft.SPOT.SDK.Targets | 2 +- tools/Targets/Microsoft.SPOT.System.Targets | 10 +- tools/binToSrec/binToSrec.csproj | 3 +- tools/scripts/init.cmd | 10 +- 333 files changed, 1374 insertions(+), 501 deletions(-) create mode 100644 Product/Samples/HttpClient/HttpClient.cs create mode 100644 Product/Samples/HttpClient/HttpClient.csproj create mode 100644 Product/Samples/HttpClient/HttpClient.sln create mode 100644 Product/Samples/HttpClient/NetworkStateMonitor.cs create mode 100644 Product/Samples/HttpClient/Properties/AssemblyInfo.cs create mode 100644 Product/Samples/HttpClient/Resources.Designer.cs create mode 100644 Product/Samples/HttpClient/Resources.resx create mode 100644 Product/Samples/HttpClient/Resources/DigiCert.cer create mode 100644 Product/Samples/HttpClient/Resources/VerisignCA.cer create mode 100644 Product/Samples/HttpClient/TimeServiceManager.cs create mode 100644 Product/Samples/HttpClient/readme.txt diff --git a/.gitignore b/.gitignore index a3b2312da..a15d34c63 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,8 @@ Listings/ *.axfdump /crypto/lib +Firmware License (Crypto).rtf +License (Crypto).rtf +PKCryptoWelcome.rtf +REDIST_CRYPTO.TXT +ReleaseNotesCrypto.txt diff --git a/Application/MicroBooter/MicroBooter.proj b/Application/MicroBooter/MicroBooter.proj index 941822373..be5b23565 100644 --- a/Application/MicroBooter/MicroBooter.proj +++ b/Application/MicroBooter/MicroBooter.proj @@ -13,8 +13,6 @@ MicroBooter - - False False False diff --git a/Application/TinyBooter/TinyBooterDecompressorLib.proj b/Application/TinyBooter/TinyBooterDecompressorLib.proj index e0dabfd76..608b5be89 100644 --- a/Application/TinyBooter/TinyBooterDecompressorLib.proj +++ b/Application/TinyBooter/TinyBooterDecompressorLib.proj @@ -14,8 +14,6 @@ True - - False False False diff --git a/Application/TinyBooter/TinyBooterLib.proj b/Application/TinyBooter/TinyBooterLib.proj index 4fb1b3675..737c887eb 100644 --- a/Application/TinyBooter/TinyBooterLib.proj +++ b/Application/TinyBooter/TinyBooterLib.proj @@ -14,8 +14,6 @@ True - - False False False diff --git a/CLR/Core/Hardware/InterruptHandler/dotNetMF.proj b/CLR/Core/Hardware/InterruptHandler/dotNetMF.proj index 38ff90aa1..5c5ffc35f 100644 --- a/CLR/Core/Hardware/InterruptHandler/dotNetMF.proj +++ b/CLR/Core/Hardware/InterruptHandler/dotNetMF.proj @@ -12,7 +12,7 @@ InterruptHandler.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/Hardware/InterruptHandler/dotNetMF_stub.proj b/CLR/Core/Hardware/InterruptHandler/dotNetMF_stub.proj index 4e7d5e61b..f3a649ecd 100644 --- a/CLR/Core/Hardware/InterruptHandler/dotNetMF_stub.proj +++ b/CLR/Core/Hardware/InterruptHandler/dotNetMF_stub.proj @@ -12,7 +12,7 @@ InterruptHandler_stub.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/Hardware/dotNetMF.proj b/CLR/Core/Hardware/dotNetMF.proj index 503a52e0d..748f27a54 100644 --- a/CLR/Core/Hardware/dotNetMF.proj +++ b/CLR/Core/Hardware/dotNetMF.proj @@ -12,7 +12,7 @@ Hardware.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/Hardware/dotNetMF_stub.proj b/CLR/Core/Hardware/dotNetMF_stub.proj index 900b21f36..0dee0f138 100644 --- a/CLR/Core/Hardware/dotNetMF_stub.proj +++ b/CLR/Core/Hardware/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Hardware_stub.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/HeapPersistence/dotNetMF.proj b/CLR/Core/HeapPersistence/dotNetMF.proj index ff94c0a8e..eb839b592 100644 --- a/CLR/Core/HeapPersistence/dotNetMF.proj +++ b/CLR/Core/HeapPersistence/dotNetMF.proj @@ -12,7 +12,7 @@ HeapPersistence.$(LIB_EXT).manifest Storage - + 4 0 diff --git a/CLR/Core/HeapPersistence/dotNetMF_stub.proj b/CLR/Core/HeapPersistence/dotNetMF_stub.proj index c0d44b909..e5c3b4297 100644 --- a/CLR/Core/HeapPersistence/dotNetMF_stub.proj +++ b/CLR/Core/HeapPersistence/dotNetMF_stub.proj @@ -12,7 +12,7 @@ HeapPersistence_stub.$(LIB_EXT).manifest Storage - + 4 0 diff --git a/CLR/Core/I2C/dotNetMF.proj b/CLR/Core/I2C/dotNetMF.proj index 9cba5dc41..63e7806fd 100644 --- a/CLR/Core/I2C/dotNetMF.proj +++ b/CLR/Core/I2C/dotNetMF.proj @@ -12,7 +12,7 @@ I2C.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/I2C/dotNetMF_stub.proj b/CLR/Core/I2C/dotNetMF_stub.proj index 4d07a838f..3bb07bd04 100644 --- a/CLR/Core/I2C/dotNetMF_stub.proj +++ b/CLR/Core/I2C/dotNetMF_stub.proj @@ -12,7 +12,7 @@ I2C_stub.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/IOPort/dotNetMF.proj b/CLR/Core/IOPort/dotNetMF.proj index 8ddfa87ab..48d34ea0e 100644 --- a/CLR/Core/IOPort/dotNetMF.proj +++ b/CLR/Core/IOPort/dotNetMF.proj @@ -12,7 +12,7 @@ IOPort.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/IOPort/dotNetMF_stub.proj b/CLR/Core/IOPort/dotNetMF_stub.proj index 03a83f9c3..811f5cfc6 100644 --- a/CLR/Core/IOPort/dotNetMF_stub.proj +++ b/CLR/Core/IOPort/dotNetMF_stub.proj @@ -12,7 +12,7 @@ IOPort_stub.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Core/RPC/dotNetMF.proj b/CLR/Core/RPC/dotNetMF.proj index ab9fb3faf..8e6cb3784 100644 --- a/CLR/Core/RPC/dotNetMF.proj +++ b/CLR/Core/RPC/dotNetMF.proj @@ -12,7 +12,7 @@ RPC.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/CLR/Core/RPC/dotNetMF_stub.proj b/CLR/Core/RPC/dotNetMF_stub.proj index 4de2b22c1..0c12ef950 100644 --- a/CLR/Core/RPC/dotNetMF_stub.proj +++ b/CLR/Core/RPC/dotNetMF_stub.proj @@ -12,7 +12,7 @@ RPC_stub.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/CLR/Core/Serialization/dotNetMF.proj b/CLR/Core/Serialization/dotNetMF.proj index 90e472736..2f3a1c63d 100644 --- a/CLR/Core/Serialization/dotNetMF.proj +++ b/CLR/Core/Serialization/dotNetMF.proj @@ -12,7 +12,7 @@ Serialization.$(LIB_EXT).manifest Serialization - + 4 0 diff --git a/CLR/Core/Serialization/dotNetMF_stub.proj b/CLR/Core/Serialization/dotNetMF_stub.proj index 1dc52a8d7..aa5c9b419 100644 --- a/CLR/Core/Serialization/dotNetMF_stub.proj +++ b/CLR/Core/Serialization/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Serialization_stub.$(LIB_EXT).manifest Serialization - + 4 0 diff --git a/CLR/Core/Stream/dotNetMF.proj b/CLR/Core/Stream/dotNetMF.proj index 18976a756..266624232 100644 --- a/CLR/Core/Stream/dotNetMF.proj +++ b/CLR/Core/Stream/dotNetMF.proj @@ -12,7 +12,7 @@ Stream.$(LIB_EXT).manifest IO - + 4 0 diff --git a/CLR/Core/Stream/dotNetMF_stub.proj b/CLR/Core/Stream/dotNetMF_stub.proj index ac5126539..a5bca0df5 100644 --- a/CLR/Core/Stream/dotNetMF_stub.proj +++ b/CLR/Core/Stream/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Stream_stub.$(LIB_EXT).manifest IO - + 4 0 diff --git a/CLR/Debugger/dotNetMF.proj b/CLR/Debugger/dotNetMF.proj index e5204720e..a4974fb13 100644 --- a/CLR/Debugger/dotNetMF.proj +++ b/CLR/Debugger/dotNetMF.proj @@ -12,7 +12,7 @@ Debugger.$(LIB_EXT).manifest Debugger - + 4 0 diff --git a/CLR/Debugger/dotNetMF_extended.proj b/CLR/Debugger/dotNetMF_extended.proj index 5d06a070c..e341854c3 100644 --- a/CLR/Debugger/dotNetMF_extended.proj +++ b/CLR/Debugger/dotNetMF_extended.proj @@ -12,7 +12,7 @@ Debugger_extended.$(LIB_EXT).manifest Debugger - + 4 0 diff --git a/CLR/Debugger/dotNetMF_full.proj b/CLR/Debugger/dotNetMF_full.proj index 7f5da7125..ff6e1ceff 100644 --- a/CLR/Debugger/dotNetMF_full.proj +++ b/CLR/Debugger/dotNetMF_full.proj @@ -12,7 +12,7 @@ Debugger_full.$(LIB_EXT).manifest Debugger - + 4 0 diff --git a/CLR/Debugger/dotNetMF_minimal.proj b/CLR/Debugger/dotNetMF_minimal.proj index ef9716f68..2a3c44d0a 100644 --- a/CLR/Debugger/dotNetMF_minimal.proj +++ b/CLR/Debugger/dotNetMF_minimal.proj @@ -12,7 +12,7 @@ Debugger_minimal.$(LIB_EXT).manifest Debugger - + 4 0 diff --git a/CLR/Debugger/dotNetMF_stub.proj b/CLR/Debugger/dotNetMF_stub.proj index e1515be5a..77d16bee2 100644 --- a/CLR/Debugger/dotNetMF_stub.proj +++ b/CLR/Debugger/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Debugger_stub.$(LIB_EXT).manifest Debugger - + 4 0 diff --git a/CLR/Diagnostics/dotNetMF.proj b/CLR/Diagnostics/dotNetMF.proj index f139c1592..d82784cdb 100644 --- a/CLR/Diagnostics/dotNetMF.proj +++ b/CLR/Diagnostics/dotNetMF.proj @@ -12,7 +12,7 @@ Diagnostics.$(LIB_EXT).manifest Diagnostics - + 4 0 diff --git a/CLR/Diagnostics/dotNetMF_stub.proj b/CLR/Diagnostics/dotNetMF_stub.proj index 3e60f0c02..df1a5bc23 100644 --- a/CLR/Diagnostics/dotNetMF_stub.proj +++ b/CLR/Diagnostics/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Diagnostics_stub.$(LIB_EXT).manifest Diagnostics - + 4 0 diff --git a/CLR/Graphics/Bmp/dotNetMF.proj b/CLR/Graphics/Bmp/dotNetMF.proj index a1fc8e4dc..8142cf9ff 100644 --- a/CLR/Graphics/Bmp/dotNetMF.proj +++ b/CLR/Graphics/Bmp/dotNetMF.proj @@ -12,7 +12,7 @@ Graphics_Bmp.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/Bmp/dotNetMF_stub.proj b/CLR/Graphics/Bmp/dotNetMF_stub.proj index 941105e17..3d5c31f67 100644 --- a/CLR/Graphics/Bmp/dotNetMF_stub.proj +++ b/CLR/Graphics/Bmp/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Graphics_Bmp_stub.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/Gif/dotNetMF.proj b/CLR/Graphics/Gif/dotNetMF.proj index 1b5df7e87..c7a64eb37 100644 --- a/CLR/Graphics/Gif/dotNetMF.proj +++ b/CLR/Graphics/Gif/dotNetMF.proj @@ -12,7 +12,7 @@ Graphics_Gif.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/Gif/dotNetMF_stub.proj b/CLR/Graphics/Gif/dotNetMF_stub.proj index 10a40f6df..8d6078ae9 100644 --- a/CLR/Graphics/Gif/dotNetMF_stub.proj +++ b/CLR/Graphics/Gif/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Graphics_Gif_stub.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/Jpeg/dotNetMF.proj b/CLR/Graphics/Jpeg/dotNetMF.proj index 0d9c67c69..70f16e202 100644 --- a/CLR/Graphics/Jpeg/dotNetMF.proj +++ b/CLR/Graphics/Jpeg/dotNetMF.proj @@ -12,7 +12,7 @@ Graphics_Jpeg.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/Jpeg/dotNetMF_stub.proj b/CLR/Graphics/Jpeg/dotNetMF_stub.proj index 599fca197..8274f2d6b 100644 --- a/CLR/Graphics/Jpeg/dotNetMF_stub.proj +++ b/CLR/Graphics/Jpeg/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Graphics_Jpeg_stub.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/dotNetMF.proj b/CLR/Graphics/dotNetMF.proj index b2b9c8898..292094b7a 100644 --- a/CLR/Graphics/dotNetMF.proj +++ b/CLR/Graphics/dotNetMF.proj @@ -12,7 +12,7 @@ Graphics.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Graphics/dotNetMF_stub.proj b/CLR/Graphics/dotNetMF_stub.proj index 5584623ff..e585663af 100644 --- a/CLR/Graphics/dotNetMF_stub.proj +++ b/CLR/Graphics/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Graphics_stub.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF.proj b/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF.proj index 0848a3874..807290c7a 100644 --- a/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF.proj +++ b/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Messaging.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF_stub.proj b/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF_stub.proj index cc669dd1e..3d6e29013 100644 --- a/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT/SPOT_Messaging/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Messaging_stub.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF.proj b/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF.proj index e9cf985fe..f4c7cdc3c 100644 --- a/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF.proj +++ b/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Serialization.$(LIB_EXT).manifest Serialization - + 4 0 diff --git a/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF_stub.proj b/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF_stub.proj index d7948d11a..d49650dae 100644 --- a/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT/SPOT_Serialization/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Serialization_stub.$(LIB_EXT).manifest Serialization - + 4 0 diff --git a/CLR/Libraries/SPOT_Graphics/dotNetMF.proj b/CLR/Libraries/SPOT_Graphics/dotNetMF.proj index c8a6e1fa9..9fcb97ec0 100644 --- a/CLR/Libraries/SPOT_Graphics/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Graphics/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Graphics.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Libraries/SPOT_Graphics/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Graphics/dotNetMF_stub.proj index 7e1488817..91785b86a 100644 --- a/CLR/Libraries/SPOT_Graphics/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Graphics/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Graphics_stub.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF.proj b/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF.proj index 013fa983a..76543e468 100644 --- a/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF.proj @@ -11,7 +11,7 @@ SPOT_Hardware_OneWire.$(LIB_EXT).manifest Hardware - + 4 0 @@ -31,8 +31,6 @@ False False True - - CLR\Libraries\SPOT_Hardware\SPOT_OneWire Library Lib_SPOT_Hardware_OneWire diff --git a/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF_stub.proj index 6e28991b8..50faf165a 100644 --- a/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Hardware/SPOT_OneWire/dotNetMF_stub.proj @@ -11,7 +11,7 @@ SPOT_Hardware_OneWire_stub.$(LIB_EXT).manifest Hardware - + 4 0 @@ -31,8 +31,6 @@ False True True - - CLR\Libraries\SPOT_Hardware\SPOT_OneWire Library Lib_SPOT_Hardware_OneWire diff --git a/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF.proj b/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF.proj index b096ed357..e47befce8 100644 --- a/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Hardware_SerialPort.$(LIB_EXT).manifest Hardware - + 4 0 @@ -32,8 +32,6 @@ False False True - - CLR\Libraries\SPOT_Hardware\SPOT_serial Library Lib_SPOT_Hardware_SerialPort diff --git a/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF_stub.proj index f779c13da..4a817b060 100644 --- a/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Hardware/SPOT_Serial/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Hardware_SerialPort_stub.$(LIB_EXT).manifest Hardware - + 4 0 @@ -32,8 +32,6 @@ False True True - - CLR\Libraries\SPOT_Hardware\SPOT_Serial Library Lib_SPOT_Hardware_SerialPort_stub diff --git a/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF.proj b/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF.proj index 61c58035f..f3cb8b103 100644 --- a/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF.proj @@ -36,8 +36,6 @@ False True True - - CLR\Libraries\SPOT_Hardware\SPOT_Usb Library Lib_SPOT_Hardware diff --git a/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF_stub.proj index 3e819e0af..2749e35c4 100644 --- a/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Hardware/SPOT_Usb/dotNetMF_stub.proj @@ -36,8 +36,6 @@ True True True - - CLR\Libraries\SPOT_Hardware\SPOT_Usb Library Lib_SPOT_Hardware_Usb_stub diff --git a/CLR/Libraries/SPOT_Hardware/dotNetMF.proj b/CLR/Libraries/SPOT_Hardware/dotNetMF.proj index 9bd3d2063..62e466444 100644 --- a/CLR/Libraries/SPOT_Hardware/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Hardware/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Hardware.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Libraries/SPOT_Hardware/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Hardware/dotNetMF_stub.proj index 7d0a16fcd..33324efe9 100644 --- a/CLR/Libraries/SPOT_Hardware/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Hardware/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Hardware_stub.$(LIB_EXT).manifest Hardware - + 4 0 diff --git a/CLR/Libraries/SPOT_IO/dotNetMF.proj b/CLR/Libraries/SPOT_IO/dotNetMF.proj index 6ed4e0a3b..5ed789f40 100644 --- a/CLR/Libraries/SPOT_IO/dotNetMF.proj +++ b/CLR/Libraries/SPOT_IO/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_IO.$(LIB_EXT).manifest IO - + 4 0 diff --git a/CLR/Libraries/SPOT_IO/dotNetMF_stub.proj b/CLR/Libraries/SPOT_IO/dotNetMF_stub.proj index a3a1de6a4..a4387076e 100644 --- a/CLR/Libraries/SPOT_IO/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_IO/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_IO_stub.$(LIB_EXT).manifest IO - + 4 0 diff --git a/CLR/Libraries/SPOT_Net/dotNetMF.proj b/CLR/Libraries/SPOT_Net/dotNetMF.proj index 42e254aa3..9829235c8 100644 --- a/CLR/Libraries/SPOT_Net/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Net/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Net.$(LIB_EXT).manifest Network - + 4 0 diff --git a/CLR/Libraries/SPOT_Net/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Net/dotNetMF_stub.proj index 65ffdf3ea..78d70d3d7 100644 --- a/CLR/Libraries/SPOT_Net/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Net/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Net_stub.$(LIB_EXT).manifest Network - + 4 0 diff --git a/CLR/Libraries/SPOT_Net_Security/dotNetMF.proj b/CLR/Libraries/SPOT_Net_Security/dotNetMF.proj index da490c907..4dc3b7a33 100644 --- a/CLR/Libraries/SPOT_Net_Security/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Net_Security/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Net_Security.$(LIB_EXT).manifest Network - + 4 0 diff --git a/CLR/Libraries/SPOT_Net_Security/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Net_Security/dotNetMF_stub.proj index 1a713fcc0..8045938b6 100644 --- a/CLR/Libraries/SPOT_Net_Security/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Net_Security/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Net_Security_stub.$(LIB_EXT).manifest Network - + 4 0 diff --git a/CLR/Libraries/SPOT_TimeService/dotNetMF.proj b/CLR/Libraries/SPOT_TimeService/dotNetMF.proj index 8b1d2e74e..6f38a9deb 100644 --- a/CLR/Libraries/SPOT_TimeService/dotNetMF.proj +++ b/CLR/Libraries/SPOT_TimeService/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_TimeService.$(LIB_EXT).manifest TimeService - + 4 0 diff --git a/CLR/Libraries/SPOT_TimeService/dotNetMF_stub.proj b/CLR/Libraries/SPOT_TimeService/dotNetMF_stub.proj index 9480af9e5..fdcbce6f1 100644 --- a/CLR/Libraries/SPOT_TimeService/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_TimeService/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_TimeService_stub.$(LIB_EXT).manifest Network - + 4 0 diff --git a/CLR/Libraries/SPOT_Touch/dotNetMF.proj b/CLR/Libraries/SPOT_Touch/dotNetMF.proj index 217b7d55f..7b5c2b2bb 100644 --- a/CLR/Libraries/SPOT_Touch/dotNetMF.proj +++ b/CLR/Libraries/SPOT_Touch/dotNetMF.proj @@ -12,7 +12,7 @@ SPOT_Touch.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/CLR/Libraries/SPOT_Touch/dotNetMF_stub.proj b/CLR/Libraries/SPOT_Touch/dotNetMF_stub.proj index eed52be22..311fbbfd1 100644 --- a/CLR/Libraries/SPOT_Touch/dotNetMF_stub.proj +++ b/CLR/Libraries/SPOT_Touch/dotNetMF_stub.proj @@ -12,7 +12,7 @@ SPOT_Touch_stub.$(LIB_EXT).manifest Network - + 4 0 diff --git a/CLR/Messaging/dotNetMF.proj b/CLR/Messaging/dotNetMF.proj index d7e1225ea..985e85d39 100644 --- a/CLR/Messaging/dotNetMF.proj +++ b/CLR/Messaging/dotNetMF.proj @@ -12,7 +12,7 @@ Messaging.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/CLR/Messaging/dotNetMF_stub.proj b/CLR/Messaging/dotNetMF_stub.proj index ed3951666..235b3b806 100644 --- a/CLR/Messaging/dotNetMF_stub.proj +++ b/CLR/Messaging/dotNetMF_stub.proj @@ -12,7 +12,7 @@ Messaging_stub.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp b/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp index 644a2e7b5..9a91480eb 100644 --- a/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp +++ b/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp @@ -1571,7 +1571,7 @@ struct Settings : CLR_RT_ParseOptions { TINYCLR_HEADER(); - CLR_RT_Buffer buf; + CLR_RT_Buffer buf(RSA_BLOCK_SIZE_BYTES); RSAKey privateKey; CLR_RT_Buffer signature(RSA_BLOCK_SIZE_BYTES); diff --git a/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj b/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj index 7c644eb25..a7fc6cbee 100644 --- a/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj +++ b/CMSIS/CMSIS/RTOS/RTX/dotNetMF.proj @@ -12,7 +12,7 @@ CMSIS_RTX.$(LIB_EXT).manifest OS\CMSIS_RTOS - + LibraryCategory diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF.proj b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF.proj index 2dd28544a..901b75a1e 100644 --- a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF.proj +++ b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF.proj @@ -11,7 +11,7 @@ TinyHal_Cortex.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF_loader.proj b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF_loader.proj index 2d52bc018..fe1dd9ce9 100644 --- a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF_loader.proj +++ b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/dotNetMF_loader.proj @@ -11,7 +11,7 @@ TinyHal_loader_Cortex.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/Drivers/Backlight/GPIO/dotNetMF.proj b/DeviceCode/Drivers/Backlight/GPIO/dotNetMF.proj index 7aaac7093..e75639c58 100644 --- a/DeviceCode/Drivers/Backlight/GPIO/dotNetMF.proj +++ b/DeviceCode/Drivers/Backlight/GPIO/dotNetMF.proj @@ -12,7 +12,7 @@ gpio_backlight.$(LIB_EXT).manifest Backlight - + 4 0 diff --git a/DeviceCode/Drivers/Backlight/SPI/dotNetMF.proj b/DeviceCode/Drivers/Backlight/SPI/dotNetMF.proj index 9e0dee451..0a2c84106 100644 --- a/DeviceCode/Drivers/Backlight/SPI/dotNetMF.proj +++ b/DeviceCode/Drivers/Backlight/SPI/dotNetMF.proj @@ -12,7 +12,7 @@ spi_backlight.$(LIB_EXT).manifest Backlight - + 4 0 diff --git a/DeviceCode/Drivers/Backlight/stubs/dotNetMF.proj b/DeviceCode/Drivers/Backlight/stubs/dotNetMF.proj index 58d875d40..844d0b962 100644 --- a/DeviceCode/Drivers/Backlight/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/Backlight/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ backlight_hal_stubs.$(LIB_EXT).manifest Backlight - + 4 0 diff --git a/DeviceCode/Drivers/BatteryCharger/Charger_DualStatus/dotNetMF.proj b/DeviceCode/Drivers/BatteryCharger/Charger_DualStatus/dotNetMF.proj index 47e8eec49..8407c78b9 100644 --- a/DeviceCode/Drivers/BatteryCharger/Charger_DualStatus/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryCharger/Charger_DualStatus/dotNetMF.proj @@ -12,7 +12,7 @@ Charger_DualStatus.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryCharger/stubs/dotNetMF.proj b/DeviceCode/Drivers/BatteryCharger/stubs/dotNetMF.proj index 084984432..17e73202d 100644 --- a/DeviceCode/Drivers/BatteryCharger/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryCharger/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ batterycharger_hal_stubs.$(LIB_EXT).manifest Battery\stubs - + 4 0 diff --git a/DeviceCode/Drivers/BatteryMeasurement/AD7466/dotNetMF.proj b/DeviceCode/Drivers/BatteryMeasurement/AD7466/dotNetMF.proj index 4c6456ca5..90770703f 100644 --- a/DeviceCode/Drivers/BatteryMeasurement/AD7466/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryMeasurement/AD7466/dotNetMF.proj @@ -12,7 +12,7 @@ AD7466.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryMeasurement/stubs/dotNetMF.proj b/DeviceCode/Drivers/BatteryMeasurement/stubs/dotNetMF.proj index 76cafb2fe..193691844 100644 --- a/DeviceCode/Drivers/BatteryMeasurement/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryMeasurement/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ batterymeasurement_hal_stubs.$(LIB_EXT).manifest Battery\stubs - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/IML200425_2/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/IML200425_2/dotNetMF.proj index de4efb9cf..55427a7eb 100644 --- a/DeviceCode/Drivers/BatteryModel/IML200425_2/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/IML200425_2/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_IML200425_2.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/ML1A_2/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/ML1A_2/dotNetMF.proj index fcacbbf55..b7f6abeca 100644 --- a/DeviceCode/Drivers/BatteryModel/ML1A_2/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/ML1A_2/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_ML1A_2.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/ML2_2/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/ML2_2/dotNetMF.proj index ae00ce7f9..4e82f3e90 100644 --- a/DeviceCode/Drivers/BatteryModel/ML2_2/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/ML2_2/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_ML2_2.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/ML3_2/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/ML3_2/dotNetMF.proj index 5cd4bfc83..31492185f 100644 --- a/DeviceCode/Drivers/BatteryModel/ML3_2/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/ML3_2/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_ML3_2.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/MR11_2367/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/MR11_2367/dotNetMF.proj index 3b3469238..28eedc9f4 100644 --- a/DeviceCode/Drivers/BatteryModel/MR11_2367/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/MR11_2367/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_Mr11_2367.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/PD2430/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/PD2430/dotNetMF.proj index 99dfeca2c..4f5307d3b 100644 --- a/DeviceCode/Drivers/BatteryModel/PD2430/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/PD2430/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_Pd2430.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/PD3032/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/PD3032/dotNetMF.proj index 38fec89ad..79d7ecc86 100644 --- a/DeviceCode/Drivers/BatteryModel/PD3032/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/PD3032/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_Pd3032.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/BatteryModel/stubs/dotNetMF.proj b/DeviceCode/Drivers/BatteryModel/stubs/dotNetMF.proj index 3d85ca6c6..d618da496 100644 --- a/DeviceCode/Drivers/BatteryModel/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/BatteryModel/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ batterymodel_hal_stubs.$(LIB_EXT).manifest Battery\stubs - + 4 0 diff --git a/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/dotNetMF.proj b/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/dotNetMF.proj index f817f1dd1..e9971e920 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/dotNetMF.proj +++ b/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/dotNetMF.proj @@ -20,7 +20,7 @@ False False - + 1 0 diff --git a/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_32/dotNetMF.proj b/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_32/dotNetMF.proj index 60a33e9de..b6fc190af 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_32/dotNetMF.proj +++ b/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_32/dotNetMF.proj @@ -20,7 +20,7 @@ False False - + 4 0 diff --git a/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/dotNetMF.proj b/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/dotNetMF.proj index 4bc2bdfbd..d64e88bb2 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/dotNetMF.proj +++ b/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/dotNetMF.proj @@ -20,7 +20,7 @@ False False - + 4 0 diff --git a/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/dotNetMF.proj b/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/dotNetMF.proj index d1a880d64..2da097495 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/dotNetMF.proj +++ b/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/dotNetMF.proj @@ -20,7 +20,7 @@ False False - + 4 0 diff --git a/DeviceCode/Drivers/BlockStorage/SD/Stubs/dotNetMF.proj b/DeviceCode/Drivers/BlockStorage/SD/Stubs/dotNetMF.proj index 5d0fe3925..02dc3d14d 100644 --- a/DeviceCode/Drivers/BlockStorage/SD/Stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/BlockStorage/SD/Stubs/dotNetMF.proj @@ -11,7 +11,7 @@ $(SPOCLIENT)\DeviceCode\Drivers\Blockstorage\SD\stubs\dotNetMF.proj BlockStorage - + 4 0 diff --git a/DeviceCode/Drivers/BlockStorage/WearLeveling/dotNetMF.proj b/DeviceCode/Drivers/BlockStorage/WearLeveling/dotNetMF.proj index 5ef733498..232a60be7 100644 --- a/DeviceCode/Drivers/BlockStorage/WearLeveling/dotNetMF.proj +++ b/DeviceCode/Drivers/BlockStorage/WearLeveling/dotNetMF.proj @@ -20,7 +20,7 @@ False False - + 4 0 diff --git a/DeviceCode/Drivers/Display/A025DL02/dotNetMF.proj b/DeviceCode/Drivers/Display/A025DL02/dotNetMF.proj index d2273500f..a4918d858 100644 --- a/DeviceCode/Drivers/Display/A025DL02/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/A025DL02/dotNetMF.proj @@ -12,7 +12,7 @@ A025DL02.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/A025DL02/stubs/dotNetMF.proj b/DeviceCode/Drivers/Display/A025DL02/stubs/dotNetMF.proj index a1c6fd0a7..5a8aea9be 100644 --- a/DeviceCode/Drivers/Display/A025DL02/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/A025DL02/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ A025DL02_Config_stubs.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/HD66773R/dotNetMF.proj b/DeviceCode/Drivers/Display/HD66773R/dotNetMF.proj index 208bd22b7..1df1d4a76 100644 --- a/DeviceCode/Drivers/Display/HD66773R/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/HD66773R/dotNetMF.proj @@ -12,7 +12,7 @@ HD66773R.$(LIB_EXT).manifest Display - + 1 0 diff --git a/DeviceCode/Drivers/Display/LQ035Q7DB02/dotNetMF.proj b/DeviceCode/Drivers/Display/LQ035Q7DB02/dotNetMF.proj index 323137b2d..9f0402c57 100644 --- a/DeviceCode/Drivers/Display/LQ035Q7DB02/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/LQ035Q7DB02/dotNetMF.proj @@ -12,7 +12,7 @@ LQ035Q7DB02.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/SSD1289/dotNetMF.proj b/DeviceCode/Drivers/Display/SSD1289/dotNetMF.proj index 5c121fa8f..70868d861 100644 --- a/DeviceCode/Drivers/Display/SSD1289/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/SSD1289/dotNetMF.proj @@ -11,7 +11,7 @@ SSD1289.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/TD022SHEB2/dotNetMF.proj b/DeviceCode/Drivers/Display/TD022SHEB2/dotNetMF.proj index 4a2a108d7..2038112f8 100644 --- a/DeviceCode/Drivers/Display/TD022SHEB2/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/TD022SHEB2/dotNetMF.proj @@ -12,7 +12,7 @@ TD022SHEB2.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/TD035STEB1/dotNetMF.proj b/DeviceCode/Drivers/Display/TD035STEB1/dotNetMF.proj index db13c326d..844ec022d 100644 --- a/DeviceCode/Drivers/Display/TD035STEB1/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/TD035STEB1/dotNetMF.proj @@ -12,7 +12,7 @@ TD035STEB1.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/TX09D71VM1CCA/dotNetMF.proj b/DeviceCode/Drivers/Display/TX09D71VM1CCA/dotNetMF.proj index e3a72f73b..a0e177ed2 100644 --- a/DeviceCode/Drivers/Display/TX09D71VM1CCA/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/TX09D71VM1CCA/dotNetMF.proj @@ -12,7 +12,7 @@ TX09D71VM1CCA.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/TX09D71VM1CCA/stubs/dotNetMF.proj b/DeviceCode/Drivers/Display/TX09D71VM1CCA/stubs/dotNetMF.proj index 3b02e5f3d..894417085 100644 --- a/DeviceCode/Drivers/Display/TX09D71VM1CCA/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/TX09D71VM1CCA/stubs/dotNetMF.proj @@ -35,8 +35,6 @@ False True True - - DeviceCode\Drivers\Display\TX09D71VM1CCA\stubs Library false diff --git a/DeviceCode/Drivers/Display/TextFonts/Font8x15/dotNetMF.proj b/DeviceCode/Drivers/Display/TextFonts/Font8x15/dotNetMF.proj index 0063aa1b5..18b29c603 100644 --- a/DeviceCode/Drivers/Display/TextFonts/Font8x15/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/TextFonts/Font8x15/dotNetMF.proj @@ -11,7 +11,7 @@ Display_Font8x15.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/TextFonts/Font8x8/dotNetMF.proj b/DeviceCode/Drivers/Display/TextFonts/Font8x8/dotNetMF.proj index 636682348..461c95094 100644 --- a/DeviceCode/Drivers/Display/TextFonts/Font8x8/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/TextFonts/Font8x8/dotNetMF.proj @@ -11,7 +11,7 @@ Display_Font8x8.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Display/stubs/dotNetMF.proj b/DeviceCode/Drivers/Display/stubs/dotNetMF.proj index 5cacf9366..a8d333a03 100644 --- a/DeviceCode/Drivers/Display/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/Display/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ lcd_hal_stubs.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Ethernet/enc28j60/dotNetMF.proj b/DeviceCode/Drivers/Ethernet/enc28j60/dotNetMF.proj index e0a827aa1..32e621b3e 100644 --- a/DeviceCode/Drivers/Ethernet/enc28j60/dotNetMF.proj +++ b/DeviceCode/Drivers/Ethernet/enc28j60/dotNetMF.proj @@ -12,7 +12,7 @@ ETHERNET_enc28j60.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/Drivers/Ethernet/enc28j60_lwip/dotNetMF.proj b/DeviceCode/Drivers/Ethernet/enc28j60_lwip/dotNetMF.proj index e6aca966f..13ffd8dca 100644 --- a/DeviceCode/Drivers/Ethernet/enc28j60_lwip/dotNetMF.proj +++ b/DeviceCode/Drivers/Ethernet/enc28j60_lwip/dotNetMF.proj @@ -12,7 +12,7 @@ ETHERNET_enc28j60.$(LIB_EXT).manifest Network - + 4 0 @@ -44,36 +44,35 @@ - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DeviceCode/Drivers/Ethernet/enc28j60_lwip/enc28j60_lwip.cpp b/DeviceCode/Drivers/Ethernet/enc28j60_lwip/enc28j60_lwip.cpp index c15a25c1a..e94535a91 100644 --- a/DeviceCode/Drivers/Ethernet/enc28j60_lwip/enc28j60_lwip.cpp +++ b/DeviceCode/Drivers/Ethernet/enc28j60_lwip/enc28j60_lwip.cpp @@ -118,7 +118,8 @@ static UINT8 s_receiveRetries = 10; void enc28j60_handle_recv_error( struct netif *pNetIF, SPI_CONFIGURATION *SpiConf ) -{ +{ + UINT8 byteData; if(--s_receiveRetries <= 0) @@ -157,7 +158,8 @@ void enc28j60_handle_recv_error( struct netif *pNetIF, SPI_CONFIGURATION *SpiCo } void enc28j60_handle_xmit_error( struct netif *pNetIF, SPI_CONFIGURATION *SpiConf ) -{ +{ + UINT8 byteData; byteData = (1 << ENC28J60_ECON1_TXRST_BIT); @@ -195,7 +197,7 @@ void enc28j60_lwip_pre_interrupt (GPIO_PIN Pin, BOOL PinState, void* pArg ) UINT8 eirData; SPI_CONFIGURATION *SpiConf = &g_ENC28J60_LWIP_Config.DeviceConfigs[0].SPI_Config; - GLOBAL_LOCK(encIrq); + GLOBAL_LOCK(irq); /* After an interrupt occurs, the host controller should clear the global enable bit for the interrupt pin before @@ -235,7 +237,7 @@ void enc28j60_lwip_interrupt( struct netif *pNetIF ) SPI_CONFIGURATION *SpiConf; - GLOBAL_LOCK(encIrq); + GLOBAL_LOCK(irq); if (!pNetIF ) { @@ -292,7 +294,9 @@ void enc28j60_lwip_interrupt( struct netif *pNetIF ) if (cntPkts) { + irq.Release(); packetsLeft = enc28j60_lwip_recv( pNetIF ); + irq.Acquire(); } } @@ -366,7 +370,7 @@ int enc28j60_lwip_recv( struct netif *pNetIF ) { { /* Disable interrupt for each loop and only each loop */ - GLOBAL_LOCK(encIrq); + GLOBAL_LOCK(irq); /* Set the read buffer pointer to the beginning of the packet */ enc28j60_lwip_select_bank(SpiConf, ENC28J60_CONTROL_REGISTER_BANK0); @@ -401,8 +405,10 @@ int enc28j60_lwip_recv( struct netif *pNetIF ) if (length != 0) { + irq.Release(); pPBuf = pbuf_alloc( PBUF_RAW, length, PBUF_RAM ); - + irq.Acquire(); + if ( pPBuf ) { dataRX = (UINT8 *)pPBuf->payload; @@ -422,7 +428,9 @@ int enc28j60_lwip_recv( struct netif *pNetIF ) /* invoke stack ip input - the stack should free the buffer when it is done, so DON'T call pbuf_free on pPBuf!!!!!*/ + irq.Release(); pNetIF->input( pPBuf, pNetIF ); + irq.Acquire(); } else { @@ -447,7 +455,8 @@ int enc28j60_lwip_recv( struct netif *pNetIF ) } } else - { + { + lastReceiveBuffer = s_ENC28J60_RECEIVE_BUFFER_START; } @@ -502,7 +511,7 @@ err_t enc28j60_lwip_xmit( struct netif *pNetIF, struct pbuf *pPBuf) int retries = 100; - GLOBAL_LOCK(encIrq); + GLOBAL_LOCK(irq); if ( !pNetIF ) { @@ -573,8 +582,9 @@ err_t enc28j60_lwip_xmit( struct netif *pNetIF, struct pbuf *pPBuf) perPacketControlByte = (1 << ENC28J60_XMIT_CONTROL_PPADEN_BIT) | (1 << ENC28J60_XMIT_CONTROL_PCRCEN_BIT) ; - + irq.Release(); pTmp = pbuf_alloc(PBUF_RAW, length + 2, PBUF_RAM); + irq.Acquire(); if(!pTmp) return ERR_MEM; @@ -596,7 +606,9 @@ err_t enc28j60_lwip_xmit( struct netif *pNetIF, struct pbuf *pPBuf) CPU_SPI_nWrite8_nRead8(*SpiConf, pTx, length+2, 0, 0, 0 ); + irq.Release(); pbuf_free(pTmp); + irq.Acquire(); s_ENC28J60_TRANSMIT_BUFFER_START += length; @@ -892,7 +904,7 @@ bool enc28j60_lwip_setup_device( struct netif *pNetIF ) the MIREGADR register. 2. Set the MICMD.MIIRD bit. The read operation begins and the MISTAT.BUSY bit is set. - 3. Wait 10.24 �s. Poll the MISTAT.BUSY bit to be certain + 3. Wait 10.24 ?. Poll the MISTAT.BUSY bit to be certain that the operation is complete. While busy, the host controller should not start any MIISCAN operations or write to the MIWRH register. When the MAC has obtained diff --git a/DeviceCode/Drivers/Ethernet/loopback/dotNetMF.proj b/DeviceCode/Drivers/Ethernet/loopback/dotNetMF.proj index 966e6249e..e7d6e244e 100644 --- a/DeviceCode/Drivers/Ethernet/loopback/dotNetMF.proj +++ b/DeviceCode/Drivers/Ethernet/loopback/dotNetMF.proj @@ -12,7 +12,7 @@ ETHERNET_loopback.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/Drivers/Ethernet/loopback_lwip/dotNetMF.proj b/DeviceCode/Drivers/Ethernet/loopback_lwip/dotNetMF.proj index 1c132b3f7..c2b158550 100644 --- a/DeviceCode/Drivers/Ethernet/loopback_lwip/dotNetMF.proj +++ b/DeviceCode/Drivers/Ethernet/loopback_lwip/dotNetMF.proj @@ -12,7 +12,7 @@ ETHERNET_loopback_lwip.$(LIB_EXT).manifest Network - + 4 0 @@ -45,23 +45,23 @@ - - - + + + - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/DeviceCode/Drivers/FS/FAT/dotNetMF.proj b/DeviceCode/Drivers/FS/FAT/dotNetMF.proj index 389008075..f88b7a036 100644 --- a/DeviceCode/Drivers/FS/FAT/dotNetMF.proj +++ b/DeviceCode/Drivers/FS/FAT/dotNetMF.proj @@ -12,7 +12,7 @@ FS_FAT.$(LIB_EXT).manifest FileSystem - + 4 0 diff --git a/DeviceCode/Drivers/FS/stubs/dotNetMF.proj b/DeviceCode/Drivers/FS/stubs/dotNetMF.proj index 018556317..e34650322 100644 --- a/DeviceCode/Drivers/FS/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/FS/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ FS_stubs.$(LIB_EXT).manifest FileSystem - + 4 0 diff --git a/DeviceCode/Drivers/LargeBuffer/Stubs/dotNetMF.proj b/DeviceCode/Drivers/LargeBuffer/Stubs/dotNetMF.proj index 8cf84b22b..74d2025b2 100644 --- a/DeviceCode/Drivers/LargeBuffer/Stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/LargeBuffer/Stubs/dotNetMF.proj @@ -12,7 +12,7 @@ LargeBuffer_hal_stubs.$(LIB_EXT).manifest System - + 3 0 diff --git a/DeviceCode/Drivers/LargeBuffer/Test/dotNetMF.proj b/DeviceCode/Drivers/LargeBuffer/Test/dotNetMF.proj index 224eccb24..0f1f3de8f 100644 --- a/DeviceCode/Drivers/LargeBuffer/Test/dotNetMF.proj +++ b/DeviceCode/Drivers/LargeBuffer/Test/dotNetMF.proj @@ -12,7 +12,7 @@ LargeBuffer_hal_test.$(LIB_EXT).manifest System - + 3 0 diff --git a/DeviceCode/Drivers/Sample/Backlight/SPI/SPI_Backlight_config.proj b/DeviceCode/Drivers/Sample/Backlight/SPI/SPI_Backlight_config.proj index 73dbc8b7e..26cb1f404 100644 --- a/DeviceCode/Drivers/Sample/Backlight/SPI/SPI_Backlight_config.proj +++ b/DeviceCode/Drivers/Sample/Backlight/SPI/SPI_Backlight_config.proj @@ -12,7 +12,7 @@ SPI_Backlight_Config.$(LIB_EXT).manifest Backlight\Sample - + 4 0 diff --git a/DeviceCode/Drivers/Sample/Display/A025DL02/A025DL02_config.proj b/DeviceCode/Drivers/Sample/Display/A025DL02/A025DL02_config.proj index 4d7658f6c..4ae1da109 100644 --- a/DeviceCode/Drivers/Sample/Display/A025DL02/A025DL02_config.proj +++ b/DeviceCode/Drivers/Sample/Display/A025DL02/A025DL02_config.proj @@ -12,7 +12,7 @@ A025DL02_Config.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Sample/Display/LQ035Q7DB02/LQ035Q7DB02_config.proj b/DeviceCode/Drivers/Sample/Display/LQ035Q7DB02/LQ035Q7DB02_config.proj index 186b4acc9..5e236c247 100644 --- a/DeviceCode/Drivers/Sample/Display/LQ035Q7DB02/LQ035Q7DB02_config.proj +++ b/DeviceCode/Drivers/Sample/Display/LQ035Q7DB02/LQ035Q7DB02_config.proj @@ -12,7 +12,7 @@ LQ035Q7DB02_Config.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Sample/Display/TD022SHEB2/TD022SHEB2_config.proj b/DeviceCode/Drivers/Sample/Display/TD022SHEB2/TD022SHEB2_config.proj index 4348cbf96..0163c4df5 100644 --- a/DeviceCode/Drivers/Sample/Display/TD022SHEB2/TD022SHEB2_config.proj +++ b/DeviceCode/Drivers/Sample/Display/TD022SHEB2/TD022SHEB2_config.proj @@ -12,7 +12,7 @@ TD022SHEB2_Config.$(LIB_EXT).manifest Display\Sample - + 4 0 diff --git a/DeviceCode/Drivers/Sample/Display/TD035STEB1/TD035STEB1_config.proj b/DeviceCode/Drivers/Sample/Display/TD035STEB1/TD035STEB1_config.proj index 7517b898f..86afaf1b0 100644 --- a/DeviceCode/Drivers/Sample/Display/TD035STEB1/TD035STEB1_config.proj +++ b/DeviceCode/Drivers/Sample/Display/TD035STEB1/TD035STEB1_config.proj @@ -12,7 +12,7 @@ TD035STEB1_Config.$(LIB_EXT).manifest Display\Sample - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Backlight/GPIO/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Backlight/GPIO/dotNetMF.proj index ca6e29fda..208460eba 100644 --- a/DeviceCode/Drivers/Stubs/Backlight/GPIO/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Backlight/GPIO/dotNetMF.proj @@ -13,7 +13,7 @@ GPIO_Backlight_Config_stubs.$(LIB_EXT).manifest Backlight - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Backlight/SPI/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Backlight/SPI/dotNetMF.proj index 0a179d970..aa3e6df56 100644 --- a/DeviceCode/Drivers/Stubs/Backlight/SPI/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Backlight/SPI/dotNetMF.proj @@ -13,7 +13,7 @@ SPI_Backlight_Config_stubs.$(LIB_EXT).manifest Backlight - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/BlockStorage/AddDevices/dotNetMF.proj b/DeviceCode/Drivers/Stubs/BlockStorage/AddDevices/dotNetMF.proj index 7354193b4..6478df5a0 100644 --- a/DeviceCode/Drivers/Stubs/BlockStorage/AddDevices/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/BlockStorage/AddDevices/dotNetMF.proj @@ -11,7 +11,7 @@ $(SPOCLIENT)\DeviceCode\drivers\stubs\Blockstorage\addDevices\dotNetMF.proj BlockStorage - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/BlockStorage/Config/dotNetMF.proj b/DeviceCode/Drivers/Stubs/BlockStorage/Config/dotNetMF.proj index 9cc9fc299..78cdaed49 100644 --- a/DeviceCode/Drivers/Stubs/BlockStorage/Config/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/BlockStorage/Config/dotNetMF.proj @@ -11,7 +11,7 @@ $(SPOCLIENT)\DeviceCode\Drivers\stubs\Blockstorage\Config\dotNetMF.proj BlockStorage - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Display/LCDController/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Display/LCDController/dotNetMF.proj index 912356928..fd302c15a 100644 --- a/DeviceCode/Drivers/Stubs/Display/LCDController/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Display/LCDController/dotNetMF.proj @@ -12,7 +12,7 @@ LCDController_Config_stubs.$(LIB_EXT).manifest Display - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/GlobalLock/dotNetMF.proj b/DeviceCode/Drivers/Stubs/GlobalLock/dotNetMF.proj index cbe46f701..b60964db8 100644 --- a/DeviceCode/Drivers/Stubs/GlobalLock/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/GlobalLock/dotNetMF.proj @@ -12,7 +12,7 @@ GlobalLock_hal_stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Network/Config/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Network/Config/dotNetMF.proj index b73f511d6..bef603c34 100644 --- a/DeviceCode/Drivers/Stubs/Network/Config/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Network/Config/dotNetMF.proj @@ -12,7 +12,7 @@ Network_config_stubs.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_Config/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_Config/dotNetMF.proj index 733ffe578..3ce75ff3c 100644 --- a/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_Config/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_Config/dotNetMF.proj @@ -12,7 +12,7 @@ ENC28J60_config_stubs.$(LIB_EXT).manifest Network\ENC28J60 - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_LWIP_Config/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_LWIP_Config/dotNetMF.proj index 48d62bd6d..3c828dc27 100644 --- a/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_LWIP_Config/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Network/Ethernet/ENC28J60_LWIP_Config/dotNetMF.proj @@ -12,7 +12,7 @@ ENC28J60_LWIP_config_stubs.$(LIB_EXT).manifest Network\ENC28J60 - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Network/Ethernet/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Network/Ethernet/dotNetMF.proj index 2f1e5e08d..a6f7fc3aa 100644 --- a/DeviceCode/Drivers/Stubs/Network/Ethernet/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Network/Ethernet/dotNetMF.proj @@ -12,7 +12,7 @@ ethernetdriver_pal_stubs.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Network/Loopback/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Network/Loopback/dotNetMF.proj index bbe2a7478..8d4fab589 100644 --- a/DeviceCode/Drivers/Stubs/Network/Loopback/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Network/Loopback/dotNetMF.proj @@ -12,7 +12,7 @@ ETHERNET_loopback_stubs.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_DA/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_DA/dotNetMF.proj index 1d5a54050..d687c83b5 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_DA/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_DA/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_DA_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_DMA/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_DMA/dotNetMF.proj index 612728464..c9a8258c3 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_DMA/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_DMA/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_dma_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_EBIU/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_EBIU/dotNetMF.proj index 6f39dfb91..eec41f048 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_EBIU/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_EBIU/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_ebiu_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_I2C/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_I2C/dotNetMF.proj index 2f1fe344d..f363f95a2 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_I2C/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_I2C/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_i2c_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_INTC/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_INTC/dotNetMF.proj index cd77f01e9..b3ca8de41 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_INTC/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_INTC/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_intc_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_LCD/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_LCD/dotNetMF.proj index 1bbbffce3..79bb30e4b 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_LCD/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_LCD/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_LCD_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_MMU/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_MMU/dotNetMF.proj index b2dec2ce7..708df611b 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_MMU/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_MMU/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_mmu_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_PCU/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_PCU/dotNetMF.proj index 329aa09f3..91fe6b93f 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_PCU/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_PCU/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_pcu_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_PWM/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_PWM/dotNetMF.proj index a14584507..abf0f4c2e 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_PWM/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_PWM/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_pwm_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_PerfCounter/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_PerfCounter/dotNetMF.proj index 443be28a6..c421f97cc 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_PerfCounter/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_PerfCounter/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_performancecounter_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_PreStackInit/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_PreStackInit/dotNetMF.proj index ac02a7ed8..0b20cc2e9 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_PreStackInit/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_PreStackInit/dotNetMF.proj @@ -11,7 +11,7 @@ cpu_prestackinit_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_SPI/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_SPI/dotNetMF.proj index 5209e1001..a558cd649 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_SPI/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_SPI/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_spi_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_USART/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_USART/dotNetMF.proj index 55e21ebaa..59ff44379 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_USART/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_USART/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_usart_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_USB/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_USB/dotNetMF.proj index 57896f8c0..3ffd5be4e 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_USB/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_USB/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_usb_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_WATCHDOG/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_WATCHDOG/dotNetMF.proj index eb93041f0..c7be9c4be 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_WATCHDOG/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_WATCHDOG/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_watchdog_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_analog/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_analog/dotNetMF.proj index 99068deb1..f87dabf03 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_analog/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_analog/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_analog_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_bootstrap/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_bootstrap/dotNetMF.proj index d0d4e1709..1e457de89 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_bootstrap/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_bootstrap/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_bootstrap_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_cache/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_cache/dotNetMF.proj index 6ede54f5b..893e01c28 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_cache/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_cache/dotNetMF.proj @@ -11,7 +11,7 @@ cpu_cache_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_cmu/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_cmu/dotNetMF.proj index f440295fc..67b6e237d 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_cmu/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_cmu/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_cmu_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_gpio/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_gpio/dotNetMF.proj index 00d8d2235..22aec2cc3 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_gpio/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_gpio/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_gpio_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_power/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_power/dotNetMF.proj index 257737f65..8a5249d56 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_power/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_power/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_power_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/Processor/stubs_time/dotNetMF.proj b/DeviceCode/Drivers/Stubs/Processor/stubs_time/dotNetMF.proj index ca43670b3..6b8080d5a 100644 --- a/DeviceCode/Drivers/Stubs/Processor/stubs_time/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/Processor/stubs_time/dotNetMF.proj @@ -12,7 +12,7 @@ cpu_time_stubs.$(LIB_EXT).manifest Processor\stubs - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/TempForGCC/dotNetMF.proj b/DeviceCode/Drivers/Stubs/TempForGCC/dotNetMF.proj index 593ffc949..0677c46e4 100644 --- a/DeviceCode/Drivers/Stubs/TempForGCC/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/TempForGCC/dotNetMF.proj @@ -11,7 +11,7 @@ gcc_hal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/TouchPanel/Config/dotNetMF.proj b/DeviceCode/Drivers/Stubs/TouchPanel/Config/dotNetMF.proj index 74ef5dfe3..9d49c9ed5 100644 --- a/DeviceCode/Drivers/Stubs/TouchPanel/Config/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/TouchPanel/Config/dotNetMF.proj @@ -12,7 +12,7 @@ TouchPanel_Config_stubs.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/USB_Config/dotNetMF.proj b/DeviceCode/Drivers/Stubs/USB_Config/dotNetMF.proj index c8c633ca1..53636ffa1 100644 --- a/DeviceCode/Drivers/Stubs/USB_Config/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/USB_Config/dotNetMF.proj @@ -12,7 +12,7 @@ usb_pal_config_stub.$(LIB_EXT).manifest USB - + 4 0 diff --git a/DeviceCode/Drivers/Stubs/VirtualKey/dotNetMF.proj b/DeviceCode/Drivers/Stubs/VirtualKey/dotNetMF.proj index 6f994ac7a..dd5ed54ac 100644 --- a/DeviceCode/Drivers/Stubs/VirtualKey/dotNetMF.proj +++ b/DeviceCode/Drivers/Stubs/VirtualKey/dotNetMF.proj @@ -12,7 +12,7 @@ virtualkey_hal_stubs.$(LIB_EXT).manifest VirtualKey - + 4 0 diff --git a/DeviceCode/Drivers/Thermistor/dotNetMF.proj b/DeviceCode/Drivers/Thermistor/dotNetMF.proj index 53ef8adfc..8cdc29cc4 100644 --- a/DeviceCode/Drivers/Thermistor/dotNetMF.proj +++ b/DeviceCode/Drivers/Thermistor/dotNetMF.proj @@ -12,7 +12,7 @@ Thermistor.$(LIB_EXT).manifest Battery - + 4 0 diff --git a/DeviceCode/Drivers/Thermistor/stubs/dotNetMF.proj b/DeviceCode/Drivers/Thermistor/stubs/dotNetMF.proj index 7ddf31790..1ae041c9d 100644 --- a/DeviceCode/Drivers/Thermistor/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/Thermistor/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ thermistor_hal_stubs.$(LIB_EXT).manifest Battery\stubs - + 4 0 diff --git a/DeviceCode/Drivers/TouchPanel/ADS7843/dotNetMF.proj b/DeviceCode/Drivers/TouchPanel/ADS7843/dotNetMF.proj index 33b5bf01d..8701f062b 100644 --- a/DeviceCode/Drivers/TouchPanel/ADS7843/dotNetMF.proj +++ b/DeviceCode/Drivers/TouchPanel/ADS7843/dotNetMF.proj @@ -12,7 +12,7 @@ ADS7843.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/Drivers/TouchPanel/TSC2046/dotNetMF.proj b/DeviceCode/Drivers/TouchPanel/TSC2046/dotNetMF.proj index 121c066b1..0077ac8db 100644 --- a/DeviceCode/Drivers/TouchPanel/TSC2046/dotNetMF.proj +++ b/DeviceCode/Drivers/TouchPanel/TSC2046/dotNetMF.proj @@ -12,7 +12,7 @@ TSC2046.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/Drivers/TouchPanel/stubs/dotNetMF.proj b/DeviceCode/Drivers/TouchPanel/stubs/dotNetMF.proj index 3b5fba229..077712995 100644 --- a/DeviceCode/Drivers/TouchPanel/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/TouchPanel/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ touchpanel_hal_stubs.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/Drivers/sockets/stubs/dotNetMF.proj b/DeviceCode/Drivers/sockets/stubs/dotNetMF.proj index 0465b523c..299f1994d 100644 --- a/DeviceCode/Drivers/sockets/stubs/dotNetMF.proj +++ b/DeviceCode/Drivers/sockets/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ sockets_hal_stubs.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/Initialization/dotNetMF.proj b/DeviceCode/Initialization/dotNetMF.proj index b64ba00c2..e83582351 100644 --- a/DeviceCode/Initialization/dotNetMF.proj +++ b/DeviceCode/Initialization/dotNetMF.proj @@ -12,7 +12,7 @@ system_initialization_hal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/Initialization/dotNetMF_loader.proj b/DeviceCode/Initialization/dotNetMF_loader.proj index 22a8b2278..69146ed1a 100644 --- a/DeviceCode/Initialization/dotNetMF_loader.proj +++ b/DeviceCode/Initialization/dotNetMF_loader.proj @@ -11,7 +11,7 @@ system_initialization_hal_loader.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Analog/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Analog/dotNetMF.proj index f49bf52ff..cf1b0dbce 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Analog/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Analog/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Bootstrap/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Bootstrap/dotNetMF.proj index 89e3af3f1..1a5e716f9 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Bootstrap/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Bootstrap/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_DA/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_DA/dotNetMF.proj index 401ff1618..8b3f45769 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_DA/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_DA/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Flash/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Flash/dotNetMF.proj index 21cc1e62d..8f7c826ec 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Flash/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Flash/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_GPIO/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_GPIO/dotNetMF.proj index c367d5bb1..97e122b8f 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_GPIO/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_GPIO/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_I2C/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_I2C/dotNetMF.proj index 103e11754..d764186e7 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_I2C/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_I2C/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_IntC/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_IntC/dotNetMF.proj index 8e48abb3a..f8d745cf3 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_IntC/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_IntC/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_PWM/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_PWM/dotNetMF.proj index 2f3ca7bcd..64f36325c 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_PWM/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_PWM/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Power/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Power/dotNetMF.proj index 67b1cbd11..5c2060a22 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Power/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Power/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_SPI/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_SPI/dotNetMF.proj index d5ad38929..5bbf01dca 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_SPI/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_SPI/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Time/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Time/dotNetMF.proj index 5398a9ea4..314aab984 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Time/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_Time/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USART/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USART/dotNetMF.proj index 287d6550b..22763716f 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USART/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USART/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USB/dotNetMF.proj b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USB/dotNetMF.proj index 7cb174fb5..da98ecb15 100644 --- a/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USB/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32/DeviceCode/STM32_USB/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Analog/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Analog/dotNetMF.proj index 6e83607a9..0dfaf9aa7 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Analog/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Analog/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/dotNetMF.proj index df69e9eeb..dc1a5a94e 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_DA/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_DA/dotNetMF.proj index b89553c3a..6855dd010 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_DA/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_DA/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/dotNetMF.proj index 73ba7bf6e..2e2369653 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_ETH_lwip_OS/dotNetMF.proj @@ -12,7 +12,7 @@ STM32F4_ETH_lwip_os.$(LIB_EXT).manifest Processor\STM32F4 - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/STM32F4x9_Flash_driver.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/STM32F4x9_Flash_driver.cpp index b1df0fcfd..e3d6fd801 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/STM32F4x9_Flash_driver.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/STM32F4x9_Flash_driver.cpp @@ -15,6 +15,10 @@ #include "STM32F4_Flash.h" #include "..\stm32f4xx.h" +#ifndef FLASH +#define FLASH ((FLASH_TypeDef *) FLASH_R_BASE) +#endif + typedef UINT16 CHIP_WORD; #define FLASH_CR_PSIZE_BITS FLASH_CR_PSIZE_0 // 16 bit programming @@ -27,8 +31,8 @@ typedef UINT16 CHIP_WORD; #endif - static const int STM32F4_FLASH_KEY1 = 0x45670123; - static const int STM32F4_FLASH_KEY2 = 0xcdef89ab; + static const UINT32 STM32F4_FLASH_KEY1 = 0x45670123; + static const UINT32 STM32F4_FLASH_KEY2 = 0xcdef89ab; //--// diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF.proj index ca75175d5..56a478a67 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF_x9.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF_x9.proj index 71bb2d248..fab4f27a4 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF_x9.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Flash/dotNetMF_x9.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_GPIO/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_GPIO/dotNetMF.proj index fdcf7468e..aaaa9eeb2 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_GPIO/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_GPIO/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_I2C/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_I2C/dotNetMF.proj index feb0c3ff9..ac2be2d95 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_I2C/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_I2C/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_IntC/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_IntC/dotNetMF.proj index 4ea46b1f8..4c85fb102 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_IntC/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_IntC/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_PWM/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_PWM/dotNetMF.proj index b4f423b2c..efe8ebdc2 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_PWM/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_PWM/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/dotNetMF.proj index d9bd12ebe..3e37a387f 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Power/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_RTC/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_RTC/dotNetMF.proj index 76cbbf4cc..a18663323 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_RTC/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_RTC/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Random/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Random/dotNetMF.proj index 3252d94d4..e13d0d678 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Random/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Random/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_SPI/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_SPI/dotNetMF.proj index 01e3dcf5b..0735f2536 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_SPI/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_SPI/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Time/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Time/dotNetMF.proj index 840bc1d9a..37a178537 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Time/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Time/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/dotNetMF.proj index 4c83e9642..05e38b73e 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USART/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USB/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USB/dotNetMF.proj index 60120301d..18df43c20 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USB/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_USB/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_security/dotNetMF.proj b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_security/dotNetMF.proj index cb0e121b0..ecbea7fb7 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_security/dotNetMF.proj +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_security/dotNetMF.proj @@ -19,7 +19,7 @@ False False - + 4 0 diff --git a/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/dotNetMF.proj b/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/dotNetMF.proj index 64ff5fb7d..7184e19a8 100644 --- a/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/dotNetMF.proj +++ b/DeviceCode/Targets/OS/CMSIS_RTOS/DeviceCode/lwip_1_4_1_os/arch/dotNetMF.proj @@ -11,7 +11,7 @@ Network - + LibraryCategory diff --git a/DeviceCode/pal/AsyncProcCall/dotNetMF.proj b/DeviceCode/pal/AsyncProcCall/dotNetMF.proj index e5979e0b2..420a02b26 100644 --- a/DeviceCode/pal/AsyncProcCall/dotNetMF.proj +++ b/DeviceCode/pal/AsyncProcCall/dotNetMF.proj @@ -12,7 +12,7 @@ asyncproccall_pal.$(LIB_EXT).manifest Threading - + 4 0 diff --git a/DeviceCode/pal/AsyncProcCall/stubs/dotNetMF.proj b/DeviceCode/pal/AsyncProcCall/stubs/dotNetMF.proj index 53d91ac68..f08f999d6 100644 --- a/DeviceCode/pal/AsyncProcCall/stubs/dotNetMF.proj +++ b/DeviceCode/pal/AsyncProcCall/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ asyncproccall_pal_stubs.$(LIB_EXT).manifest Threading - + 4 0 diff --git a/DeviceCode/pal/BlockStorage/dotNetMF.proj b/DeviceCode/pal/BlockStorage/dotNetMF.proj index 6f47d095c..c007469e5 100644 --- a/DeviceCode/pal/BlockStorage/dotNetMF.proj +++ b/DeviceCode/pal/BlockStorage/dotNetMF.proj @@ -12,7 +12,7 @@ blockstorage_pal.$(LIB_EXT).manifest Storage - + 4 0 diff --git a/DeviceCode/pal/BlockStorage/stubs/dotNetMF.proj b/DeviceCode/pal/BlockStorage/stubs/dotNetMF.proj index 249e198a4..39bddf7b6 100644 --- a/DeviceCode/pal/BlockStorage/stubs/dotNetMF.proj +++ b/DeviceCode/pal/BlockStorage/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ blockstorage_pal_stubs.$(LIB_EXT).manifest Storage - + 4 0 diff --git a/DeviceCode/pal/Buttons/dotNetMF.proj b/DeviceCode/pal/Buttons/dotNetMF.proj index 43c9b60ce..d82ed535d 100644 --- a/DeviceCode/pal/Buttons/dotNetMF.proj +++ b/DeviceCode/pal/Buttons/dotNetMF.proj @@ -12,7 +12,7 @@ Buttons_pal.$(LIB_EXT).manifest Buttons - + 4 0 diff --git a/DeviceCode/pal/Buttons/stubs/dotNetMF.proj b/DeviceCode/pal/Buttons/stubs/dotNetMF.proj index aa92fa293..fd9faea09 100644 --- a/DeviceCode/pal/Buttons/stubs/dotNetMF.proj +++ b/DeviceCode/pal/Buttons/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ Buttons_pal_stubs.$(LIB_EXT).manifest Buttons - + 4 0 diff --git a/DeviceCode/pal/COM/dotNetMF.proj b/DeviceCode/pal/COM/dotNetMF.proj index e7b42dcd9..b70b9ee23 100644 --- a/DeviceCode/pal/COM/dotNetMF.proj +++ b/DeviceCode/pal/COM/dotNetMF.proj @@ -12,7 +12,7 @@ COM_pal.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/DeviceCode/pal/COM/i2c/dotNetMF.proj b/DeviceCode/pal/COM/i2c/dotNetMF.proj index f7703844b..47a458a08 100644 --- a/DeviceCode/pal/COM/i2c/dotNetMF.proj +++ b/DeviceCode/pal/COM/i2c/dotNetMF.proj @@ -12,7 +12,7 @@ i2c_pal.$(LIB_EXT).manifest I2C - + 4 0 diff --git a/DeviceCode/pal/COM/i2c/stubs/dotNetMF.proj b/DeviceCode/pal/COM/i2c/stubs/dotNetMF.proj index 91cbbdd9c..13db9be49 100644 --- a/DeviceCode/pal/COM/i2c/stubs/dotNetMF.proj +++ b/DeviceCode/pal/COM/i2c/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ i2c_pal_stubs.$(LIB_EXT).manifest I2C - + 4 0 diff --git a/DeviceCode/pal/COM/sockets/Ssl/stubs/dotNetMF.proj b/DeviceCode/pal/COM/sockets/Ssl/stubs/dotNetMF.proj index e1989085b..8896fb4d7 100644 --- a/DeviceCode/pal/COM/sockets/Ssl/stubs/dotNetMF.proj +++ b/DeviceCode/pal/COM/sockets/Ssl/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ ssl_pal_stubs.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/pal/COM/sockets/openssl/dotNetMF.proj b/DeviceCode/pal/COM/sockets/openssl/dotNetMF.proj index 223b15c82..16fb456ec 100644 --- a/DeviceCode/pal/COM/sockets/openssl/dotNetMF.proj +++ b/DeviceCode/pal/COM/sockets/openssl/dotNetMF.proj @@ -12,7 +12,7 @@ openssl_pal.$(LIB_EXT).manifest Network - + 4 0 @@ -44,43 +44,43 @@ - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/DeviceCode/pal/COM/sockets/openssl/stubs/dotNetMF.proj b/DeviceCode/pal/COM/sockets/openssl/stubs/dotNetMF.proj index c04bca48b..6cdadd8ca 100644 --- a/DeviceCode/pal/COM/sockets/openssl/stubs/dotNetMF.proj +++ b/DeviceCode/pal/COM/sockets/openssl/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ ssl_pal_stubs.$(LIB_EXT).manifest Network - + 4 0 diff --git a/DeviceCode/pal/COM/stubs/dotNetMF.proj b/DeviceCode/pal/COM/stubs/dotNetMF.proj index 264436884..354bfbd9a 100644 --- a/DeviceCode/pal/COM/stubs/dotNetMF.proj +++ b/DeviceCode/pal/COM/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ COM_pal_stubs.$(LIB_EXT).manifest Communication - + 4 0 diff --git a/DeviceCode/pal/COM/usart/dotNetMF.proj b/DeviceCode/pal/COM/usart/dotNetMF.proj index 6bf5b6fd0..518878bfe 100644 --- a/DeviceCode/pal/COM/usart/dotNetMF.proj +++ b/DeviceCode/pal/COM/usart/dotNetMF.proj @@ -12,7 +12,7 @@ usart_pal.$(LIB_EXT).manifest USART - + 4 0 diff --git a/DeviceCode/pal/COM/usart/stubs/dotNetMF.proj b/DeviceCode/pal/COM/usart/stubs/dotNetMF.proj index 8d57a0b68..9d64f8c1e 100644 --- a/DeviceCode/pal/COM/usart/stubs/dotNetMF.proj +++ b/DeviceCode/pal/COM/usart/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ usart_pal_stubs.$(LIB_EXT).manifest USART - + 4 0 diff --git a/DeviceCode/pal/COM/usb/dotNetMF.proj b/DeviceCode/pal/COM/usb/dotNetMF.proj index 82ce5bdfb..ea6863cf7 100644 --- a/DeviceCode/pal/COM/usb/dotNetMF.proj +++ b/DeviceCode/pal/COM/usb/dotNetMF.proj @@ -12,7 +12,7 @@ usb_pal.$(LIB_EXT).manifest USB - + 4 0 diff --git a/DeviceCode/pal/COM/usb/stubs/dotNetMF.proj b/DeviceCode/pal/COM/usb/stubs/dotNetMF.proj index dde223897..0592aa31a 100644 --- a/DeviceCode/pal/COM/usb/stubs/dotNetMF.proj +++ b/DeviceCode/pal/COM/usb/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ usb_pal_stubs.$(LIB_EXT).manifest USB - + 4 0 diff --git a/DeviceCode/pal/Diagnostics/dotNetMF.proj b/DeviceCode/pal/Diagnostics/dotNetMF.proj index 9430c1f04..36b205628 100644 --- a/DeviceCode/pal/Diagnostics/dotNetMF.proj +++ b/DeviceCode/pal/Diagnostics/dotNetMF.proj @@ -12,7 +12,7 @@ diagnostics_pal.$(LIB_EXT).manifest Diagnostics - + 4 0 diff --git a/DeviceCode/pal/Diagnostics/stubs/dotNetMF.proj b/DeviceCode/pal/Diagnostics/stubs/dotNetMF.proj index 2e6dab8c0..d47cf07e3 100644 --- a/DeviceCode/pal/Diagnostics/stubs/dotNetMF.proj +++ b/DeviceCode/pal/Diagnostics/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ diagnostics_pal_stubs.$(LIB_EXT).manifest Diagnostics - + 4 0 diff --git a/DeviceCode/pal/Double/dotNetMF.proj b/DeviceCode/pal/Double/dotNetMF.proj index 660327567..f7c74bff1 100644 --- a/DeviceCode/pal/Double/dotNetMF.proj +++ b/DeviceCode/pal/Double/dotNetMF.proj @@ -12,7 +12,7 @@ native_double_pal.$(LIB_EXT).manifest Math - + 4 0 diff --git a/DeviceCode/pal/Gesture/dotNetMF.proj b/DeviceCode/pal/Gesture/dotNetMF.proj index 45107eb17..fcd723b40 100644 --- a/DeviceCode/pal/Gesture/dotNetMF.proj +++ b/DeviceCode/pal/Gesture/dotNetMF.proj @@ -12,7 +12,7 @@ Gesture_pal.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/Gesture/stubs/dotNetMF.proj b/DeviceCode/pal/Gesture/stubs/dotNetMF.proj index dbcce9d88..f48020667 100644 --- a/DeviceCode/pal/Gesture/stubs/dotNetMF.proj +++ b/DeviceCode/pal/Gesture/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ Gesture_pal_stubs.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/Ink/dotNetMF.proj b/DeviceCode/pal/Ink/dotNetMF.proj index 74cd7acf2..597e2db52 100644 --- a/DeviceCode/pal/Ink/dotNetMF.proj +++ b/DeviceCode/pal/Ink/dotNetMF.proj @@ -12,7 +12,7 @@ Ink_pal.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/Ink/stubs/dotNetMF.proj b/DeviceCode/pal/Ink/stubs/dotNetMF.proj index a41295e04..80e509107 100644 --- a/DeviceCode/pal/Ink/stubs/dotNetMF.proj +++ b/DeviceCode/pal/Ink/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ Ink_pal_stubs.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/OneWire/Stubs/dotNetMF.proj b/DeviceCode/pal/OneWire/Stubs/dotNetMF.proj index e03b9b99e..f387fe922 100644 --- a/DeviceCode/pal/OneWire/Stubs/dotNetMF.proj +++ b/DeviceCode/pal/OneWire/Stubs/dotNetMF.proj @@ -11,7 +11,7 @@ onewire_pal_stubs.$(LIB_EXT).manifest Library - + 4 0 diff --git a/DeviceCode/pal/OneWire/dotNetMF.proj b/DeviceCode/pal/OneWire/dotNetMF.proj index 7151cd71b..4a78f2c5a 100644 --- a/DeviceCode/pal/OneWire/dotNetMF.proj +++ b/DeviceCode/pal/OneWire/dotNetMF.proj @@ -11,7 +11,7 @@ onewire_pal.$(LIB_EXT).manifest Library - + 4 0 diff --git a/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/dotNetMF.proj b/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/dotNetMF.proj index 5bd417527..31d460f01 100644 --- a/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/dotNetMF.proj +++ b/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/dotNetMF.proj @@ -12,7 +12,7 @@ ssl_pal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h b/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h index 964fa42fe..b598573c4 100644 --- a/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h +++ b/DeviceCode/pal/OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h @@ -109,10 +109,6 @@ typedef int ssize_t; #define EWOULDBLOCK EAGAIN #endif -#ifndef WSAEWOULDBLOCK -#define WSAEWOULDBLOCK EWOULDBLOCK -#endif - #define SIGINT 4 // attention request from user from signal.h #ifdef BUFSIZ diff --git a/DeviceCode/pal/SimpleHeap/dotNetMF.proj b/DeviceCode/pal/SimpleHeap/dotNetMF.proj index 886eb2e32..b3a995865 100644 --- a/DeviceCode/pal/SimpleHeap/dotNetMF.proj +++ b/DeviceCode/pal/SimpleHeap/dotNetMF.proj @@ -12,7 +12,7 @@ SimpleHeap.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj b/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj index 55bbf9e98..03a14eea4 100644 --- a/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj +++ b/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ SimpleHeap_stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj b/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj index 57958b8cc..c64944a3f 100644 --- a/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj +++ b/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj @@ -12,7 +12,7 @@ SimpleHeap_config_stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj b/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj index e092edc22..ab0eeb140 100644 --- a/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj +++ b/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj @@ -12,7 +12,7 @@ SimpleHeap_config.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/StateDebounce/dotNetMF.proj b/DeviceCode/pal/StateDebounce/dotNetMF.proj index 04afc93aa..6ca48a584 100644 --- a/DeviceCode/pal/StateDebounce/dotNetMF.proj +++ b/DeviceCode/pal/StateDebounce/dotNetMF.proj @@ -12,7 +12,7 @@ StateDebounce_pal.$(LIB_EXT).manifest Debounce - + 4 0 diff --git a/DeviceCode/pal/StateDebounce/stubs/dotNetMF.proj b/DeviceCode/pal/StateDebounce/stubs/dotNetMF.proj index 784e8dd96..074e55b4e 100644 --- a/DeviceCode/pal/StateDebounce/stubs/dotNetMF.proj +++ b/DeviceCode/pal/StateDebounce/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ StateDebounce_pal_stubs.$(LIB_EXT).manifest Debounce - + 4 0 diff --git a/DeviceCode/pal/TouchPanel/dotNetMF.proj b/DeviceCode/pal/TouchPanel/dotNetMF.proj index cf5a21e16..8d0ea5544 100644 --- a/DeviceCode/pal/TouchPanel/dotNetMF.proj +++ b/DeviceCode/pal/TouchPanel/dotNetMF.proj @@ -12,7 +12,7 @@ TouchPanel_pal.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/TouchPanel/stubs/dotNetMF.proj b/DeviceCode/pal/TouchPanel/stubs/dotNetMF.proj index ecbe18a6c..9804bcffe 100644 --- a/DeviceCode/pal/TouchPanel/stubs/dotNetMF.proj +++ b/DeviceCode/pal/TouchPanel/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ touchpanel_pal_stubs.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/configuration/dotNetMF.proj b/DeviceCode/pal/configuration/dotNetMF.proj index d40f8808a..ab84d7ffc 100644 --- a/DeviceCode/pal/configuration/dotNetMF.proj +++ b/DeviceCode/pal/configuration/dotNetMF.proj @@ -12,7 +12,7 @@ config_pal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/configuration/dotNetMF_loader.proj b/DeviceCode/pal/configuration/dotNetMF_loader.proj index a5d4b2c7a..b3c0dd80b 100644 --- a/DeviceCode/pal/configuration/dotNetMF_loader.proj +++ b/DeviceCode/pal/configuration/dotNetMF_loader.proj @@ -11,7 +11,7 @@ config_pal_loader.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/configuration/stubs/dotNetMF.proj b/DeviceCode/pal/configuration/stubs/dotNetMF.proj index c4b8e8f13..44a9238bf 100644 --- a/DeviceCode/pal/configuration/stubs/dotNetMF.proj +++ b/DeviceCode/pal/configuration/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ config_pal_Stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/events/dotNetMF.proj b/DeviceCode/pal/events/dotNetMF.proj index efa498fa5..2891e5927 100644 --- a/DeviceCode/pal/events/dotNetMF.proj +++ b/DeviceCode/pal/events/dotNetMF.proj @@ -12,7 +12,7 @@ events_pal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/events/stubs/dotNetMF.proj b/DeviceCode/pal/events/stubs/dotNetMF.proj index 62a3d27ec..55d1d965e 100644 --- a/DeviceCode/pal/events/stubs/dotNetMF.proj +++ b/DeviceCode/pal/events/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ events_pal_stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/fs/dotNetMF.proj b/DeviceCode/pal/fs/dotNetMF.proj index dbd0a6c32..fc134288e 100644 --- a/DeviceCode/pal/fs/dotNetMF.proj +++ b/DeviceCode/pal/fs/dotNetMF.proj @@ -13,7 +13,7 @@ fs_pal.$(LIB_EXT).manifest FileSystem - + 4 0 diff --git a/DeviceCode/pal/fs/stubs/Config/dotNetMF.proj b/DeviceCode/pal/fs/stubs/Config/dotNetMF.proj index ef69d8dc2..2e9da936f 100644 --- a/DeviceCode/pal/fs/stubs/Config/dotNetMF.proj +++ b/DeviceCode/pal/fs/stubs/Config/dotNetMF.proj @@ -12,7 +12,7 @@ FS_Config_stubs.$(LIB_EXT).manifest FileSystem - + 4 0 diff --git a/DeviceCode/pal/fs/stubs/dotNetMF.proj b/DeviceCode/pal/fs/stubs/dotNetMF.proj index cf6e054d4..63ad5d6a4 100644 --- a/DeviceCode/pal/fs/stubs/dotNetMF.proj +++ b/DeviceCode/pal/fs/stubs/dotNetMF.proj @@ -13,7 +13,7 @@ fs_pal_stubs.$(LIB_EXT).manifest FileSystem - + 4 0 diff --git a/DeviceCode/pal/graphics/dotNetMF.proj b/DeviceCode/pal/graphics/dotNetMF.proj index cf9caddf1..9ac914706 100644 --- a/DeviceCode/pal/graphics/dotNetMF.proj +++ b/DeviceCode/pal/graphics/dotNetMF.proj @@ -12,7 +12,7 @@ graphics_pal.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/DeviceCode/pal/graphics/graphics.cpp b/DeviceCode/pal/graphics/graphics.cpp index 734dac21c..42162184a 100644 --- a/DeviceCode/pal/graphics/graphics.cpp +++ b/DeviceCode/pal/graphics/graphics.cpp @@ -921,8 +921,8 @@ void Graphics_Driver::RotateImage( INT16 degree, const PAL_GFX_Bitmap& dst, cons { float dx = (x - xCenterDst); - int xSrc = (int)(xCenterSrc + ((dx * cos) + sinY) + 0.5); - int ySrc = (int)(yCenterSrc + (cosY - (dx * sin)) + 0.5); + int xSrc = (int)(xCenterSrc + ((dx * cos) + sinY) + 0.5f); + int ySrc = (int)(yCenterSrc + (cosY - (dx * sin)) + 0.5f); if(xSrc <= srcRect.right && srcRect.left <= xSrc && ySrc <= srcRect.bottom && srcRect.top <= ySrc && ySrc > 0 && xSrc > 0) { diff --git a/DeviceCode/pal/graphics/stubs/dotNetMF.proj b/DeviceCode/pal/graphics/stubs/dotNetMF.proj index 5c29deed3..ffb7e996a 100644 --- a/DeviceCode/pal/graphics/stubs/dotNetMF.proj +++ b/DeviceCode/pal/graphics/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ graphics_pal_stubs.$(LIB_EXT).manifest Graphics - + 4 0 diff --git a/DeviceCode/pal/heap/dotNetMF.proj b/DeviceCode/pal/heap/dotNetMF.proj index 3370d2c71..eabf86385 100644 --- a/DeviceCode/pal/heap/dotNetMF.proj +++ b/DeviceCode/pal/heap/dotNetMF.proj @@ -12,7 +12,7 @@ heap_pal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/heap/stubs/dotNetMF.proj b/DeviceCode/pal/heap/stubs/dotNetMF.proj index 06962fbd0..ed6b6cbbe 100644 --- a/DeviceCode/pal/heap/stubs/dotNetMF.proj +++ b/DeviceCode/pal/heap/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ heap_pal_stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/io/dotNetMF.proj b/DeviceCode/pal/io/dotNetMF.proj index 1ec7985a2..8df7c90b8 100644 --- a/DeviceCode/pal/io/dotNetMF.proj +++ b/DeviceCode/pal/io/dotNetMF.proj @@ -12,7 +12,7 @@ io_pal.$(LIB_EXT).manifest GPIO - + 4 0 diff --git a/DeviceCode/pal/io/stubs/dotNetMF.proj b/DeviceCode/pal/io/stubs/dotNetMF.proj index c376c090a..90f546e51 100644 --- a/DeviceCode/pal/io/stubs/dotNetMF.proj +++ b/DeviceCode/pal/io/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ io_pal_stubs.$(LIB_EXT).manifest GPIO - + 4 0 diff --git a/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/dotNetMF.proj b/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/dotNetMF.proj index 366cf3017..4d25f91dd 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/dotNetMF.proj +++ b/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/dotNetMF.proj @@ -12,7 +12,7 @@ SocketsDriver_pal_lwip_os.$(LIB_EXT).manifest Network - + LibraryCategory diff --git a/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/stubs/dotNetMF.proj b/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/stubs/dotNetMF.proj index e9a3ec438..266144497 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/stubs/dotNetMF.proj +++ b/DeviceCode/pal/lwip_1_4_1_os/SocketsDriver/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ socketsDriver_pal_lwip_os_stubs.$(LIB_EXT).manifest Network - + LibraryCategory diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_dhcp.proj b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_dhcp.proj index 3d1cc67c9..0c416cfe4 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_dhcp.proj +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_dhcp.proj @@ -12,7 +12,7 @@ sockets_hal_dhcp_LWIP_os.$(LIB_EXT).manifest Network - + LibraryCategory diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_sockets.proj b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_sockets.proj index 9898e2896..06cc13118 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_sockets.proj +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_sockets.proj @@ -12,7 +12,7 @@ sockets_hal_sockets_lwIP_os.$(LIB_EXT).manifest Network - + LibraryCategory diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_tcp.proj b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_tcp.proj index 138ca8bb1..5d35710a2 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_tcp.proj +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_tcp.proj @@ -12,7 +12,7 @@ sockets_hal_tcp_lwIP_os.$(LIB_EXT).manifest Network - + LibraryCategory diff --git a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_udp.proj b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_udp.proj index 0500c7146..0958b66d4 100644 --- a/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_udp.proj +++ b/DeviceCode/pal/lwip_1_4_1_os/lwip/src/dotNetMF_udp.proj @@ -12,7 +12,7 @@ sockets_hal_udp_lwIP_os.$(LIB_EXT).manifest Network - + LibraryCategory diff --git a/DeviceCode/pal/palevent/Stubs/dotnetmf.proj b/DeviceCode/pal/palevent/Stubs/dotnetmf.proj index 7d4872c99..62ff6520e 100644 --- a/DeviceCode/pal/palevent/Stubs/dotnetmf.proj +++ b/DeviceCode/pal/palevent/Stubs/dotnetmf.proj @@ -12,7 +12,7 @@ palevent_pal_stubs.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/palevent/dotNetMF.proj b/DeviceCode/pal/palevent/dotNetMF.proj index accc44f83..a542bb875 100644 --- a/DeviceCode/pal/palevent/dotNetMF.proj +++ b/DeviceCode/pal/palevent/dotNetMF.proj @@ -12,7 +12,7 @@ palevent_pal.$(LIB_EXT).manifest Touch - + 4 0 diff --git a/DeviceCode/pal/piezo/dotNetMF.proj b/DeviceCode/pal/piezo/dotNetMF.proj index 273d72d06..5aa231cbd 100644 --- a/DeviceCode/pal/piezo/dotNetMF.proj +++ b/DeviceCode/pal/piezo/dotNetMF.proj @@ -12,7 +12,7 @@ piezo_pal.$(LIB_EXT).manifest Sound - + 4 0 diff --git a/DeviceCode/pal/piezo/stubs/Config/dotNetMF.proj b/DeviceCode/pal/piezo/stubs/Config/dotNetMF.proj index 7a01139fd..703a4618f 100644 --- a/DeviceCode/pal/piezo/stubs/Config/dotNetMF.proj +++ b/DeviceCode/pal/piezo/stubs/Config/dotNetMF.proj @@ -12,7 +12,7 @@ piezo_config_pal_stubs.$(LIB_EXT).manifest Sound - + 4 0 diff --git a/DeviceCode/pal/piezo/stubs/dotNetMF.proj b/DeviceCode/pal/piezo/stubs/dotNetMF.proj index 35c563f22..5fc5fe568 100644 --- a/DeviceCode/pal/piezo/stubs/dotNetMF.proj +++ b/DeviceCode/pal/piezo/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ piezo_pal_stubs.$(LIB_EXT).manifest Sound - + 4 0 diff --git a/DeviceCode/pal/tinycrt/dotNetMF.proj b/DeviceCode/pal/tinycrt/dotNetMF.proj index 77fcfb901..97d58a9dc 100644 --- a/DeviceCode/pal/tinycrt/dotNetMF.proj +++ b/DeviceCode/pal/tinycrt/dotNetMF.proj @@ -12,7 +12,7 @@ tinycrt_pal.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/tinycrt/dotNetMF_loader.proj b/DeviceCode/pal/tinycrt/dotNetMF_loader.proj index c28ff73c7..2f571b508 100644 --- a/DeviceCode/pal/tinycrt/dotNetMF_loader.proj +++ b/DeviceCode/pal/tinycrt/dotNetMF_loader.proj @@ -11,7 +11,7 @@ tinycrt_pal_loader.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/tinycrt/stubs/dotNetMF.proj b/DeviceCode/pal/tinycrt/stubs/dotNetMF.proj index 145b7eb41..2be9c0aa0 100644 --- a/DeviceCode/pal/tinycrt/stubs/dotNetMF.proj +++ b/DeviceCode/pal/tinycrt/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ tinycrt_pal_stubs.$(LIB_EXT).manifest System - + 4 0 diff --git a/DeviceCode/pal/watchdog/dotNetMF.proj b/DeviceCode/pal/watchdog/dotNetMF.proj index 2ae65bc0d..ea5440392 100644 --- a/DeviceCode/pal/watchdog/dotNetMF.proj +++ b/DeviceCode/pal/watchdog/dotNetMF.proj @@ -12,7 +12,7 @@ Watchdog_pal.$(LIB_EXT).manifest Watchdog - + 4 0 diff --git a/DeviceCode/pal/watchdog/stubs/dotNetMF.proj b/DeviceCode/pal/watchdog/stubs/dotNetMF.proj index 31fcca9ab..26ebf9ac3 100644 --- a/DeviceCode/pal/watchdog/stubs/dotNetMF.proj +++ b/DeviceCode/pal/watchdog/stubs/dotNetMF.proj @@ -12,7 +12,7 @@ Watchdog_pal_stubs.$(LIB_EXT).manifest Watchdog - + 4 0 diff --git a/Framework/Features/DAConverter_HAL.libcatproj b/Framework/Features/DAConverter_HAL.libcatproj index 9bf9692a6..f3471d539 100644 --- a/Framework/Features/DAConverter_HAL.libcatproj +++ b/Framework/Features/DAConverter_HAL.libcatproj @@ -8,7 +8,7 @@ HAL - + 4 0 diff --git a/Framework/Features/Debugger_flavor_CLR.libcatproj b/Framework/Features/Debugger_flavor_CLR.libcatproj index 8b869b22a..35cc576bb 100644 --- a/Framework/Features/Debugger_flavor_CLR.libcatproj +++ b/Framework/Features/Debugger_flavor_CLR.libcatproj @@ -8,7 +8,7 @@ CLR - + 4 0 diff --git a/Framework/Features/Display_Font_HAL.libcatproj b/Framework/Features/Display_Font_HAL.libcatproj index ce557eba0..e5b02d282 100644 --- a/Framework/Features/Display_Font_HAL.libcatproj +++ b/Framework/Features/Display_Font_HAL.libcatproj @@ -14,7 +14,7 @@ $(SPOCLIENT)\DeviceCode\Drivers\Display\TextFonts\Font8x8\dotnetMF.proj - + 4 0 diff --git a/Framework/Features/Initialization_HAL.libcatproj b/Framework/Features/Initialization_HAL.libcatproj index a8de44914..7c0115fa9 100644 --- a/Framework/Features/Initialization_HAL.libcatproj +++ b/Framework/Features/Initialization_HAL.libcatproj @@ -8,7 +8,7 @@ HAL System - + 4 0 diff --git a/Framework/Features/SPOT_Touch_CLR.libcatproj b/Framework/Features/SPOT_Touch_CLR.libcatproj index ad1ff0dea..26b648244 100644 --- a/Framework/Features/SPOT_Touch_CLR.libcatproj +++ b/Framework/Features/SPOT_Touch_CLR.libcatproj @@ -8,7 +8,7 @@ CLR - + 4 0 diff --git a/Framework/Features/TinyHal_HAL.libcatproj b/Framework/Features/TinyHal_HAL.libcatproj index 794a33442..9d70e7fd9 100644 --- a/Framework/Features/TinyHal_HAL.libcatproj +++ b/Framework/Features/TinyHal_HAL.libcatproj @@ -8,7 +8,7 @@ HAL System - + 4 0 diff --git a/Framework/Features/WireProtocol_support.libcatproj b/Framework/Features/WireProtocol_support.libcatproj index 14209a42d..346a0c9f7 100644 --- a/Framework/Features/WireProtocol_support.libcatproj +++ b/Framework/Features/WireProtocol_support.libcatproj @@ -8,7 +8,7 @@ Support - + 4 0 diff --git a/Framework/Features/crc_support.libcatproj b/Framework/Features/crc_support.libcatproj index 549cacc41..c581df282 100644 --- a/Framework/Features/crc_support.libcatproj +++ b/Framework/Features/crc_support.libcatproj @@ -8,7 +8,7 @@ Support - + 4 0 diff --git a/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSigner.cs b/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSigner.cs index 0648075cf..a68ac116a 100644 --- a/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSigner.cs +++ b/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSigner.cs @@ -160,6 +160,11 @@ Release Technical Solutions Centre */ #endregion + //"Codesign" represents the server - static variable do not change + //9556 represents the port - constant value do not change + const string RelayServer = "codesign.gtm.microsoft.com"; + const int RelayPort = 9556; + private static bool SubmitJob(string unsignedDirectory, string signedDirectory) { // use env var so it is dynamic for the machine running this build to help prevent @@ -170,9 +175,7 @@ private static bool SubmitJob(string unsignedDirectory, string signedDirectory) try { //Initialize the Codesign.Submitter object - //"Codesign" represents the server - static variable do not change - //9556 represents the port - constant value do not change - job = CODESIGN.Submitter.Job.Initialize("codesign.gtm.microsoft.com", 9556, true); + job = CODESIGN.Submitter.Job.Initialize(RelayServer, RelayPort, true); // Sets the Partial return flag option. // False - If any files fail signing you will not get any files back. @@ -253,11 +256,14 @@ private static bool SubmitJob(string unsignedDirectory, string signedDirectory) JobWatcher jw = new JobWatcher(); if (!fakeSign) { - // These calls optionally wait till the job is finished - // WARNING: this completely block execution for the specified timespan - int Milliseconds = -1; // -1: wait forever - jw.Watch(job, Milliseconds); - //jw.Watch(job); // you can also call the Watch method this way and wait forever + try + { + jw.Watch(job.JobNumber, RelayServer, RelayPort, true); + } + catch(Exception ex ) + { // I hate general exceptions but the complete lack of documentation on the submitter leaves little choice and we need to ship... + m_CallingTask.Log.LogWarning("Exception waiting for job - assuming job completed, subsequent steps may fail.\nExeption: {0}", ex); + } } // Now we're done, so display any errors or warnings (in case we are in non-event mode) diff --git a/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj b/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj index 8ad28e093..ea49c78ea 100644 --- a/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj +++ b/Framework/Tools/BuildTasksInternal/BuildSigner/BuildSignerSpotBuild.csproj @@ -32,8 +32,9 @@ - + False + $(MSBuildProgramFiles32)\Microsoft Internal\Codesign.Submitter\CODESIGN.Submitter.dll $(SPOROOT)\tools\x86\CODESIGN\CODESIGN.Submitter.dll diff --git a/Framework/Tools/Emulator/Sockets.cs b/Framework/Tools/Emulator/Sockets.cs index b6f3aabc9..0dd44c653 100644 --- a/Framework/Tools/Emulator/Sockets.cs +++ b/Framework/Tools/Emulator/Sockets.cs @@ -288,6 +288,39 @@ internal void ClearSocketEvent(int socket, bool fRead) } } + internal void SignalSocketEvent(int socket, bool fRead) + { + SocketData sd; + if (_isInitialized) + { + if (GetSocketData(socket, out sd)) + { + if (fRead) + { + lock (m_read) + { + if (!m_read.Contains(sd.Socket)) + { + m_read.Add(sd.Socket); + } + } + } + else + { + lock (m_write) + { + if (!m_write.Contains(sd.Socket)) + { + m_write.Add(sd.Socket); + } + } + } + } + + SignalThread(); + } + } + bool _socketsShuttingDown = false; List m_read = new List(); @@ -430,7 +463,7 @@ void WaitForNetworkEvents() this.Emulator.SetSystemEvents(Events.SystemEvents.SOCKET); } } - + [MethodImplAttribute(MethodImplOptions.Synchronized)] void EnsureInitialized() { diff --git a/Framework/Tools/Emulator/Ssl.cs b/Framework/Tools/Emulator/Ssl.cs index e1d2d32ee..36419ecb6 100644 --- a/Framework/Tools/Emulator/Ssl.cs +++ b/Framework/Tools/Emulator/Ssl.cs @@ -60,11 +60,13 @@ internal SslReadData(int socket, byte[] data) internal byte[] ManagedBuffer; internal int Socket; internal int Length; + internal int Offset; } internal SslStream m_stream; internal SslAsyncState m_state = SslAsyncState.Init; internal object m_asyncData = null; + internal SslReadData m_readData; } Dictionary _sslDataCollection = new Dictionary(); @@ -430,7 +432,6 @@ public int Write( int socket, IntPtr Data, int size ) } - [MethodImplAttribute(MethodImplOptions.Synchronized)] public int Read(int socket, IntPtr Data, int size) { int len = 0; @@ -438,30 +439,71 @@ public int Read(int socket, IntPtr Data, int size) if (!GetSslData(socket, out ssd)) return (int)SocketError.SocketError; - try - { - byte[] managedBuffer = new byte[size]; - - len = ssd.m_stream.Read(managedBuffer, 0, size); + if (ssd.m_state == SslStreamData.SslAsyncState.Failed) + return _socketsDriver.ReturnError(SocketError.ConnectionReset); - if (len > 0) - { - Marshal.Copy(managedBuffer, 0, Data, len); - } - else + var readData = ssd.m_readData; + if (readData != null) + { + lock (ssd) { - _socketsDriver.ClearSocketEvent(socket, true); + len = Math.Min(size, readData.Length - readData.Offset); + if (len > 0) + { + Marshal.Copy(readData.ManagedBuffer, readData.Offset, Data, len); + readData.Offset += len; + if (readData.Offset == readData.Length) ssd.m_readData = null; + } + else + { + _socketsDriver.ClearSocketEvent(socket, true); + len = -2; + } } } - catch (Exception e) + else { - Console.Error.WriteLine("Write Failed... " + e.Message); - return (int)SocketError.SocketError; + try + { + byte[] managedBuffer = new byte[size]; + + ssd.m_readData = new SslStreamData.SslReadData(socket, managedBuffer); + ssd.m_stream.BeginRead(managedBuffer, 0, size, this.EndRead, ssd.m_readData); + len = -2; + } + catch (Exception e) + { + Console.Error.WriteLine("Write Failed... " + e.Message); + len = (int)SocketError.SocketError; + } } return len; } + void EndRead(IAsyncResult result) + { + var readData = (SslStreamData.SslReadData)result.AsyncState; + SslStreamData ssd; + if (!GetSslData(readData.Socket, out ssd)) return; + + lock (ssd) + { + try + { + readData.Length = ssd.m_stream.EndRead(result); + } + catch (Exception e) + { + Console.Error.WriteLine("Read Failed... " + e.Message); + ssd.m_readData = null; + ssd.m_state = SslStreamData.SslAsyncState.Failed; + } + + _socketsDriver.SignalSocketEvent(readData.Socket, true); + } + } + public int CloseSocket( int socket ) { lock (_sslStreams) @@ -606,11 +648,26 @@ public int DataAvailable( int socket ) SslStreamData ssd; Socket sock = null; - if (!GetSslData(socket, out ssd)) return (int)SocketError.SocketError; + if (!GetSslData(socket, out ssd)) + { + return (int)SocketError.SocketError; + } - if(!_socketsDriver.GetSocket(socket, out sock)) return (int)SocketError.SocketError; + if (!_socketsDriver.GetSocket(socket, out sock)) + { + return (int)SocketError.SocketError; + } - return sock.Poll(0,SelectMode.SelectRead) ? 1024 : 0; + var readData = ssd.m_readData; + + if(readData != null) + { + return (readData.Length - readData.Offset); + } + else + { + return sock.Poll(0, SelectMode.SelectRead) ? 1024 : 0; + } } } } diff --git a/Product/Samples/HttpClient/HttpClient.cs b/Product/Samples/HttpClient/HttpClient.cs new file mode 100644 index 000000000..851077181 --- /dev/null +++ b/Product/Samples/HttpClient/HttpClient.cs @@ -0,0 +1,243 @@ +/* +The MIT License (MIT) + +Copyright (c) 2015 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +using Microsoft.SPOT; +using System; +using System.IO; +using System.Net; +using System.Net.Sockets; +using System.Security.Cryptography.X509Certificates; +using System.Text; +using System.Threading; + +/// This program demonstrates how to use the .NET Micro Framework HTTP classes +/// to create a simple HTTP client that retrieves pages from several different +/// websites, including secure sites. +namespace HttpClientSample +{ + public static class MyHttpClient + { + // Ideally the preferred time service name should be stored in some form of persistent memory + private const string TimeServiceName = "time.nist.gov"; + + // Ideally the timeszone offset should be stored in some form of persistent memory + private const int TimeZoneOffset = -7 * 60; // [ UTC -8 timezone (+1 for DST ) ] + + private static NetworkStateMonitor NetMonitor = new NetworkStateMonitor( ); + private static Decoder UTF8decoder = Encoding.UTF8.GetDecoder( ); + + /// Retrieves pages from a Web servers, using a simple HTTP requests + public static void Main( ) + { + // Root CA Certificate needed to validate HTTPS servers. + var validButIncorrectCert = new X509Certificate( Resources.GetBytes( Resources.BinaryResources.VerisignCA ) ); + var validAndCorrectCert = new X509Certificate( Resources.GetBytes( Resources.BinaryResources.DigiCert ) ); + + X509Certificate[ ] willFailCerts = { validButIncorrectCert }; + X509Certificate[ ] willSucceedCerts = { validButIncorrectCert, validAndCorrectCert }; + + NetMonitor.WaitForIpAddress(); + TimeServiceManager.InitTimeService( TimeServiceName, TimeZoneOffset ); + Debug.Print(" Time is: " + DateTime.Now.ToString()); + + // Print the HTTP data from each of the following pages. + + // Response Should be a simple re-direct plus "moved" message + Debug.Print( "Fetching data from: http://autos.msn.com/default.aspx" ); + PrintHttpData( "http://autos.msn.com/default.aspx", null ); + + // Test SSL connection with no certificate verification + // NOTE: This is not expected to generate an error or fail condition. + // Since no certificates were provided no verification is performed. + // This may or may not be an issue depending on circumstances. It is + // certainly useful during development before a valid cert is available + // for a server, however it is generally not recommended for production + // systems as it opens the door to "man in the middle" type attacks. + Debug.Print( "Fetching data from: https://github.com/NETMF/netmf-interpreter no cert validation" ); + PrintHttpData( "https://github.com/NETMF/netmf-interpreter", null ); + + // Read from secure webpages by using the provided Root + // certificates that are stored in the Resource.resx file. + Debug.Print( "Fetching data from: https://github.com/NETMF/netmf-interpreter with valid cert validation" ); + PrintHttpData( "https://github.com/NETMF/netmf-interpreter", willSucceedCerts ); + + // This is expected to generate a WebException since the array of certificates + // provided doesn't include any that can be used to validate the site's certificate + try + { + Debug.Print( "Fetching data from: https://github.com/NETMF/netmf-interpreter with invalid cert validation" ); + PrintHttpData( "https://github.com/NETMF/netmf-interpreter", willFailCerts ); + } + catch( WebException ex ) + { + var innerException = ex.InnerException as SocketException; + if( innerException != null && innerException.ErrorCode == 1 ) + { + Debug.Print( "Got expected Exception..." ); + } + } + } + + /// + /// Prints the HTTP Web page from the given URL and status data while + /// receiving the page. + /// + /// The URL of the page to print. + /// The root CA certificates that are required for + /// validating a secure website (HTTPS). + public static void PrintHttpData( string url, X509Certificate[ ] caCerts ) + { + try + { + // Create an HTTP Web request. + HttpWebRequest request = WebRequest.Create( url ) as HttpWebRequest; + Debug.Assert( request != null ); + + // Assign the certificates. If this is null, then no + // validation of server certificates is performed. + request.HttpsAuthentCerts = caCerts; + + // Get a response from the server. + // process the response + using( WebResponse resp = request.GetResponse( ) ) + { + ProcessResponse( resp ); + } + + } + catch( WebException ex ) + { + var innerException = ex.InnerException as SocketException; + if( caCerts != null && innerException != null && innerException.ErrorCode == 1 ) + { + throw; + } + Debug.Print( ex.Message ); + } + } + + private static void ProcessResponse( WebResponse resp ) + { + // Get the network response stream to read the page data. + Stream respStream = resp.GetResponseStream( ); + StringBuilder page = new StringBuilder( ); + byte[ ] byteData = new byte[ 4096 ]; + int bytesRead = 0; + int totalBytes = 0; + + // allow up to 15 seconds as a timeout for reading the stream + respStream.ReadTimeout = 15000; + + // If the content length was provided, read exactly that amount of + // data; otherwise, read until there is nothing left to read. + if( resp.ContentLength != -1 ) + { + for( int dataRem = ( int )resp.ContentLength; dataRem > 0; ) + { + bytesRead = ReadData( respStream, byteData ); + if( bytesRead == 0 ) + { + Debug.Print( "Error: Received " + ( resp.ContentLength - dataRem ) + " Out of " + resp.ContentLength ); + break; + } + dataRem -= bytesRead; + totalBytes += bytesRead; + AppendPageData( page, byteData, bytesRead, totalBytes ); + } + } + else + { + // Read until the end of the data is reached. + while( true ) + { + bytesRead = ReadData( respStream, byteData ); + + // Zero bytes indicates the connection has been closed + // by the server or some other error, either way there's + // no more data to process. + if( bytesRead == 0 ) + { + break; + } + totalBytes += bytesRead; + AppendPageData( page, byteData, bytesRead, totalBytes ); + } + + Debug.Print( "Total bytes downloaded in message body : " + totalBytes ); + } + + // Display the page results. + Debug.Print( page.ToString( ) ); + } + + private static int ReadData( Stream respStream, byte[ ] byteData ) + { + // If the Read method times out, it throws an exception, + // which is expected for Keep-Alive streams because the + // connection isn't terminated. + int bytesRead; + try + { + bytesRead = respStream.Read( byteData, 0, byteData.Length ); + } + catch( IOException ) + { + bytesRead = 0; + } + + return bytesRead; + } + + private static void AppendPageData( StringBuilder page + , byte[ ] byteData + , int bytesRead + , int totalBytes + ) + { + // Convert from bytes to chars, and add to the page. + int byteUsed; + int charUsed = 0; + bool completed = false; + var charData = new char[ 4096 ]; + + while( !completed ) + { + UTF8decoder.Convert( byteData + , 0 + , bytesRead + , charData + , 0 + , bytesRead + , true + , out byteUsed + , out charUsed + , out completed + ); + } + page.Append( new string( charData, 0, charUsed ) ); + + // Display the page download status. + Debug.Print( "Bytes Read Now: " + bytesRead + " Total: " + totalBytes ); + } + } +} diff --git a/Product/Samples/HttpClient/HttpClient.csproj b/Product/Samples/HttpClient/HttpClient.csproj new file mode 100644 index 000000000..47acb96ca --- /dev/null +++ b/Product/Samples/HttpClient/HttpClient.csproj @@ -0,0 +1,70 @@ + + + + HTTPClient + Exe + HttpClientSample + {b69e3092-b931-443c-abe7-7e7b65f2a37f};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 9.0.21022 + 2.0 + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074} + v4.4 + $(MSBuildExtensionsPath32)\Microsoft\.NET Micro Framework\ + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + True + True + Resources.resx + + + + + + + + + + + + + + + + + + Designer + ResXFileCodeGenerator + Resources.Designer.cs + + + + + + + + + + + + \ No newline at end of file diff --git a/Product/Samples/HttpClient/HttpClient.sln b/Product/Samples/HttpClient/HttpClient.sln new file mode 100644 index 000000000..e1fc16971 --- /dev/null +++ b/Product/Samples/HttpClient/HttpClient.sln @@ -0,0 +1,24 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HttpClient", "HttpClient.csproj", "{9387BD77-6E80-40F6-9DB0-11FAEFBD4074}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074}.Release|Any CPU.Build.0 = Release|Any CPU + {9387BD77-6E80-40F6-9DB0-11FAEFBD4074}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Product/Samples/HttpClient/NetworkStateMonitor.cs b/Product/Samples/HttpClient/NetworkStateMonitor.cs new file mode 100644 index 000000000..43e240ad6 --- /dev/null +++ b/Product/Samples/HttpClient/NetworkStateMonitor.cs @@ -0,0 +1,80 @@ +/* +The MIT License (MIT) + +Copyright (c) 2015 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +using System.Threading; +using Microsoft.SPOT; +using Microsoft.SPOT.Net.NetworkInformation; + +namespace HttpClientSample +{ + /// + /// This class provides common support for monitoring and responding + /// to network state changes on a device + /// + public class NetworkStateMonitor + { + public NetworkStateMonitor( ) + { + // attach to network address change notifications + NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged; + } + + /// Retrieves the current status of all NetworkInterfaces in the system + /// + /// The return value from NetworkInterface.GetAllNetworkInterfaces( ) + /// is a snapshot of the current network interface configurations. In + /// other words the elements are not dynamically updated with current + /// information. Thus the call to GetAllNetworkInterfaces is done each + /// time this property is read and the results should *not* be cached. + /// + public NetworkInterface[ ] NetworkInterfaces + { + get { return NetworkInterface.GetAllNetworkInterfaces( ); } + } + + /// Sleep wait for a network interface with a valid (e.g. not 0.0.0.0) IP address + public void WaitForIpAddress( ) + { + do + { + StatusChanged.Reset( ); + foreach( var itf in NetworkInterfaces ) + { + if( itf.IPAddress == "0.0.0.0" || itf.IPAddress == "127.0.0.1" ) + continue; + + Debug.Print( "Found IP: " + itf.IPAddress ); + return; + } + } while( StatusChanged.WaitOne( ) ); + } + + private void NetworkChange_NetworkAddressChanged( object sender, EventArgs e ) + { + Debug.Print( "A network address changed" ); + StatusChanged.Set( ); + } + + private readonly ManualResetEvent StatusChanged = new ManualResetEvent( false ); + } +} diff --git a/Product/Samples/HttpClient/Properties/AssemblyInfo.cs b/Product/Samples/HttpClient/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..a2f949ab6 --- /dev/null +++ b/Product/Samples/HttpClient/Properties/AssemblyInfo.cs @@ -0,0 +1,46 @@ +/* +The MIT License (MIT) + +Copyright (c) 2015 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +using System.Reflection; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle( "HttpClient" )] +[assembly: AssemblyDescription( "HTTP Client sample for .NET MicroFramework" )] +[assembly: AssemblyConfiguration( "" )] +[assembly: AssemblyCompany( "Microsoft Corporation" )] +[assembly: AssemblyProduct( "HttpClient" )] +[assembly: AssemblyCopyright( "Copyright © 2015" )] +[assembly: AssemblyTrademark( "" )] +[assembly: AssemblyCulture( "" )] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion( "1.0.0.0" )] +[assembly: AssemblyFileVersion( "1.0.0.0" )] diff --git a/Product/Samples/HttpClient/Resources.Designer.cs b/Product/Samples/HttpClient/Resources.Designer.cs new file mode 100644 index 000000000..d6fe60fb6 --- /dev/null +++ b/Product/Samples/HttpClient/Resources.Designer.cs @@ -0,0 +1,48 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace HttpClientSample +{ + + internal partial class Resources + { + private static System.Resources.ResourceManager manager; + internal static System.Resources.ResourceManager ResourceManager + { + get + { + if ((Resources.manager == null)) + { + Resources.manager = new System.Resources.ResourceManager("HttpClientSample.Resources", typeof(Resources).Assembly); + } + return Resources.manager; + } + } + internal static string GetString(Resources.StringResources id) + { + return ((string)(Microsoft.SPOT.ResourceUtility.GetObject(ResourceManager, id))); + } + internal static byte[] GetBytes(Resources.BinaryResources id) + { + return ((byte[])(Microsoft.SPOT.ResourceUtility.GetObject(ResourceManager, id))); + } + [System.SerializableAttribute()] + internal enum StringResources : short + { + Soap = -30610, + } + [System.SerializableAttribute()] + internal enum BinaryResources : short + { + VerisignCA = -25106, + DigiCert = -5926, + } + } +} diff --git a/Product/Samples/HttpClient/Resources.resx b/Product/Samples/HttpClient/Resources.resx new file mode 100644 index 000000000..54684ef2e --- /dev/null +++ b/Product/Samples/HttpClient/Resources.resx @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Resources\DigiCert.cer;System.Byte[], mscorlib, Version=4.4.0.0, Culture=neutral, PublicKeyToken=null + + + <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing"> + <s:Header> + <a:Action s:mustUnderstand="1">http://schemas.example.org/SimpleService/TwoWayRequest</a:Action> + <a:From> + <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> + </a:From> + <a:ReplyTo> + <a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address> + </a:ReplyTo> + <a:MessageID>urn:uuid:85167211-529a-4eb1-89b0-5b7759df9cc3</a:MessageID> + <a:To s:mustUnderstand="1">http://localhost:8084/34c6b7e3-9494-4eb3-90bb-c946c2bcd775</a:To> + </s:Header> + <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <TwoWayRequest xmlns="http://schemas.example.org/SimpleService"> + <X>1</X> + <Y>2</Y> + </TwoWayRequest> + </s:Body> +</s:Envelope> + + + Resources\VerisignCA.cer;System.Byte[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Product/Samples/HttpClient/Resources/DigiCert.cer b/Product/Samples/HttpClient/Resources/DigiCert.cer new file mode 100644 index 000000000..4b1bc66be --- /dev/null +++ b/Product/Samples/HttpClient/Resources/DigiCert.cer @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- diff --git a/Product/Samples/HttpClient/Resources/VerisignCA.cer b/Product/Samples/HttpClient/Resources/VerisignCA.cer new file mode 100644 index 000000000..fd7867877 --- /dev/null +++ b/Product/Samples/HttpClient/Resources/VerisignCA.cer @@ -0,0 +1,14 @@ +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do +lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc +AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k +-----END CERTIFICATE----- diff --git a/Product/Samples/HttpClient/TimeServiceManager.cs b/Product/Samples/HttpClient/TimeServiceManager.cs new file mode 100644 index 000000000..60e8a6881 --- /dev/null +++ b/Product/Samples/HttpClient/TimeServiceManager.cs @@ -0,0 +1,83 @@ +/* +The MIT License (MIT) + +Copyright (c) 2015 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ +using Microsoft.SPOT.Time; +using System; +using System.Net; +using System.Threading; + +namespace HttpClientSample +{ + /// Implements common boilerplate code for using the TimeService + static class TimeServiceManager + { + /// Initializes the TimeService and waits for a valid time from the server + /// Host name of the time service server to use + /// Timezone offset (in minutes) to use for the service + public static void InitTimeService( string timeServiceName, int timeZoneOffset ) + { + // Get the address for the time service. + // It is considered bad practice to hard code the address + // as the service will likely load balance to a variety + // of physical IP addresses. + IPHostEntry entry = Dns.GetHostEntry( timeServiceName ); + if( entry == null || entry.AddressList == null ) + throw new ApplicationException( "DNS failure" ); + + // It is possible (at least on the emulator) that + // an address in the list may be null, so loop + // over them until a valid one is found. + IPAddress timeServiceAddress = null; + for( int i = 0; i < entry.AddressList.Length; ++i ) + { + timeServiceAddress = entry.AddressList[ i ]; + if( timeServiceAddress != null ) + break; + } + + // need to have a valid one to continue + if( timeServiceAddress == null ) + throw new ApplicationException( "DNS failure" ); + + TimeService.Settings = new TimeServiceSettings + { PrimaryServer = timeServiceAddress.GetAddressBytes( ) + , RefreshTime = 10 + , AutoDayLightSavings = true + }; + + TimeService.SetTimeZoneOffset( timeZoneOffset ); + + // Start the service and wait for initial time update/sync from server + TimeService.SystemTimeChanged += TimeService_SystemTimeChanged; + TimeService.Start( ); + TimeChanged.WaitOne( ); + TimeService.SystemTimeChanged -= TimeService_SystemTimeChanged; + } + + private static void TimeService_SystemTimeChanged( object sender, SystemTimeChangedEventArgs e ) + { + TimeChanged.Set( ); + } + static ManualResetEvent TimeChanged = new ManualResetEvent( false ); + } +} diff --git a/Product/Samples/HttpClient/readme.txt b/Product/Samples/HttpClient/readme.txt new file mode 100644 index 000000000..5133419f1 --- /dev/null +++ b/Product/Samples/HttpClient/readme.txt @@ -0,0 +1,65 @@ +The MIT License (MIT) + +Copyright (c) 2015 Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +HttpClient Sample +================= +This sample demonstrates the following: +- Using the Micro Framework�s Http and Https classes to create an Http or Https + client. +- Using an Http or Https client to retrieve pages from several different URLs + using Http and Https. + +This sample runs on the following devices: +- The .NET Micro Framework SDK 4.0 Emulator. +- Any physical device that implements the Sockets API and the Ethernet + controller API and provides a valid configuration for the Ethernet + controller. +- Any emulator that implements the Microsoft.SPOT.Emulator.Sockets + extensibility interface. +- SSL support for testing the secured sockets capabilities + +To explore this sample: +1. Open HttpClient.sln in Visual Studio. + +2. To run this sample in the Emulator, open the project Properties page, click + the .NET Micro Framework tab, set the Transport property to Emulator, and + then select the emulator you want to use. + + To run this sample on a device, open the project Properties page, click the + .NET Micro Framework tab, set the Transport property to the transport that + your device supports, and then select the device you want to target. + +3. In the Build menu, select Start Debugging (or press F5). + +4. In Visual Studio, show the Output window for Debug. The content of some Web + pages is printed in the Output window. + +5. Close the application. + +6. In file HttpClient.cs, set a breakpoint on the PrintHttpData method. + +7. Press F5 to start debugging the HTTP requests and responses. + +For best results, run the sample on a device. Any actual application that uses +this code will require modifications of this code. This solution provides +sample code, rather than ship-ready code, and is provided for instructional +purposes only. diff --git a/ProjectTemplates/MicroBooter/MicroBooter.proj b/ProjectTemplates/MicroBooter/MicroBooter.proj index 934420437..096156b55 100644 --- a/ProjectTemplates/MicroBooter/MicroBooter.proj +++ b/ProjectTemplates/MicroBooter/MicroBooter.proj @@ -17,8 +17,6 @@ - - False Solutions\$(PLATFORM)\MicroBooter False diff --git a/README.md b/README.md index 5bfe99edb..a2538e0a3 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ #.NET Micro Framework Interpreter -Welcome to the .NET Micro Framework interpreter GitHub repository. (Master Branch) +[![Build status](http://netmfbuildstatus.cloudapp.net/BuildStatus.svc/Badge)](http://netmfbuildstatus.cloudapp.net/BuildStatus.svc/Report) -The Microsoft® .NET Micro Framework combines the reliability and efficiency of managed code with the premier development tools of Microsoft Visual Studio® to deliver exceptional productivity for developing embedded applications on small devices. The Microsoft .NET Micro Framework SDK supports development of code, including device I/O, in the C# language using a subset of the .NET libraries, and is fully integrated with the Microsoft Visual Studio® development environment. The .NET Micro Framework class library supports all major namespaces and types from the desktop framework, managed drivers support, Remote Firmware Updates and Cryptographic functions for Secure Devices. This GitHub project allows building the full SDK and device Firmware images including the lwIP open source TCP/IP stack and the OpenSSL distribution. - -##Master Branch -The Master branch contains released source code that is updated when major milestones are released, including Beta builds. Active development is done in the [dev](https://github.com/NETMF/netmf-interpreter/tree/dev) branch. Thus the Master is considered fairly stable and never receives commits directly. (e.g. Any pull requests targeting the Master branch will be rejected automatically. All contributions should appear as a pull request to the dev branch) +Welcome to the .NET Micro Framework interpreter GitHub repository. -### Wiki Docs -Information on building the framework and internal development guides will appear on the [wiki](https://github.com/NETMF/netmf-interpreter/wiki). If you have Wiki content that is relevant to the NETMF development community or code that you would like to [contribute](https://github.com/NETMF/netmf-interpreter/wiki/Contributing) feel free to join in and participate in the future of the .NET Micro Framework! +The Microsoft® .NET Micro Framework combines the reliability and efficiency of managed code with the premier development tools of Microsoft Visual Studio® to deliver exceptional productivity for developing embedded applications on small devices. The Microsoft .NET Micro Framework SDK supports development of code, including device I/O, in the C# language using a subset of the .NET libraries, and is fully integrated with the Microsoft Visual Studio® development environment. The .NET Micro Framework class library supports all major namespaces and types from the desktop framework, managed drivers support, Remote Firmware Updates and Cryptographic functions for Secure Devices. This GitHub project allows building the full SDK and device Firmware images including the lwIP open source TCP/IP stack and the OpenSSL distribution. +## Wiki Docs +Information on building the framework and internal development guides will appear on the [wiki](https://github.com/NETMF/netmf-interpreter/wiki). If you have content that is relevant to the NETMF development community that you would like to [contribute](https://github.com/NETMF/netmf-interpreter/wiki/Contributing) feel free to join in and participate in the future of the .NET Micro Framework. diff --git a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/dotNetMF.proj index 4b75b3202..59b5bbe7b 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/M29W640FB/dotNetMF.proj @@ -7,11 +7,10 @@ Block storage configuration for external NOR flash M29W640FB on the MCBSTM32F400 HAL M29W640FB_blconfig_MCBSTM32F400.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Blockstorage\M29W640FB\dotNetMF.proj M29W640FB_blconfig_MCBSTM32F400.$(LIB_EXT).manifest Solutions\MCBSTM32F400 - + 4 0 @@ -26,7 +25,6 @@ False - MCBSTM32F400 False False False diff --git a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj index c5be5f9b1..bb7d21683 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj @@ -7,11 +7,10 @@ Block storage configuration for MCBSTM32F400 HAL STM32F4_blconfig_MCBSTM32F400.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Blockstorage\STM32F4\dotNetMF.proj STM32F4_blconfig_MCBSTM32F400.$(LIB_EXT).manifest Solutions\MCBSTM32F400 - + 4 0 @@ -26,7 +25,6 @@ False - MCBSTM32F400 False False False diff --git a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/addDevices/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/addDevices/dotNetMF.proj index 9b678dd76..2104ad64d 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/addDevices/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Blockstorage/addDevices/dotNetMF.proj @@ -7,11 +7,10 @@ Block storage add device driver for MCBSTM32F400 HAL BlockStorage_AddDevices_MCBSTM32F400.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Blockstorage\addDevices\dotNetMF.proj BlockStorage_AddDevices_MCBSTM32F400.$(LIB_EXT).manifest Solutions\MCBSTM32F400 - + 4 0 @@ -26,7 +25,6 @@ False - MCBSTM32F400 False False False diff --git a/Solutions/MCBSTM32F400/DeviceCode/CMSIS_RTX_Config/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/CMSIS_RTX_Config/dotNetMF.proj index 633a6e592..34468d34c 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/CMSIS_RTX_Config/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/CMSIS_RTX_Config/dotNetMF.proj @@ -8,11 +8,10 @@ CMSIS-RTX OS Config HAL CMSIS_RTX_CONFIG.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\CMSIS_RTX_Config\dotNetMF.proj CMSIS_RTX_CONFIG.$(LIB_EXT).manifest OS\CMSIS_RTOS - + LibraryCategory diff --git a/Solutions/MCBSTM32F400/DeviceCode/Crypto/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Crypto/dotNetMF.proj index d10ee6869..bfba56238 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Crypto/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Crypto/dotNetMF.proj @@ -8,7 +8,6 @@ PKCS11 Crypto configuration for MCBSTM32F400 HAL Crypto_config_MCBSTM32F400.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Crypto\dotNetMF.proj Crypto_config_MCBSTM32F400.$(LIB_EXT).manifest Solutions\MCBSTM32F400 @@ -28,7 +27,6 @@ False - MCBSTM32F400 False False False diff --git a/Solutions/MCBSTM32F400/DeviceCode/GlobalLock/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/GlobalLock/dotNetMF.proj index 2d55f2118..79ee69e3b 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/GlobalLock/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/GlobalLock/dotNetMF.proj @@ -7,7 +7,6 @@ GlobalLock library for CMSIS-RTOS HAL GlobalLock_hal_RTOS.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\GlobalLock\dotNetMF.proj GlobalLock_hal_RTOS.$(LIB_EXT).manifest diff --git a/Solutions/MCBSTM32F400/DeviceCode/Init/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Init/dotNetMF.proj index cd30fd7cb..ca3e1ff31 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Init/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Init/dotNetMF.proj @@ -1,6 +1,5 @@ - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Init\dotnetmf.proj IO_Init_MCBSTM32F400 @@ -15,8 +14,6 @@ False - - False False False diff --git a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj index b4cee4b87..9de2eb671 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF.proj @@ -8,11 +8,10 @@ System initialization library for MCBSTM32F400 HAL MCBSTM32F400_initialization_hal.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Initialization\dotNetMF.proj MCBSTM32F400_initialization_hal.$(LIB_EXT).manifest System - + 4 0 diff --git a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj index 640833f3e..e5857d64f 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Initialization/dotNetMF_loader.proj @@ -8,11 +8,10 @@ System initialization library for MCBSTM32F400 (for boot loaders) HAL MCBSTM32F400_initialization_hal_loader.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Initialization\dotNetMF_loader.proj MCBSTM32F400_initialization_hal_loader.$(LIB_EXT).manifest System - + 4 0 diff --git a/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/dotNetMF.proj index 0f1b9cf60..993d51b7c 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/M29W640FB_Flash/dotNetMF.proj @@ -1,6 +1,5 @@  - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\M29W640FB_Flash\dotNetMF.proj {ADD1DC98-CBE4-494B-92E7-F982B9E01A4B} M29W640FB_Flash @@ -19,7 +18,7 @@ False False - + 4 0 diff --git a/Solutions/MCBSTM32F400/DeviceCode/Network_Config_HAL/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/Network_Config_HAL/dotNetMF.proj index f5a05e3d2..e0a039441 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Network_Config_HAL/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/Network_Config_HAL/dotNetMF.proj @@ -8,11 +8,10 @@ Network configuration MCBSTM32F400 library HAL Network_Config_HAL_MCBSTM32F400.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\Network_Config_HAL\dotNetMF.proj Network_Config_HAL_MCBSTM32F400.$(LIB_EXT).manifest Network - + 4 0 diff --git a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF.proj index d0217607d..6de79af82 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF.proj @@ -8,11 +8,10 @@ MCBSTM32F400 tinyhal library HAL MCBSTM32F400_tinyhal.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\TinyHal\dotNetMF.proj MCBSTM32F400_tinyhal.$(LIB_EXT).manifest System - + 4 0 diff --git a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF_loader.proj b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF_loader.proj index 6efd31846..7d3fc107c 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF_loader.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/dotNetMF_loader.proj @@ -7,11 +7,10 @@ MCBSTM32F400 tinyhal library loader HAL MCBSTM32F400_tinyhal_loader.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\TinyHal\dotNetMF_loader.proj MCBSTM32F400_tinyhal.$(LIB_EXT).manifest_loader system - + 4 0 diff --git a/Solutions/MCBSTM32F400/DeviceCode/USB/dotNetMF.proj b/Solutions/MCBSTM32F400/DeviceCode/USB/dotNetMF.proj index 67fe6adfd..144f21f53 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/USB/dotNetMF.proj +++ b/Solutions/MCBSTM32F400/DeviceCode/USB/dotNetMF.proj @@ -7,11 +7,10 @@ USB PAL configuration for MCBSTM32F400 solution PAL usb_pal_config_MCBSTM32F400.$(LIB_EXT) - $(SPOCLIENT)\Solutions\MCBSTM32F400\DeviceCode\USB\dotnetmf.proj usb_pal_config_MCBSTM32F400.$(LIB_EXT).manifest Solutions\MCBSTM32F400 - + 4 0 diff --git a/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj b/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj index 2c0c81dff..269feb407 100644 --- a/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj +++ b/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj @@ -9,7 +9,6 @@ False - $(SPOCLIENT)\Solutions\MCBSTM32F400\MicroBooter\MicroBooter.proj $(SPOCLIENT)\Solutions\MCBSTM32F400\MCBSTM32F400.settings True @@ -17,10 +16,8 @@ - $(SPOCLIENT)\ProjectTemplates\MicroBooter\MicroBooter.proj - False true Executable diff --git a/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj b/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj index d82f02d74..d9d1375cf 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj +++ b/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj @@ -9,7 +9,6 @@ False - $(SPOCLIENT)\Solutions\MCBSTM32F400\TinyBooter\TinyBooter.proj $(SPOCLIENT)\Solutions\MCBSTM32F400\MCBSTM32F400.settings True true diff --git a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj index 5858bfb60..2869bc261 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj +++ b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj @@ -9,7 +9,6 @@ True - $(SPOCLIENT)\Solutions\MCBSTM32F400\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\MCBSTM32F400\MCBSTM32F400.settings True false diff --git a/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj b/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj index b8c486f3d..868d7a2c6 100644 --- a/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj +++ b/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj @@ -9,7 +9,6 @@ True - $(SPOCLIENT)\Solutions\MCBSTM32F400\TinyCLR_NONET\TinyCLR_NONET.proj $(SPOCLIENT)\Solutions\MCBSTM32F400\MCBSTM32F400_NONET.settings True false diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj index 12f07fc52..7011e91af 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/STM32F4/dotNetMF.proj @@ -7,11 +7,10 @@ Block storage configuration for STM32F4DISCOVERY HAL STM32F4_blconfig_STM32F4DISCOVERY.$(LIB_EXT) - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\DeviceCode\Blockstorage\STM32F4\dotNetMF.proj STM32F4_blconfig_STM32F4DISCOVERY.$(LIB_EXT).manifest Solutions\STM32F4DISCOVERY - + 4 0 @@ -26,7 +25,6 @@ False - STM32F4DISCOVERY False False False diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/addDevices/dotNetMF.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/addDevices/dotNetMF.proj index b8bde636e..9da0563b1 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/addDevices/dotNetMF.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Blockstorage/addDevices/dotNetMF.proj @@ -7,11 +7,10 @@ Block storage add device driver for STM32F4DISCOVERY HAL BlockStorage_AddDevices_STM32F4DISCOVERY.$(LIB_EXT) - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\DeviceCode\Blockstorage\addDevices\dotNetMF.proj BlockStorage_AddDevices_STM32F4DISCOVERY.$(LIB_EXT).manifest Solutions\STM32F4DISCOVERY - + 4 0 @@ -26,7 +25,6 @@ False - STM32F4DISCOVERY False False False diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Init/dotNetMF.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Init/dotNetMF.proj index 3586aa345..fffe870d9 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Init/dotNetMF.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Init/dotNetMF.proj @@ -1,6 +1,5 @@ - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\DeviceCode\Init\dotnetmf.proj IO_Init_STM32F4DISCOVERY @@ -15,8 +14,6 @@ False - - False False False diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj index c59165a4e..ae05cbf58 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF.proj @@ -8,11 +8,10 @@ System initialization library for STM32F4DISCOVERY HAL STM32F4DISCOVERY_initialization_hal.$(LIB_EXT) - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\DeviceCode\Initialization\dotNetMF.proj STM32F4DISCOVERY_initialization_hal.$(LIB_EXT).manifest System - + 4 0 diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj index c3e2b5af5..7f745c770 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/dotNetMF_loader.proj @@ -8,11 +8,10 @@ System initialization library for STM32F4DISCOVERY (for boot loaders) HAL STM32F4DISCOVERY_initialization_hal_loader.$(LIB_EXT) - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\DeviceCode\Initialization\dotNetMF_loader.proj STM32F4DISCOVERY_initialization_hal_loader.$(LIB_EXT).manifest System - + 4 0 diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/USB/dotNetMF.proj b/Solutions/STM32F4DISCOVERY/DeviceCode/USB/dotNetMF.proj index 705bc8e53..268123ba2 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/USB/dotNetMF.proj +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/USB/dotNetMF.proj @@ -7,11 +7,10 @@ USB PAL configuration for STM32F4DISCOVERY solution PAL usb_pal_config_STM32F4DISCOVERY.$(LIB_EXT) - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\DeviceCode\USB\dotnetmf.proj usb_pal_config_STM32F4DISCOVERY.$(LIB_EXT).manifest Solutions\STM32F4DISCOVERY - + 4 0 diff --git a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj index a71459cd5..d8c4f5188 100644 --- a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj +++ b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj @@ -9,7 +9,6 @@ False - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\TinyBooter\TinyBooter.proj $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\STM32F4DISCOVERY.settings True true diff --git a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj index 0e163fe15..bb8254842 100644 --- a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj +++ b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj @@ -9,7 +9,6 @@ True - $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\STM32F4DISCOVERY\STM32F4DISCOVERY.settings True false diff --git a/Solutions/Template/DeviceCode/USB_Config_PAL/dotNetMF.proj b/Solutions/Template/DeviceCode/USB_Config_PAL/dotNetMF.proj index ef0415c58..4b85c085b 100644 --- a/Solutions/Template/DeviceCode/USB_Config_PAL/dotNetMF.proj +++ b/Solutions/Template/DeviceCode/USB_Config_PAL/dotNetMF.proj @@ -7,11 +7,10 @@ USB configuration TEMPLATE library PAL USB_Config_PAL_TEMPLATE.$(LIB_EXT) - $(SPOCLIENT)\Solutions\Template\DeviceCode\USB_Config_PAL\dotNetMF.proj USB_Config_PAL_TEMPLATE.$(LIB_EXT).manifest USB - + 4 0 diff --git a/Solutions/Template/DeviceCode/USB_HAL/dotNetMF.proj b/Solutions/Template/DeviceCode/USB_HAL/dotNetMF.proj index 2ed9de4f5..738e5ba5f 100644 --- a/Solutions/Template/DeviceCode/USB_HAL/dotNetMF.proj +++ b/Solutions/Template/DeviceCode/USB_HAL/dotNetMF.proj @@ -7,11 +7,10 @@ USB TEMPLATE library HAL USB_HAL_TEMPLATE.$(LIB_EXT) - $(SPOCLIENT)\Solutions\Template\DeviceCode\USB_HAL\dotNetMF.proj USB_HAL_TEMPLATE.$(LIB_EXT).manifest Processor\TEMPLATE - + 4 0 diff --git a/Solutions/Template/NativeSample/NativeSample.proj b/Solutions/Template/NativeSample/NativeSample.proj index c8e02f148..009424261 100644 --- a/Solutions/Template/NativeSample/NativeSample.proj +++ b/Solutions/Template/NativeSample/NativeSample.proj @@ -13,7 +13,6 @@ - $(SPOCLIENT)\Solutions\Template\NativeSample\NativeSample.proj $(SPOCLIENT)\Solutions\Template\Template.settings True diff --git a/Solutions/Template/PortBooter/portBooter.proj b/Solutions/Template/PortBooter/portBooter.proj index 998d9a3c3..687ff2d1e 100644 --- a/Solutions/Template/PortBooter/portBooter.proj +++ b/Solutions/Template/PortBooter/portBooter.proj @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Template\PortBooter\portBooter.proj $(SPOCLIENT)\Solutions\Template\Template.settings True diff --git a/Solutions/Template/PortBooter/portBooterloader.proj b/Solutions/Template/PortBooter/portBooterloader.proj index bf37cc26f..b6ee84757 100644 --- a/Solutions/Template/PortBooter/portBooterloader.proj +++ b/Solutions/Template/PortBooter/portBooterloader.proj @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Template\PortBooter\portBooterloader.proj $(SPOCLIENT)\Solutions\Template\Template.settings True diff --git a/Solutions/Template/TinyBooter/TinyBooter.proj b/Solutions/Template/TinyBooter/TinyBooter.proj index bec4c7a41..6ac4f5fc9 100644 --- a/Solutions/Template/TinyBooter/TinyBooter.proj +++ b/Solutions/Template/TinyBooter/TinyBooter.proj @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Template\TinyBooter\TinyBooter.proj $(SPOCLIENT)\Solutions\Template\Template.settings True diff --git a/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj b/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj index 3058335b7..f0a0b59ee 100644 --- a/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj +++ b/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Template\TinyBooter\TinyBooterDecompressor.proj $(SPOCLIENT)\Solutions\Template\Template.settings True diff --git a/Solutions/Template/TinyCLR/TinyCLR.proj b/Solutions/Template/TinyCLR/TinyCLR.proj index a2a09b4d5..70319017c 100644 --- a/Solutions/Template/TinyCLR/TinyCLR.proj +++ b/Solutions/Template/TinyCLR/TinyCLR.proj @@ -13,7 +13,6 @@ - $(SPOCLIENT)\Solutions\Template\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\Template\Template.settings True diff --git a/Solutions/Template_BE/DeviceCode/USB_Config_PAL/dotNetMF.proj b/Solutions/Template_BE/DeviceCode/USB_Config_PAL/dotNetMF.proj index 1c3e0326d..b6c270aea 100644 --- a/Solutions/Template_BE/DeviceCode/USB_Config_PAL/dotNetMF.proj +++ b/Solutions/Template_BE/DeviceCode/USB_Config_PAL/dotNetMF.proj @@ -7,11 +7,10 @@ USB configuration TEMPLATE_BE library PAL USB_Config_PAL_TEMPLATE_BE.$(LIB_EXT) - $(SPOCLIENT)\Solutions\Template_BE\DeviceCode\USB_Config_PAL\dotNetMF.proj USB_Config_PAL_TEMPLATE_BE.$(LIB_EXT).manifest USB - + 4 0 diff --git a/Solutions/Template_BE/DeviceCode/USB_HAL/dotNetMF.proj b/Solutions/Template_BE/DeviceCode/USB_HAL/dotNetMF.proj index 9d1a11263..3a0f67ceb 100644 --- a/Solutions/Template_BE/DeviceCode/USB_HAL/dotNetMF.proj +++ b/Solutions/Template_BE/DeviceCode/USB_HAL/dotNetMF.proj @@ -7,11 +7,10 @@ USB TEMPLATE library HAL USB_HAL_TEMPLATE_BE.$(LIB_EXT) - $(SPOCLIENT)\Solutions\Template_BE\DeviceCode\USB_HAL\dotNetMF.proj USB_HAL_TEMPLATE_BE.$(LIB_EXT).manifest Processor\TEMPLATE - + 4 0 diff --git a/Solutions/Template_BE/NativeSample/NativeSample.proj b/Solutions/Template_BE/NativeSample/NativeSample.proj index 8b84864d1..b88e58eb0 100644 --- a/Solutions/Template_BE/NativeSample/NativeSample.proj +++ b/Solutions/Template_BE/NativeSample/NativeSample.proj @@ -13,7 +13,6 @@ - $(SPOCLIENT)\Solutions\Template_BE\NativeSample\NativeSample.proj $(SPOCLIENT)\Solutions\Template_BE\Template_BE.settings True diff --git a/Solutions/Template_BE/PortBooter/portBooter.proj b/Solutions/Template_BE/PortBooter/portBooter.proj index 826a30be9..133c34dba 100644 --- a/Solutions/Template_BE/PortBooter/portBooter.proj +++ b/Solutions/Template_BE/PortBooter/portBooter.proj @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Template_BE\PortBooter\portBooter.proj $(SPOCLIENT)\Solutions\Template_BE\Template_BE.settings True diff --git a/Solutions/Template_BE/PortBooter/portBooterloader.proj b/Solutions/Template_BE/PortBooter/portBooterloader.proj index 7df3751d0..553701d40 100644 --- a/Solutions/Template_BE/PortBooter/portBooterloader.proj +++ b/Solutions/Template_BE/PortBooter/portBooterloader.proj @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Template_BE\PortBooter\portBooterloader.proj $(SPOCLIENT)\Solutions\Template_BE\Template_BE.settings True diff --git a/Solutions/Template_BE/TinyCLR/TinyCLR.proj b/Solutions/Template_BE/TinyCLR/TinyCLR.proj index d60608156..fa7ae5888 100644 --- a/Solutions/Template_BE/TinyCLR/TinyCLR.proj +++ b/Solutions/Template_BE/TinyCLR/TinyCLR.proj @@ -13,7 +13,6 @@ - $(SPOCLIENT)\Solutions\Template_BE\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\Template_BE\Template_BE.settings True diff --git a/Solutions/Windows2/TinyCLR/TinyCLR.proj b/Solutions/Windows2/TinyCLR/TinyCLR.proj index 054dfa4d3..165164058 100644 --- a/Solutions/Windows2/TinyCLR/TinyCLR.proj +++ b/Solutions/Windows2/TinyCLR/TinyCLR.proj @@ -13,7 +13,6 @@ - $(SPOCLIENT)\Solutions\Windows2\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\Windows2\Windows2.settings True diff --git a/Solutions/Windows2/TinyCLR/TinyCLR.proj.port b/Solutions/Windows2/TinyCLR/TinyCLR.proj.port index 061363c61..393941aa7 100644 --- a/Solutions/Windows2/TinyCLR/TinyCLR.proj.port +++ b/Solutions/Windows2/TinyCLR/TinyCLR.proj.port @@ -5,7 +5,6 @@ E7D5455B-4FE3-42AF-8F44-AFB687DF5A87 DLL Solutions\Windows2\TinyCLR - $(SPOCLIENT)\Solutions\Windows2\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\Windows2\Windows2.settings True diff --git a/Solutions/Windows2/TinyCLR/TinyCLR.proj_no_floating_point b/Solutions/Windows2/TinyCLR/TinyCLR.proj_no_floating_point index 8643e7f01..6b33fd1e7 100644 --- a/Solutions/Windows2/TinyCLR/TinyCLR.proj_no_floating_point +++ b/Solutions/Windows2/TinyCLR/TinyCLR.proj_no_floating_point @@ -12,7 +12,6 @@ - $(SPOCLIENT)\Solutions\Windows2\TinyCLR\TinyCLR.proj $(SPOCLIENT)\Solutions\Windows2\Windows2.settings True diff --git a/Support/WireProtocol/dotNetMF.proj b/Support/WireProtocol/dotNetMF.proj index 23b7857c4..2b90af336 100644 --- a/Support/WireProtocol/dotNetMF.proj +++ b/Support/WireProtocol/dotNetMF.proj @@ -13,7 +13,7 @@ - + 4 0 @@ -28,8 +28,6 @@ True - - False False False diff --git a/Support/crc/dotNetMF.proj b/Support/crc/dotNetMF.proj index c7ecbc9c4..6bc5ff19c 100644 --- a/Support/crc/dotNetMF.proj +++ b/Support/crc/dotNetMF.proj @@ -14,7 +14,7 @@ - + 4 0 @@ -29,8 +29,6 @@ True - - False False False diff --git a/crypto/dotNetMF.proj b/crypto/dotNetMF.proj index e786c22f7..acba074c4 100644 --- a/crypto/dotNetMF.proj +++ b/crypto/dotNetMF.proj @@ -12,7 +12,7 @@ - + 4 0 @@ -27,8 +27,6 @@ False - - False False False diff --git a/crypto/stubs/dotNetMF.proj b/crypto/stubs/dotNetMF.proj index 234fa94ef..e68be0d2b 100644 --- a/crypto/stubs/dotNetMF.proj +++ b/crypto/stubs/dotNetMF.proj @@ -11,7 +11,7 @@ Crypto_stub.$(LIB_EXT).manifest Cryptography - + 4 0 @@ -26,8 +26,6 @@ False - - False False True diff --git a/tools/Targets/Microsoft.SPOT.SDK.Targets b/tools/Targets/Microsoft.SPOT.SDK.Targets index 665e84dcc..701ee15f4 100644 --- a/tools/Targets/Microsoft.SPOT.SDK.Targets +++ b/tools/Targets/Microsoft.SPOT.SDK.Targets @@ -16,7 +16,7 @@ 400 100040160 272 - smaillet;mortezag + colina;mortezag;lorenzte + 4199 + + /wd4091 @@ -12,10 +16,7 @@ BuildHelper E0D29432-F26B-44E7-A0FB-6FA21DF258E1 CONSOLE - - 4199 - - /wd4091 + diff --git a/CLR/Tools/Parser/Linker.cpp b/CLR/Tools/Parser/Linker.cpp index 240e6d9f9..bf175138b 100644 --- a/CLR/Tools/Parser/Linker.cpp +++ b/CLR/Tools/Parser/Linker.cpp @@ -5,10 +5,6 @@ #include "stdafx.h" #include -#if defined(PLATFORM_WINDOWS) -#pragma comment(lib,"crypto") -#endif - #include //--// diff --git a/CLR/Tools/StubWinHal/StubWinHal.cpp b/CLR/Tools/StubWinHal/StubWinHal.cpp index 66eccd49f..20b05863f 100644 --- a/CLR/Tools/StubWinHal/StubWinHal.cpp +++ b/CLR/Tools/StubWinHal/StubWinHal.cpp @@ -24,7 +24,9 @@ void CPU_Reset() {} unsigned int Events_MaskedRead( unsigned int ) { return 0; } +#if defined(PLATFORM_WINDOWS_EMULATOR) void CLR_RT_EmulatorHooks::Notify_ExecutionStateChanged( void ) {} +#endif unsigned int Events_WaitForEvents( unsigned int powerLevel, unsigned int,unsigned int ) { return 0; } diff --git a/CLR/Tools/StubWinHal/minheap.cpp b/CLR/Tools/StubWinHal/minheap.cpp index 03df62a86..9c36cf20f 100644 --- a/CLR/Tools/StubWinHal/minheap.cpp +++ b/CLR/Tools/StubWinHal/minheap.cpp @@ -6,7 +6,9 @@ #include "HAL_Windows.h" //////////////////////////////////////////////////////////////////////////////////////////////////// +#if defined(PLATFORM_WINDOWS_EMULATOR) HAL_Configuration_Windows g_HAL_Configuration_Windows; +#endif HAL_SYSTEM_CONFIG HalSystemConfig = { diff --git a/CLR/Tools/TFConvert/dotNetMF.proj b/CLR/Tools/TFConvert/dotNetMF.proj index 195e25ce5..10027d58e 100644 --- a/CLR/Tools/TFConvert/dotNetMF.proj +++ b/CLR/Tools/TFConvert/dotNetMF.proj @@ -6,7 +6,7 @@ Server 4199 - + /wd4091 diff --git a/CLR/Tools/Tools.settings b/CLR/Tools/Tools.settings index eab8f1251..c6627a6f3 100644 --- a/CLR/Tools/Tools.settings +++ b/CLR/Tools/Tools.settings @@ -1,6 +1,9 @@ + + + - + diff --git a/DeviceCode/Targets/OS/Win32/CpuOsIrq.h b/DeviceCode/Targets/OS/Win32/CpuOsIrq.h new file mode 100644 index 000000000..c9491a42a --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/CpuOsIrq.h @@ -0,0 +1,114 @@ +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +namespace +{ + class CriticalSection + { + public: + CriticalSection( ) + { + ::InitializeCriticalSection( &CritSect ); + } + + void lock( ) + { + ::EnterCriticalSection( &CritSect ); + Owner = ::GetCurrentThreadId(); + } + + void unlock( ) + { + ASSERT( owned() ); + if( !owned() ) + return; + + Owner = UINT32_MAX; + ::LeaveCriticalSection( &CritSect ); + } + + bool owned() { return ::GetCurrentThreadId() == Owner; } + + static bool InIsr() + { + return false; + } + + private: + DWORD Owner; + CRITICAL_SECTION CritSect; + }; +} + +// Mutex, and state flag used to indicate global IRQ enable state. +// The CLR thread will block on this as it is used to simulate +// disabling/enabling interrupts in the CPU as well as when an ISR +// runs. Background threads in the OS essentially simulate real world +// external activity and interrupts to the CPU, so they must block +// on this mutex before they can modify CLR global data structs etc... +typedef MsOpenTech::NETMF::OsIrqLock< CriticalSection > Lock_t; +static Lock_t IrqsEnabledMutex; + +// IRQ state modeling how most MCUs use bit(s) in a global status register +// this helps make the code easier to port and also allows for simple +// testing of the current state. +static uint32_t IrqsEnabledState = 0; +const uint32_t IrqsDisabledFlag = 1; + +inline bool IrqsDisabled( uint32_t state ) +{ + return ( state & IrqsDisabledFlag ) == IrqsDisabledFlag; +} + +inline bool IrqsEnabled( uint32_t state ) +{ + return ( state & IrqsDisabledFlag ) == 0; +} + +// internal function to simulate common interrupt enable state query for embedded MCUs +inline bool irqs_enabled( ) +{ + return IrqsEnabled( IrqsEnabledState ); +} + +// internal function to simulate common interrupt enable intrinsics for embedded MCUs +uint32_t enable_irqs( ) +{ + // capture and update current state with lock held + uint32_t retVal = IrqsEnabledState; + IrqsEnabledState &= ~IrqsDisabledFlag; + IrqsEnabledMutex.unlock( ); + return retVal; +} + +// internal function to simulate common interrupt disable intrinsics for embedded MCUs +uint32_t disable_irqs( ) +{ + IrqsEnabledMutex.lock( ); + // capture and update current state with lock held + uint32_t retVal = IrqsEnabledState; + IrqsEnabledState |= IrqsDisabledFlag; + return retVal; +} + +// allow an "interrupt" to occur +inline void irq_yield() +{ + //__NOP(); + if( !::SwitchToThread( ) ) + ::Sleep( 0 ); +} diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/Dependencies/WINPCAP_IN_NETMF_README.txt b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/Dependencies/WINPCAP_IN_NETMF_README.txt new file mode 100644 index 000000000..37d705954 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/Dependencies/WINPCAP_IN_NETMF_README.txt @@ -0,0 +1,19 @@ +The WinPcap_Eth driver interface is dependent on library files from the +WinPcap Developer Pack. These files are not included in the NETMF source +distribution. In order to sucesfully compile and use the WinPCAP Ethernet +driver for NETMF you first need to download the WinPcap Developer Pack +from: + +http://www.winpcap.org/devel.htm + +Unzip the contents and copy the "WpdPack" folder and its subfolders to: +"$(SPOCLIENT)\DeviceCode\Targets\OS\Win32\DeviceCode\WinPcap_Eth\Dependencies\" + +The final directory structure should look like this: + +$(SPOCLIENT)\DeviceCode\Targets\OS\Win32\DeviceCode\WinPcap_Eth\Dependencies\WpdPack\ +|-- docs +|-- Examples-pcap +|-- Examples-remote +|-- Include +|-- Lib \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/WinPcap_Eth_lwIP_Adapter.cpp b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/WinPcap_Eth_lwIP_Adapter.cpp new file mode 100644 index 000000000..4fe554763 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/WinPcap_Eth_lwIP_Adapter.cpp @@ -0,0 +1,126 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) Microsoft Corporation. All rights reserved. +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include + +#include "WinPcap_Eth_lwIP_Adapter.h" + +extern "C" +{ +#include "pcapif.h" +} + +extern WINPCAP_ETH_LWIP_DEVICE_CONFIG g_WINPCAP_ETH_LWIP_Config; +extern NETWORK_CONFIG g_NetworkConfig; + +static BOOL LwipNetworkStatus = FALSE; +static struct netif g_WinPcap_ETH_NetIF; + +static WINPCAP_ETH_LWIP_Driver g_WINPCAP_ETH_LWIP_Driver; + +BOOL Network_Interface_Bind(int index) +{ + NATIVE_PROFILE_HAL_DRIVERS_ETHERNET(); + + return g_WINPCAP_ETH_LWIP_Driver.Bind(); +} + +int Network_Interface_Open(int index) +{ + NATIVE_PROFILE_HAL_DRIVERS_ETHERNET(); + if(index >= ARRAYSIZE(g_WINPCAP_ETH_LWIP_Config.DeviceConfigs)) + return -1; + + HAL_CONFIG_BLOCK::ApplyConfig( WINPCAP_ETH_LWIP_DEVICE_CONFIG::GetDriverName(), &g_WINPCAP_ETH_LWIP_Config, sizeof(g_WINPCAP_ETH_LWIP_Config) ); + + return g_WINPCAP_ETH_LWIP_Driver.Open(&g_WINPCAP_ETH_LWIP_Config.DeviceConfigs[index], index); +} + +BOOL Network_Interface_Close(int index) +{ + NATIVE_PROFILE_HAL_DRIVERS_ETHERNET(); + + return g_WINPCAP_ETH_LWIP_Driver.Close(index); +} + +int WINPCAP_ETH_LWIP_Driver::Open(WINPCAP_ETH_LWIP_DRIVER_CONFIG* config, int index) +{ + /* Network interface variables */ + struct ip_addr ipaddr, subnetmask, gateway; + BOOL isDHCPenabled; + const SOCK_NetworkConfiguration *iface; + + if(config == NULL) + { + return -1; + } + + /* Apply network configuration */ + iface = &g_NetworkConfig.NetworkInterfaces[index]; + isDHCPenabled = (iface->flags & SOCK_NETWORKCONFIGURATION_FLAGS_DHCP)? TRUE: FALSE; + + if(!isDHCPenabled) + { + /* Set network address variables for static ip configuration */ + ipaddr.addr = iface->ipaddr; + gateway.addr = iface->gateway; + subnetmask.addr = iface->subnetmask; + } + else + { + /* Set network address variables - this will be set by either DHCP or when the configuration is applied */ + IP4_ADDR(&gateway, 0, 0, 0, 0); + IP4_ADDR(&ipaddr , 0, 0, 0, 0); + IP4_ADDR(&subnetmask, 255, 255, 255, 0); + } + + /* Configure the MAC address */ + if(iface->macAddressLen != ETHARP_HWADDR_LEN) + { + return -1; + } + + memcpy(g_WinPcap_ETH_NetIF.hwaddr, iface->macAddressBuffer, iface->macAddressLen); + + auto pNetIf = netif_add( &g_WinPcap_ETH_NetIF, &ipaddr, &subnetmask, &gateway, (void*) config->adapterGuid, pcapif_init, tcpip_input ); + if( pNetIf == nullptr ) + return -1; + + netif_set_default( &g_WinPcap_ETH_NetIF ); + + LwipNetworkStatus = TRUE; + + return g_WinPcap_ETH_NetIF.num; +} + +BOOL WINPCAP_ETH_LWIP_Driver::Close(int index) +{ + const SOCK_NetworkConfiguration *iface; + + LwipNetworkStatus = FALSE; + + iface = &g_NetworkConfig.NetworkInterfaces[index]; + + netif_remove( &g_WinPcap_ETH_NetIF ); + + pcapif_shutdown(&g_WinPcap_ETH_NetIF); + + memset( &g_WinPcap_ETH_NetIF, 0, sizeof g_WinPcap_ETH_NetIF ); + + return TRUE; +} + +/* Bind function doesn't actually do anything for this implementation */ +BOOL WINPCAP_ETH_LWIP_Driver::Bind(void) +{ + return TRUE; +} + + + + diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/WinPcap_Eth_lwIP_Adapter.h b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/WinPcap_Eth_lwIP_Adapter.h new file mode 100644 index 000000000..6a9233581 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/WinPcap_Eth_lwIP_Adapter.h @@ -0,0 +1,45 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) Microsoft Corporation. All rights reserved. +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#include + +#ifndef _WINPCAP_ETH_LWIP_ADAPTER_H_ +#define _WINPCAP_ETH_LWIP_ADAPTER_H_ 1 +// 1 2 3 +//01234567890123456789012345678901234567 +//{00000000-0000-0000-0000-000000000000} +const size_t GuidStringLen = 39; //38 chars + 1 for terminating \0 + +struct WINPCAP_ETH_LWIP_DRIVER_CONFIG +{ + char adapterGuid[GuidStringLen]; +}; + +#ifndef NETWORK_INTERFACE_COUNT +#define NETWORK_INTERFACE_COUNT 1 +#endif + +struct WINPCAP_ETH_LWIP_DEVICE_CONFIG +{ + WINPCAP_ETH_LWIP_DRIVER_CONFIG DeviceConfigs[ NETWORK_INTERFACE_COUNT ]; + + static LPCSTR GetDriverName( ) + { + return "WINPCAP_ETH_LWIP"; + } +}; + +struct WINPCAP_ETH_LWIP_Driver +{ + static int Open( WINPCAP_ETH_LWIP_DRIVER_CONFIG* config, int index ); + static BOOL Close( int index ); + static BOOL Bind( void ); +}; + +// +// _WINPCAP_ETH_LWIP_ADAPTER_H_ +////////////////////////////////////////////////////////////////////////////// + +#endif + diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/dotNetMF.proj b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/dotNetMF.proj new file mode 100644 index 000000000..f0ac0e62f --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/dotNetMF.proj @@ -0,0 +1,42 @@ + + + + WinPcap_Eth + + + {8BA0D2BB-CAFA-4279-BB5D-9013ABEFF9B5} + WinPcap Ethernet Driver + HAL + WinPcap_Eth.$(LIB_EXT) + $(SPOCLIENT)\DeviceCode\Targets\OS\Win32\DeviceCode\WinPcap_Eth\dotNetMF.proj + WinPcap_Eth.$(LIB_EXT).manifest + False + + + False + False + False + DeviceCode\Targets\OS\Win32\DeviceCode\WinPcap_Eth + Library + false + 4.0.0.0 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif.c b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif.c new file mode 100644 index 000000000..fe3d8ffb6 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif.c @@ -0,0 +1,738 @@ +/** + * pcapif.c - This file is part of lwIP pcapif + * + **************************************************************************** + * + * This file is derived from an example in lwIP with the following license: + * + * Copyright (c) 2001, Swedish Institute of Computer Science. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the Institute nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +#include + +#include "pcap.h" + +#include "lwip/opt.h" + +#if LWIP_ETHERNET + +#include "pcapif.h" + +#include +#include +#include + +#include "lwip/debug.h" + +#include "lwip/def.h" +#include "lwip/mem.h" +#include "lwip/pbuf.h" +#include "lwip/stats.h" +#include "lwip/sys.h" +#include "lwip/ip.h" +#include "lwip/snmp.h" +#include "lwip/tcpip.h" +#include "lwip/timers.h" + +#include "netif/etharp.h" + +extern void sys_periodic_timeout( u32_t msecs, sys_timeout_handler handler, void *arg ); + +/* For compatibility with old pcap */ +#ifndef PCAP_OPENFLAG_PROMISCUOUS +#define PCAP_OPENFLAG_PROMISCUOUS 1 +#endif + +/* Define those to better describe your network interface. + For now, we use 'e0', 'e1', 'e2' and so on */ +#define IFNAME0 'e' +#define IFNAME1 '0' + +/** If 1, check link state and report it to lwIP. + * If 0, don't check link state (lwIP link state is always UP). + */ +#ifndef PCAPIF_HANDLE_LINKSTATE +#define PCAPIF_HANDLE_LINKSTATE 1 +#endif + +#if PCAPIF_HANDLE_LINKSTATE +#include "pcapif_helper.h" + +/* Define "PHY" delay when "link up" */ +#ifndef PCAPIF_LINKUP_DELAY +#define PCAPIF_LINKUP_DELAY 0 +#endif + +#define PCAPIF_LINKCHECK_INTERVAL_MS 500 + +/* link state notification macro */ +#if PCAPIF_LINKUP_DELAY +#define PCAPIF_NOTIFY_LINKSTATE(netif, linkfunc) sys_timeout(PCAPIF_LINKUP_DELAY, (sys_timeout_handler)linkfunc, netif) +#else /* PHY_LINKUP_DELAY */ +#define PCAPIF_NOTIFY_LINKSTATE(netif, linkfunc) linkfunc(netif) +#endif /* PHY_LINKUP_DELAY */ + +#endif /* PCAPIF_HANDLE_LINKSTATE */ + + +#define ADAPTER_NAME_LEN 128 +#define ADAPTER_DESC_LEN 128 + +/* Packet Adapter informations */ +struct pcapif_private +{ + void *input_fn_arg; + pcap_t *adapter; + char name[ ADAPTER_NAME_LEN ]; + char description[ ADAPTER_DESC_LEN ]; + int shutdown_called; +#if PCAPIF_RX_USE_THREAD + volatile int rx_run; + volatile int rx_running; +#endif /* PCAPIF_RX_USE_THREAD */ +#if PCAPIF_HANDLE_LINKSTATE + struct pcapifh_linkstate *link_state; + enum pcapifh_link_event last_link_event; +#endif /* PCAPIF_HANDLE_LINKSTATE */ +}; + +/* Forward declarations. */ +static void pcapif_input( u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *packet ); + +/** Get the index of an adapter by its GUID + * + * @param adapter_guid GUID of the adapter + * @return index of the adapter or negative on error + */ +static int +get_adapter_index(const char* adapter_guid) +{ + pcap_if_t *alldevs; + pcap_if_t *d; + char errbuf[PCAP_ERRBUF_SIZE+1]; + int idx = 0; + + /* Retrieve the interfaces list */ + if (pcap_findalldevs(&alldevs, errbuf) == -1) + { + printf("Error in pcap_findalldevs: %s\n", errbuf); + return -1; + } + /* Scan the list and compare name vs. adapter_guid */ + for (d = alldevs; d != NULL; d = d->next, idx++) + { + if(strstr(d->name, adapter_guid)) + { + pcap_freealldevs(alldevs); + return idx; + } + } + /* not found, dump all adapters */ + printf("%d available adapters:\n", idx); + for (d = alldevs, idx = 0; d != NULL; d = d->next, idx++) + { + printf("- %d: %s\n", idx, d->name); + } + pcap_freealldevs(alldevs); + return -1; +} + +/** + * Open a network adapter and set it up for packet input + * + * @param adapter_num the index of the adapter to use + * @param arg argument to pass to input + * @return an adapter handle on success, NULL on failure + */ +static struct pcapif_private* pcapif_init_adapter( int adapter_num, void *arg ) +{ + int i; + int number_of_adapters; + struct pcapif_private *pa; + char errbuf[ PCAP_ERRBUF_SIZE + 1 ]; + + pcap_if_t *alldevs; + pcap_if_t *d; + pcap_if_t *used_adapter = NULL; + + pa = ( struct pcapif_private * )malloc( sizeof( struct pcapif_private ) ); + if( !pa ) + { + printf( "Unable to alloc the adapter!\n" ); + return NULL; + } + + memset( pa, 0, sizeof( struct pcapif_private ) ); + pa->input_fn_arg = arg; + + /* Retrieve the interfaces list */ + if( pcap_findalldevs( &alldevs, errbuf ) == -1 ) + { + free( pa ); + return NULL; /* no adapters found */ + } + + /* get number of adatpers and adapter pointer */ + for( d = alldevs, number_of_adapters = 0; d != NULL; d = d->next, number_of_adapters++ ) + { + if( number_of_adapters == adapter_num ) + { + char *desc = d->description; + size_t len; + + len = strlen( d->name ); + LWIP_ASSERT( "len < ADAPTER_NAME_LEN", len < ADAPTER_NAME_LEN ); + strcpy( pa->name, d->name ); + + used_adapter = d; + /* format vendor description */ + if( desc != NULL ) + { + len = strlen( desc ); + if( strstr( desc, " ' on local host" ) != NULL ) + { + len -= 16; + } + else if( strstr( desc, "' on local host" ) != NULL ) + { + len -= 15; + } + if( strstr( desc, "Network adapter '" ) == desc ) + { + len -= 17; + desc += 17; + } + len = LWIP_MIN( len, ADAPTER_DESC_LEN - 1 ); + while( ( desc[ len - 1 ] == ' ' ) || ( desc[ len - 1 ] == '\t' ) ) + { + /* don't copy trailing whitespace */ + len--; + } + strncpy( pa->description, desc, len ); + pa->description[ len ] = 0; + } + else + { + strcpy( pa->description, "" ); + } + } + } + +#ifndef PCAPIF_LIB_QUIET + /* Scan the list printing every entry */ + for( d = alldevs, i = 0; d != NULL; d = d->next, i++ ) + { + char *desc = d->description; + char descBuf[ 128 ]; + size_t len; + const char* devname = d->name; + if( d->name == NULL ) + { + devname = ""; + } + else + { + if( strstr( devname, "\\Device\\" ) == devname ) + { + /* windows: strip the first part */ + devname += 8; + } + } + printf( "%2i: %s\n", i, devname ); + if( desc != NULL ) + { + /* format vendor description */ + len = strlen( desc ); + if( strstr( desc, " ' on local host" ) != NULL ) + { + len -= 16; + } + else if( strstr( desc, "' on local host" ) != NULL ) + { + len -= 15; + } + if( strstr( desc, "Network adapter '" ) == desc ) + { + len -= 17; + desc += 17; + } + len = LWIP_MIN( len, 127 ); + while( ( desc[ len - 1 ] == ' ' ) || ( desc[ len - 1 ] == '\t' ) ) + { + /* don't copy trailing whitespace */ + len--; + } + strncpy( descBuf, desc, len ); + descBuf[ len ] = 0; + printf( " Desc: \"%s\"\n", descBuf ); + } + } +#endif /* PCAPIF_LIB_QUIET */ + + /* invalid adapter index -> check this after printing the adapters */ + if( adapter_num < 0 ) + { + printf( "Invalid adapter_num: %d\n", adapter_num ); + free( pa ); + pcap_freealldevs( alldevs ); + return NULL; + } + /* adapter index out of range */ + if( adapter_num >= number_of_adapters ) + { + printf( "Invalid adapter_num: %d\n", adapter_num ); + free( pa ); + pcap_freealldevs( alldevs ); + return NULL; + } +#ifndef PCAPIF_LIB_QUIET + printf( "Using adapter_num: %d\n", adapter_num ); +#endif /* PCAPIF_LIB_QUIET */ + /* set up the selected adapter */ + + LWIP_ASSERT( "used_adapter != NULL", used_adapter != NULL ); + + /* Open the device */ + pa->adapter = pcap_open_live( used_adapter->name,/* name of the device */ + 65536, /* portion of the packet to capture */ + /* 65536 guarantees that the whole packet will be captured on all the link layers */ + PCAP_OPENFLAG_PROMISCUOUS,/* promiscuous mode */ +#if PCAPIF_RX_USE_THREAD + /*-*/1, /* don't wait at all for lower latency */ +#else + 1, /* wait 1 ms in ethernetif_poll */ +#endif + errbuf ); /* error buffer */ + if( pa->adapter == NULL ) + { + printf( "\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name ); + /* Free the device list */ + pcap_freealldevs( alldevs ); + free( pa ); + return NULL; + } + printf( "Using adapter: \"%s\"\n", pa->description ); + pcap_freealldevs( alldevs ); + +#if PCAPIF_HANDLE_LINKSTATE + pa->link_state = pcapifh_linkstate_init( pa->name ); + pa->last_link_event = PCAPIF_LINKEVENT_UNKNOWN; +#endif /* PCAPIF_HANDLE_LINKSTATE */ + + return pa; +} + +#if PCAPIF_HANDLE_LINKSTATE +void pcapif_check_linkstate( void *netif_ptr ) +{ + struct netif *netif = ( struct netif* )netif_ptr; + struct pcapif_private *pa = ( struct pcapif_private* )netif->state; + enum pcapifh_link_event le; + + le = pcapifh_linkstate_get( pa->link_state ); + + if( pa->last_link_event != le ) + { + pa->last_link_event = le; + switch( le ) + { + case PCAPIF_LINKEVENT_UP: { + PCAPIF_NOTIFY_LINKSTATE( netif, netif_set_link_up ); + break; + } + case PCAPIF_LINKEVENT_DOWN: { + PCAPIF_NOTIFY_LINKSTATE( netif, netif_set_link_down ); + break; + } + } + } +} +#endif /* PCAPIF_HANDLE_LINKSTATE */ + + +/** + * Close the adapter (no more packets can be sent or received) + * + * @param netif netif to shutdown + */ +void +pcapif_shutdown( struct netif *netif ) +{ + struct pcapif_private *pa = ( struct pcapif_private* )netif->state; + if( pa ) + { +#if PCAPIF_RX_USE_THREAD + pa->rx_run = 0; +#endif /* PCAPIF_RX_USE_THREAD */ + if( pa->adapter ) + { + pcap_breakloop( pa->adapter ); + pcap_close( pa->adapter ); + } +#if PCAPIF_RX_USE_THREAD + /* wait for rxthread to end */ + while( pa->rx_running ); +#endif /* PCAPIF_RX_USE_THREAD */ +#if PCAPIF_HANDLE_LINKSTATE + pcapifh_linkstate_close( pa->link_state ); +#endif /* PCAPIF_HANDLE_LINKSTATE */ + free( pa ); + } +} + +#if PCAPIF_RX_USE_THREAD +/** RX running in its own thread */ +static void pcapif_input_thread( void *arg ) +{ + struct netif *netif = ( struct netif * )arg; + struct pcapif_private *pa = ( struct pcapif_private* )netif->state; + do + { + struct pcap_pkthdr pkt_header; + const u_char *packet = pcap_next( pa->adapter, &pkt_header ); + if( packet != NULL ) + { + pcapif_input( ( u_char* )pa, &pkt_header, packet ); + } + } while( pa->rx_run ); + pa->rx_running = 0; +} +#endif /* PCAPIF_RX_USE_THREAD */ + +/** Low-level initialization: find the correct adapter and initialize it. + */ +static err_t pcapif_low_level_init( struct netif *netif ) +{ + int adapter_num; + const char* adapterGuid; + struct pcapif_private *pa; + + /* If 'state' is != NULL at this point, we assume it is an 'const char*' giving + the GUID of the adapter to use. This can be used to instantiate multiple PCAP drivers. */ + adapterGuid = (const char*) netif->state; + if( adapterGuid != NULL ) + { + + adapter_num = get_adapter_index( adapterGuid ); + if( adapter_num < 0 ) + { + printf( "WARNING: could not find network adapter with GUID \"%s\"!\n", adapterGuid ); + return ERR_ARG; + } + } + else + { + printf( "ERROR no network adapter GUID was specified \"%s\"!\n" ); + LWIP_ASSERT( "ERROR initializing network adapter!\n", 0 ); + return ERR_ARG; + } + /* Do whatever else is needed to initialize interface. */ + pa = pcapif_init_adapter( adapter_num, netif ); + if( pa == NULL ) + { + printf( "ERROR initializing network adapter %d!\n", adapter_num ); + LWIP_ASSERT( "ERROR initializing network adapter!", 0 ); + return ERR_IF; + } + netif->state = pa; + + /* get the initial link state of the selected interface */ +#if PCAPIF_HANDLE_LINKSTATE + pa->last_link_event = pcapifh_linkstate_get( pa->link_state ); + if( pa->last_link_event == PCAPIF_LINKEVENT_DOWN ) + { + netif_set_link_down( netif ); + } + else + { + netif_set_link_up( netif ); + } + sys_periodic_timeout( PCAPIF_LINKCHECK_INTERVAL_MS, pcapif_check_linkstate, netif ); +#endif /* PCAPIF_HANDLE_LINKSTATE */ + +#if PCAPIF_RX_USE_THREAD + pa->rx_run = 1; + pa->rx_running = 1; + sys_thread_new( "pcapif_rxthread", pcapif_input_thread, netif, 0, 0 ); +#endif + + LWIP_DEBUGF( NETIF_DEBUG, ( "pcapif: eth_addr %02X%02X%02X%02X%02X%02X\n", netif->hwaddr[ 0 ], netif->hwaddr[ 1 ], netif->hwaddr[ 2 ], netif->hwaddr[ 3 ], netif->hwaddr[ 4 ], netif->hwaddr[ 5 ] ) ); + return ERR_OK; +} + +/** low_level_output(): + * Transmit a packet. The packet is contained in the pbuf that is passed to + * the function. This pbuf might be chained. + */ +static err_t pcapif_low_level_output( struct netif *netif, struct pbuf *p ) +{ + struct pbuf *q; + unsigned char buffer[ 1520 ]; + unsigned char *buf = buffer; + unsigned char *ptr; + struct eth_hdr *ethhdr; + u16_t tot_len = p->tot_len - ETH_PAD_SIZE; + struct pcapif_private *pa = ( struct pcapif_private* )netif->state; + +#if defined(LWIP_DEBUG) && LWIP_NETIF_TX_SINGLE_PBUF + LWIP_ASSERT("p->next == NULL && p->len == p->tot_len", p->next == NULL && p->len == p->tot_len); +#endif + + /* initiate transfer */ + if( p->len == p->tot_len ) + { + /* no pbuf chain, don't have to copy -> faster */ + buf = &( ( unsigned char* )p->payload )[ ETH_PAD_SIZE ]; + } + else + { + /* pbuf chain, copy into contiguous buffer */ + if( p->tot_len >= sizeof( buffer ) ) + { + LINK_STATS_INC( link.lenerr ); + LINK_STATS_INC( link.drop ); + snmp_inc_ifoutdiscards( netif ); + return ERR_BUF; + } + ptr = buffer; + for( q = p; q != NULL; q = q->next ) + { + /* Send the data from the pbuf to the interface, one pbuf at a + time. The size of the data in each pbuf is kept in the ->len + variable. */ + /* send data from(q->payload, q->len); */ + LWIP_DEBUGF( NETIF_DEBUG, ( "netif: send ptr %p q->payload %p q->len %i q->next %p\n", ptr, q->payload, ( int )q->len, ( void* )q->next ) ); + if( q == p ) + { + memcpy( ptr, &( ( char* )q->payload )[ ETH_PAD_SIZE ], q->len - ETH_PAD_SIZE ); + ptr += q->len - ETH_PAD_SIZE; + } + else + { + memcpy( ptr, q->payload, q->len ); + ptr += q->len; + } + } + } + + /* signal that packet should be sent */ + if( pcap_sendpacket( pa->adapter, buf, tot_len ) < 0 ) + { + LINK_STATS_INC( link.memerr ); + LINK_STATS_INC( link.drop ); + snmp_inc_ifoutdiscards( netif ); + return ERR_BUF; + } + + LINK_STATS_INC( link.xmit ); + snmp_add_ifoutoctets( netif, tot_len ); + ethhdr = ( struct eth_hdr * )p->payload; + if( ( ethhdr->dest.addr[ 0 ] & 1 ) != 0 ) + { + /* broadcast or multicast packet*/ + snmp_inc_ifoutnucastpkts( netif ); + } + else + { + /* unicast packet */ + snmp_inc_ifoutucastpkts( netif ); + } + return ERR_OK; +} + +/** low_level_input(): Allocate a pbuf and transfer the bytes of the incoming + * packet from the interface into the pbuf. + */ +static struct pbuf* pcapif_low_level_input( struct netif *netif, const void *packet, int packet_len ) +{ + struct pbuf *p, *q; + int start; + int length = packet_len; + struct eth_addr *dest = ( struct eth_addr* )packet; + struct eth_addr *src = dest + 1; + int unicast; + const u8_t bcast[ ] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + const u8_t ipv4mcast[ ] = { 0x01, 0x00, 0x5e }; + const u8_t ipv6mcast[ ] = { 0x33, 0x33 }; + + /* Don't let feedback packets through (limitation in winpcap?) */ + if( !memcmp( src, netif->hwaddr, ETHARP_HWADDR_LEN ) ) + { + /* don't update counters here! */ + return NULL; + } + + /* MAC filter: only let my MAC or non-unicast through (pcap receives loopback traffic, too) */ + unicast = ( ( dest->addr[ 0 ] & 0x01 ) == 0 ); + if( memcmp( dest, &netif->hwaddr, ETHARP_HWADDR_LEN ) + && ( memcmp( dest, ipv4mcast, 3 ) + || ( ( dest->addr[ 3 ] & 0x80 ) != 0 ) + ) + && memcmp( dest, ipv6mcast, 2 ) + && memcmp( dest, bcast, 6 ) + ) + { + /* don't update counters here! */ + return NULL; + } + + /* We allocate a pbuf chain of pbufs from the pool. */ + p = pbuf_alloc( PBUF_RAW, ( u16_t )length + ETH_PAD_SIZE, PBUF_POOL ); + LWIP_DEBUGF( NETIF_DEBUG, ( "netif: recv length %i p->tot_len %i\n", length, ( int )p->tot_len ) ); + + if( p != NULL ) + { + /* We iterate over the pbuf chain until we have read the entire + packet into the pbuf. */ + start = 0; + for( q = p; q != NULL; q = q->next ) + { + u16_t copy_len = q->len; + /* Read enough bytes to fill this pbuf in the chain. The + available data in the pbuf is given by the q->len + variable. */ + /* read data into(q->payload, q->len); */ + LWIP_DEBUGF( NETIF_DEBUG, ( "netif: recv start %i length %i q->payload %p q->len %i q->next %p\n", start, length, q->payload, ( int )q->len, ( void* )q->next ) ); + if( q == p ) + { +#if ETH_PAD_SIZE + LWIP_ASSERT("q->len >= ETH_PAD_SIZE", q->len >= ETH_PAD_SIZE); + copy_len -= ETH_PAD_SIZE; +#endif /* ETH_PAD_SIZE*/ + memcpy( &( ( char* )q->payload )[ ETH_PAD_SIZE ], &( ( char* )packet )[ start ], copy_len ); + } + else + { + memcpy( q->payload, &( ( char* )packet )[ start ], copy_len ); + } + start += copy_len; + length -= copy_len; + if( length <= 0 ) + { + break; + } + } + LINK_STATS_INC( link.recv ); + snmp_add_ifinoctets( netif, p->tot_len ); + if( unicast ) + { + snmp_inc_ifinucastpkts( netif ); + } + else + { + snmp_inc_ifinnucastpkts( netif ); + } + } + else + { + /* drop packet(); */ + LINK_STATS_INC( link.memerr ); + LINK_STATS_INC( link.drop ); + } + + return p; +} + +/** pcapif_input: This function is called when a packet is ready to be read + * from the interface. It uses the function low_level_input() that should + * handle the actual reception of bytes from the network interface. + */ +static void pcapif_input( u_char *user, const struct pcap_pkthdr *pkt_header, const u_char *packet ) +{ + struct pcapif_private *pa = ( struct pcapif_private* )user; + int packet_len = pkt_header->caplen; + struct netif *netif = ( struct netif * )pa->input_fn_arg; + struct pbuf *p; + + /* move received packet into a new pbuf */ + p = pcapif_low_level_input( netif, packet, packet_len ); + /* no packet could be read, silently ignore this */ + if( p != NULL ) + { + /* pass all packets to ethernet_input, which decides what packets it supports */ + if( netif->input( p, netif ) != ERR_OK ) + { + LWIP_DEBUGF( NETIF_DEBUG, ( "ethernetif_input: IP input error\n" ) ); + pbuf_free( p ); + } + } +} + +/** + * pcapif_init(): initialization function, pass to netif_add(). + */ +err_t pcapif_init( struct netif *netif ) +{ + static int ethernetif_index; + + int local_index; + SYS_ARCH_DECL_PROTECT( lev ); + SYS_ARCH_PROTECT( lev ); + local_index = ethernetif_index++; + SYS_ARCH_UNPROTECT( lev ); + + netif->name[ 0 ] = IFNAME0; + netif->name[ 1 ] = ( char )( IFNAME1 + local_index ); + netif->linkoutput = pcapif_low_level_output; +#if LWIP_ARP + netif->output = etharp_output; +#else /* LWIP_ARP */ + netif->output = NULL; /* not used for PPPoE */ +#endif /* LWIP_ARP */ +#if LWIP_NETIF_HOSTNAME + /* Initialize interface hostname */ + netif_set_hostname(netif, "lwip"); +#endif /* LWIP_NETIF_HOSTNAME */ + + netif->mtu = 1500; + netif->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_IGMP; + netif->hwaddr_len = ETHARP_HWADDR_LEN; + + NETIF_INIT_SNMP( netif, snmp_ifType_ethernet_csmacd, 100000000 ); + + /* sets link up or down based on current status */ + return pcapif_low_level_init( netif ); +} + +#if !PCAPIF_RX_USE_THREAD +void pcapif_poll(struct netif *netif) +{ + struct pcapif_private *pa = (struct pcapif_private*)netif->state; + + int ret; + do + { + ret = pcap_dispatch(pa->adapter, -1, pcapif_input, (u_char*)pa); + } while(ret > 0); + +} +#endif /* !PCAPIF_RX_USE_THREAD */ + +#endif /* LWIP_ETHERNET */ diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif.h b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif.h new file mode 100644 index 000000000..736fbc8e3 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif.h @@ -0,0 +1,24 @@ +#ifndef __PCAPIF_H__ +#define __PCAPIF_H__ + +#include "lwip/err.h" + +/** Set to 1 to let rx use an own thread (only for NO_SYS==0). + * If set to 0, ethernetif_poll is used to poll for packets. + */ +#ifndef PCAPIF_RX_USE_THREAD +#define PCAPIF_RX_USE_THREAD !NO_SYS +#endif +#if PCAPIF_RX_USE_THREAD && NO_SYS +#error "Can't create a dedicated RX thread with NO_SYS==1" +#endif + +struct netif; + +err_t pcapif_init (struct netif *netif); +void pcapif_shutdown(struct netif *netif); +#if !PCAPIF_RX_USE_THREAD +void pcapif_poll (struct netif *netif); +#endif /* !PCAPIF_RX_USE_THREAD */ + +#endif diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif_helper.c b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif_helper.c new file mode 100644 index 000000000..edfc8ffe0 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif_helper.c @@ -0,0 +1,115 @@ +/** + * pcapif_helper.c - This file is part of lwIP pcapif and provides helper functions + * for managing the link state. + */ + +#include "pcapif_helper.h" + + +#include +#include + +#ifdef WIN32 + +#ifdef _MSC_VER +#pragma warning (disable: 4201) /* don't warn about union without name */ +#endif /* _MSC_VER */ + +#define WIN32_LEAN_AND_MEAN + +#include +#include +#include + +struct pcapifh_linkstate +{ + LPADAPTER lpAdapter; + PPACKET_OID_DATA ppacket_oid_data; +}; + +struct pcapifh_linkstate* pcapifh_linkstate_init( const char *adapter_name ) +{ + struct pcapifh_linkstate* state = ( struct pcapifh_linkstate* )malloc( sizeof( struct pcapifh_linkstate ) ); + if( state != NULL ) + { + memset( state, 0, sizeof( struct pcapifh_linkstate ) ); + state->ppacket_oid_data = ( PPACKET_OID_DATA )malloc( sizeof( PACKET_OID_DATA ) + sizeof( NDIS_MEDIA_STATE ) ); + if( state->ppacket_oid_data == NULL ) + { + free( state ); + state = NULL; + } + else + { + state->lpAdapter = PacketOpenAdapter( ( char* )adapter_name ); + if( ( state->lpAdapter == NULL ) || ( state->lpAdapter->hFile == INVALID_HANDLE_VALUE ) ) + { + /* failed to open adapter */ + free( state ); + state = NULL; + } + } + } + return state; +} + +enum pcapifh_link_event pcapifh_linkstate_get( struct pcapifh_linkstate* state ) +{ + enum pcapifh_link_event ret = PCAPIF_LINKEVENT_UNKNOWN; + if( state != NULL ) + { + state->ppacket_oid_data->Oid = OID_GEN_MEDIA_CONNECT_STATUS; + state->ppacket_oid_data->Length = sizeof( NDIS_MEDIA_STATE ); + if( PacketRequest( state->lpAdapter, FALSE, state->ppacket_oid_data ) ) + { + NDIS_MEDIA_STATE fNdisMediaState; + fNdisMediaState = ( *( ( PNDIS_MEDIA_STATE )( state->ppacket_oid_data->Data ) ) ); + ret = ( ( fNdisMediaState == NdisMediaStateConnected ) ? PCAPIF_LINKEVENT_UP : PCAPIF_LINKEVENT_DOWN ); + } + } + return ret; +} + +void pcapifh_linkstate_close( struct pcapifh_linkstate* state ) +{ + if( state != NULL ) + { + if( state->lpAdapter != NULL ) + { + PacketCloseAdapter( state->lpAdapter ); + } + if( state->ppacket_oid_data != NULL ) + { + free( state->ppacket_oid_data ); + } + free( state ); + } +} + +#else /* WIN32 */ + +/* @todo: add linux/unix implementation? */ + +struct pcapifh_linkstate { + u8_t empty; +}; + +struct pcapifh_linkstate* pcapifh_linkstate_init(const char *adapter_name) +{ + LWIP_UNUSED_ARG(adapter_name); + return NULL; +} + +enum pcapifh_link_event pcapifh_linkstate_get(struct pcapifh_linkstate* state) +{ + LWIP_UNUSED_ARG(state); + LWIP_ASSERT("not implemented", 0); + return LINKEVENT_UNKNOWN; +} +void pcapifh_linkstate_close(struct pcapifh_linkstate* state) +{ + LWIP_UNUSED_ARG(state); + LWIP_ASSERT("not implemented", 0); +} + +#endif /* WIN32 */ \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif_helper.h b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif_helper.h new file mode 100644 index 000000000..9fc69ffe7 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/WinPcap_Eth/pcapif_helper.h @@ -0,0 +1,18 @@ +#ifndef __PCAPIF_HELPER_H__ +#define __PCAPIF_HELPER_H__ + + +struct pcapifh_linkstate; + +enum pcapifh_link_event { + PCAPIF_LINKEVENT_UNKNOWN, + PCAPIF_LINKEVENT_UP, + PCAPIF_LINKEVENT_DOWN +}; + +struct pcapifh_linkstate* pcapifh_linkstate_init(const char *adapter_name); +enum pcapifh_link_event pcapifh_linkstate_get(struct pcapifh_linkstate* state); +void pcapifh_linkstate_close(struct pcapifh_linkstate* state); + + +#endif /* __PCAPIF_HELPER_H__ */ \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/DeviceCode/dotnetmf.proj b/DeviceCode/Targets/OS/Win32/DeviceCode/dotnetmf.proj new file mode 100644 index 000000000..1c8ebbf38 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/DeviceCode/dotnetmf.proj @@ -0,0 +1,11 @@ + + + Solutions\Windows + $(SPOCLIENT)\Solutions\Windows\Windows.settings + + + + + + + diff --git a/DeviceCode/Targets/OS/Win32/EnumFlags.h b/DeviceCode/Targets/OS/Win32/EnumFlags.h new file mode 100644 index 000000000..51ff3041a --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/EnumFlags.h @@ -0,0 +1,29 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#pragma once + +#include + +// Use "old school template" as doing this in real templates is just a major PITA or unreadable gunk. +#define ENUM_FLAGS( t )\ +inline t operator|( t a, t b )\ +{\ + return static_cast< t >( static_cast< std::underlying_type< t >::type>( a ) | static_cast< std::underlying_type< t >::type>( b ) );\ +}\ +inline t& operator|=( t& a, t b )\ +{\ + a = static_cast< t >( static_cast< std::underlying_type< t >::type>( a ) | static_cast< std::underlying_type< t >::type>( b ) );\ + return a;\ +} diff --git a/DeviceCode/Targets/OS/Win32/NamedPipe.h b/DeviceCode/Targets/OS/Win32/NamedPipe.h new file mode 100644 index 000000000..929f88915 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/NamedPipe.h @@ -0,0 +1,114 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include "EnumFlags.h" +#include "Win32FileIo.h" + +namespace Microsoft +{ + namespace Win32 + { + enum class PipeAccessMode : uint32_t + { + Duplex = PIPE_ACCESS_DUPLEX, + Inbound = PIPE_ACCESS_INBOUND, + Outbound = PIPE_ACCESS_OUTBOUND, + FirstPipeInstance = FILE_FLAG_FIRST_PIPE_INSTANCE, + WriteThrough = FILE_FLAG_WRITE_THROUGH, + Overlapped = FILE_FLAG_OVERLAPPED, + WriteDAC = WRITE_DAC, + WriteOwner = WRITE_OWNER, + AccessSystemSecurity = ACCESS_SYSTEM_SECURITY + }; + ENUM_FLAGS( PipeAccessMode ) + + enum class PipeMode : uint32_t + { + WriteStream = PIPE_TYPE_BYTE, + WriteMessage = PIPE_TYPE_MESSAGE, + ReadStream = PIPE_READMODE_BYTE, + ReadMessage = PIPE_READMODE_MESSAGE, + Wait = PIPE_WAIT, + NoWait = PIPE_NOWAIT, + AcceptRemoteClients = PIPE_ACCEPT_REMOTE_CLIENTS, + RejectRemoteClients = PIPE_REJECT_REMOTE_CLIENTS + }; + ENUM_FLAGS( PipeMode ) + + class NamedPipe : public Win32FileHandle + { + public: + NamedPipe() + { + } + + bool Create( wchar_t const* name + , PipeAccessMode accessMode = PipeAccessMode::Duplex | PipeAccessMode::FirstPipeInstance + , PipeMode pipeMode = PipeMode::ReadStream | PipeMode::WriteStream | PipeMode::RejectRemoteClients | PipeMode::Wait + , uint32_t maxInstances = 1 + , uint32_t outbufferSize = 4096 + , uint32_t inbufferSize = 4096 + , uint32_t defaultTimeout = 0 + , SECURITY_ATTRIBUTES* pSecAttrib = nullptr + ) + { + Name = name; + auto hPipe = ::CreateNamedPipe( Name.c_str() + , (uint32_t)accessMode + , (uint32_t)pipeMode + , maxInstances + , outbufferSize + , inbufferSize + , defaultTimeout + , pSecAttrib + ); + InternalAssign( hPipe ); + return IsValid(); + } + + bool Connect(OVERLAPPED* pOverlapped = nullptr ) + { + return !!::ConnectNamedPipe( operator HANDLE(), pOverlapped); + } + + bool Open( wchar_t const* name, uint32_t timeout = NMPWAIT_WAIT_FOREVER ) + { + Name = name; + if( !::WaitNamedPipe( Name.c_str(), timeout ) ) + return false; + + auto hPipe = ::CreateFile( Name.c_str() + , GENERIC_READ | GENERIC_WRITE + , 0 // no sharing + , nullptr + , OPEN_EXISTING + , FILE_ATTRIBUTE_NORMAL + , nullptr + ); + InternalAssign( hPipe ); + return IsValid(); + } + + static const std::wstring LocalPipeNamePrefix; + + private: + std::wstring Name; + }; + + const std::wstring NamedPipe::LocalPipeNamePrefix = LR"(\\.\pipe\)"; + } +} \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/OutputDebugStream.h b/DeviceCode/Targets/OS/Win32/OutputDebugStream.h new file mode 100644 index 000000000..405700d43 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/OutputDebugStream.h @@ -0,0 +1,95 @@ +#pragma once +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Description: +// Provides generalized C++ output stream for ::OutputDebugString() +// that will conditionally compile to a NOP in release builds + +#include +#include + +namespace Microsoft +{ + namespace Win32 + { +#ifdef DEBUG + //////////////////////////////////////////////////// + // Description: + // C++ stream buffer for Win32 OutputDebugString() + // + class OutputDebugStreamBuffer + : public std::wstringbuf + { + public: + OutputDebugStreamBuffer() + : std::wstringbuf( std::ios_base::out ) + { + } + + protected: + virtual int sync() override + { + ::OutputDebugString( std::wstringbuf::str().c_str() ); + str(L""); + return 0; + } + }; + + /////////////////////////////////////////////////////////////// + // Description: + // C++ stream class for Win32 OutputDebugString() + // + class OutputDebugStream : public std::wostream + { + OutputDebugStreamBuffer Buf; + + public: + OutputDebugStream() + : std::wostream(&Buf, false) + { + clear(); + } + }; +#else + ////////////////////////////////////////////////////////// + // Description: + // NOP stream for debug information in a release build + // + // Remarks: + // The compiler is smart enough to completely eliminate + // any use of "instances" of this stream so it is safe + // to use in retail builds + class OutputDebugStream + { + public: + // eat simple manipulators, beats std:operator<< in lookups to resolve to a NOP + OutputDebugStream& operator<<(std::wostream& (__cdecl *_Pfn)(std::wostream&)) + { + return *this; + } + + // ignore all data types + template + OutputDebugStream& operator<<(T val) + { + return *this; /* NOP */ + } + }; + +#endif + extern OutputDebugStream cdbg; + } +} + diff --git a/DeviceCode/Targets/OS/Win32/Win32.settings b/DeviceCode/Targets/OS/Win32/Win32.settings new file mode 100644 index 000000000..6c07f197a --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32.settings @@ -0,0 +1,40 @@ + + + Win32 + + x86 + {92CE1849-DBE0-4393-9717-E7054B21E644} + + + Windows Win32 support + $(SPOCLIENT)\devicecode\Targets\OS\Win32\Win32.settings + x86 + + + x86 + x86 + Win32 + OS + false + + + + + + + + + + + + + + + + diff --git a/DeviceCode/Targets/OS/Win32/Win32FileIo.h b/DeviceCode/Targets/OS/Win32/Win32FileIo.h new file mode 100644 index 000000000..0c9cb58a4 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32FileIo.h @@ -0,0 +1,85 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include "EnumFlags.h" +#include "Win32Handles.h" + +namespace Microsoft +{ + namespace Win32 + { + // file flags enumeration for file HANDLES + enum class FileFlags : uint32_t + { + FirstPipeInstance = FILE_FLAG_FIRST_PIPE_INSTANCE, + WriteThrough = FILE_FLAG_WRITE_THROUGH, + Overlapped = FILE_FLAG_OVERLAPPED, + }; + ENUM_FLAGS( FileFlags ) + + // class to contain Win32 File HANDLE + class Win32FileHandle + : public Win32Handle< HANDLE, StdNullInvalidHandleTraits> + { + public: + using Win32Handle< HANDLE, StdNullInvalidHandleTraits >::operator=; + + bool GetOverlappedResult( OVERLAPPED* pOverlapped, _Out_ uint32_t& numberOfBytes, bool wait = true) + { + return !!::GetOverlappedResult( operator HANDLE() + , pOverlapped + , reinterpret_cast(&numberOfBytes) + , wait ? TRUE : FALSE + ); + } + + bool Write( _In_reads_bytes_(bufferLen) const void* pBuffer + , uint32_t bufferLen + , _Out_opt_ uint32_t* pNumberOfBytesWritten = nullptr + , _Inout_opt_ OVERLAPPED* pOverlapped = nullptr + ) + { + return !!::WriteFile( operator HANDLE() + , pBuffer + , bufferLen + , reinterpret_cast(pNumberOfBytesWritten) + , pOverlapped + ); + } + + bool Read( _Out_writes_bytes_(bufferLen) void* pBuffer + , uint32_t bufferLen + , _Out_opt_ uint32_t* pNumberOfBytesRead = nullptr + , _Inout_opt_ OVERLAPPED* pOverlapped = nullptr + ) + { + return !!::ReadFile( operator HANDLE() + , pBuffer + , bufferLen + , reinterpret_cast( pNumberOfBytesRead ) + , pOverlapped + ); + } + + bool Flush() + { + return !!::FlushFileBuffers( operator HANDLE() ); + } + }; + } +} diff --git a/DeviceCode/Targets/OS/Win32/Win32Handles.h b/DeviceCode/Targets/OS/Win32/Win32Handles.h new file mode 100644 index 000000000..b404848e1 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32Handles.h @@ -0,0 +1,121 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#include + +namespace Microsoft +{ + namespace Win32 + { + // template class to manage Win32 handles in RAII pattern implementations + // Type Params: + // Handle_t - actual type for the HANDLE + // HandleTraits - traits template containing methods for + // manipulating handles of type Handle_t + // + template + class Win32Handle + { + public: + + Win32Handle( Handle_t handle = HandleTraits::DefaultInvalidValue() ) + : Handle( handle ) + { + } + + ~Win32Handle() + { + Close(); + } + + // copy, assign and move not supported + // perhaps they can use DuplicateHandle + // but that's not supported by all handle + // types so would need support from the + // traits + Win32Handle( const Win32Handle& ) = delete; + Win32Handle& operator=( const Win32Handle&) = delete; + + Win32Handle& operator=( HANDLE other ) + { + InternalAssign( other ); + return *this; + } + + bool IsValid() + { + return HandleTraits::ValidateHandle( Handle ); + } + + bool Close() + { + return InternalAssign( HandleTraits::DefaultInvalidValue() ); + } + + explicit operator Handle_t() + { + return Handle; + } + + protected: + bool InternalAssign(Handle_t handle) + { + auto oldHandle = Handle.exchange( handle ); + if( !HandleTraits::ValidateHandle( oldHandle) ) + return true; + + return HandleTraits::ReleaseHandle( oldHandle ); + } + + private: + std::atomic Handle; + }; + + template + inline bool ValidateHandle( Handle_t h ) + { + return h != (Handle_t)INVALID_HANDLE_VALUE; + } + + template + inline bool ValidateHandleNotNull( Handle_t h ) + { + return h != nullptr; + } + + template + inline bool ValidateHandleNotNullOrInvalid( Handle_t h ) + { + return ValidateHandleNotNull( h ) && ValidateHandle( h ); + } + + struct StdNullInvalidHandleTraits + { + static bool ReleaseHandle( HANDLE h ) + { + return !!CloseHandle( h ); + } + + static bool ValidateHandle( HANDLE h ) + { + return ValidateHandleNotNullOrInvalid( h ); + } + + static HANDLE DefaultInvalidValue() + { + return INVALID_HANDLE_VALUE; + } + }; + } +} \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/Win32Settings.h b/DeviceCode/Targets/OS/Win32/Win32Settings.h new file mode 100644 index 000000000..3ffa48e1f --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32Settings.h @@ -0,0 +1,114 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#pragma once +#include +#include + +namespace Microsoft +{ + namespace Win32 + { + struct Command_Call + : CLR_RT_ParseOptions::Command + { + typedef std::function< HRESULT( CLR_RT_ParseOptions::ParameterList* params )> HandlerFunc_t; + + Command_Call( HandlerFunc_t handler, LPCWSTR szName, LPCWSTR szDescription ) + : CLR_RT_ParseOptions::Command( szName, szDescription ) + , Handler( handler ) + { + } + + virtual HRESULT Execute( ) override + { + return Handler( &m_params ); + } + + HandlerFunc_t Handler; + }; + + struct Win32Settings + : CLR_RT_ParseOptions + { + CLR_RT_ParseOptions::BufferMap m_assemblies; + + int m_idxDatBufferIndex; + bool m_fWaitForDebugger; + bool m_fPerformGarbageCollection; + bool m_fPerformHeapCompaction; + bool m_fNoExecuteIL; + bool m_fWaitOnExit; + bool m_fNoNetwork; + + std::wstring m_szCommandLineArgs; + + Win32Settings( ); + ~Win32Settings( ); + + public: + HRESULT ParseCmdLineOptions( int argc, wchar_t const* argv[ ] ); + HRESULT ProcessCommandLineSettings( ); + + private: + HRESULT LoadAssemblies( ); + HRESULT ExtractOptionsFromFile( LPCWSTR szFileName ); + + HRESULT CheckAssemblyFormat( CLR_RECORD_ASSEMBLY* header, LPCWSTR src ); + + HRESULT Execute( ); + + HRESULT Cmd_Cfg( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + HRESULT Cmd_Load( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + HRESULT Cmd_LoadDatabase( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + HRESULT Cmd_Resolve( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + HRESULT Cmd_Execute( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + HRESULT Cmd_CommandLineArgs( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + HRESULT Cmd_ListNICs( CLR_RT_ParseOptions::ParameterList* params = NULL ); + HRESULT Set_NicGuid( CLR_RT_ParseOptions::ParameterList* params = NULL ); + HRESULT Set_NicMAC( CLR_RT_ParseOptions::ParameterList* params = NULL ); + HRESULT Cmd_EraseFlash( CLR_RT_ParseOptions::ParameterList* params = NULL ); + + void Usage( ); + + void BuildOptions( ); + + HRESULT LoadDataBase( std::wstring path ); + HRESULT LoadAssembly( std::wstring path ); + + static HRESULT LoadAssembly( CLR_RECORD_ASSEMBLY* header, CLR_RT_Assembly*& assm, LPCWSTR szName ); + + std::wstring get_NicGuid( ) + { + return NicGuid; + } + + private: + std::list AssemblyPaths; + std::list DatPaths; + std::wstring NicGuid; + bool EraseFlash; + std::list> PostParseProcessCommands; + std::wstring MacAddress; + std::wsmatch MacAddressParseResults; + }; + } +} \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/Win32SlimLock.h b/DeviceCode/Targets/OS/Win32/Win32SlimLock.h new file mode 100644 index 000000000..c19c79852 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32SlimLock.h @@ -0,0 +1,220 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +namespace Microsoft +{ + namespace Win32 + { + // Behavioral traits style template for lock objects + // supporting shared and exclusive access. This is + // specialized for lock objects that don't meet + // the defaults. + // + // Essentially this maps a well known API onto whatever calls + // are needed for a particular lock type to achieve the intended + // behavior. This prevents the need to further specialize other + // templates for each type of lock object like the scoped locking + // templates SharedLock or ExclusiveLock. + template + struct LockBehaviors + { + // exclusive (R/W) lock + static void LockExclusive( Lock_t& lock) { lock.LockExclusive(); } + static void UnlockExclusive( Lock_t& lock) { lock.UnlockExclusive(); } + + // Share lock (multiple shared lock allowed, blocks and blocked by exclusive) + static void LockShared( Lock_t& lock) { lock.LockShared(); } + static void UnlockShared( Lock_t& lock) { lock.UnlockShared(); } + }; + + // specialization for a raw standard SRWLOCK + template<> + struct LockBehaviors + { + static void LockExclusive( SRWLOCK& lock) { ::AcquireSRWLockExclusive( &lock ); } + static void UnlockExclusive( SRWLOCK& lock) { ::ReleaseSRWLockExclusive( &lock ); } + + static void LockShared( SRWLOCK& lock) { ::AcquireSRWLockShared( &lock ); } + static void UnlockShared( SRWLOCK& lock) { ::ReleaseSRWLockShared( &lock ); } + }; + + // specialization for a raw CS + template<> + struct LockBehaviors + { + static void LockExclusive( CRITICAL_SECTION& lock) { EnterCriticalSection( &lock) ; } + static void UnlockExclusive( CRITICAL_SECTION& lock) { LeaveCriticalSection( &lock ); } + + // CS cannot be locked for share mode, these are deliberately undefined + // any attempts use the CS in a manner that resolves to a shared lock + // will generate a compile time error + //static void LockShared( Lock_t& lock); + //static void UnlockShared( Lock_t& lock); + }; + + // Wrapper for an SRWLOCK with support for nesting + // SRWLOCK isn't re-entrant, if a thread requesting exclusive + // access currently has the lock while another thread also + // waiting for exclusive access a deadlock will occur. To + // resolve this case this class uses a lock ref count to + // manage the recursion on a given thread and tracks the id + // of the owning thread. + class SlimReadWriteLock + { + public: + SlimReadWriteLock() + : m_ExLockCount( 0 ) + , m_ExOwner( NoOwnerId ) + { + InitializeSRWLock( &m_SrwLock ); + } + + void LockExclusive() + { + if( OnExOwnerThread() ) + ++m_ExLockCount; + else + { + LockBehaviors::LockExclusive( m_SrwLock ); + SetOwnerThread(); + } + } + + void UnlockExclusive() + { + _ASSERT( OnExOwnerThread() ); + if( --m_ExLockCount == 0 ) + { + m_ExOwner = NoOwnerId; + LockBehaviors::UnlockExclusive( m_SrwLock ); + } + } + + // shared access locking methods + void LockShared() + { + _ASSERT( !OnExOwnerThread() ); + LockBehaviors::LockShared( m_SrwLock ); + } + + void UnlockShared() + { + _ASSERT( !OnExOwnerThread() ); + LockBehaviors::UnlockShared( m_SrwLock ); + } + + DWORD WaitShared( ConditionVariable& cv, DWORD timeout = INFINITE ) + { + _ASSERT( !OnExOwnerThread() ); + return LockBehaviors::WaitShared( m_SrwLock, cv, timeout ); + } + + DWORD WaitExclusive( ConditionVariable& cv, DWORD timeout = INFINITE ) + { + _ASSERT( OnExOwnerThread() ); + return LockBehaviors::WaitExclusive( m_SrwLock, cv, timeout ); + } + + private: + // test if current thread is the Exclusive owner of the lock + bool OnExOwnerThread() + { + return ( m_ExOwner == ::GetCurrentThreadId() ) && ( m_ExLockCount > 0 ); + } + + void SetOwnerThread() + { + _ASSERT( m_ExLockCount == 0 && NoOwnerId == m_ExOwner ); + m_ExOwner = ::GetCurrentThreadId(); + m_ExLockCount = 1; + } + + int m_ExLockCount; + DWORD m_ExOwner; + SRWLOCK m_SrwLock; + + static const DWORD NoOwnerId = 0xFFFFFFFF; + }; + + ////////////////////////////////////////////////////////// + // Description: + // Scoped shared lock + // + // Parameters: + // lock_t - type of underlying lock object + // + // Constraints: + // void LockBehaviors::LockShared(void) required method + // void LockBehaviors::UnlockShared(void) required method + template + struct SharedLock + { + SharedLock( Lock_t& lockObj) + : m_LockObj( lockObj ) + { + LockBehaviors::LockShared( m_LockObj ); + } + + ~SharedLock() + { + LockBehaviors::UnlockShared( m_LockObj ); + } + + // Atomic, unlock, wait, lock + DWORD Wait( ConditionVariable& cond, DWORD timeout = INFINITE ) + { + return LockBehaviors::WaitShared( m_LockObj, cond, timeout ); + } + + private: + Lock_t& m_LockObj; + + // Private to avoid accidental use + SharedLock( const SharedLock& ) throw(); + SharedLock& operator=( const SharedLock& ) throw(); + void* operator new(size_t); + }; + + // creates a scoped exclusive lock + template + struct ExclusiveLock + { + ExclusiveLock( Lock_t& lockObj) + : m_LockObj( lockObj ) + { + LockBehaviors::LockExclusive( m_LockObj ); + } + + ~ExclusiveLock() + { + LockBehaviors::UnlockExclusive( m_LockObj ); + } + + // Atomic, unlock, wait, lock + DWORD Wait( ConditionVariable& cond, DWORD timeout = INFINITE ) + { + return LockBehaviors::WaitExclusive( m_LockObj, cond, timeout ); + } + + private: + Lock_t& m_LockObj; + + // Private to avoid accidental use + ExclusiveLock( const ExclusiveLock& ) throw(); + ExclusiveLock& operator=( const ExclusiveLock& ) throw(); + void* operator new(size_t); + }; + } +} \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/Win32TimerQueue.h b/DeviceCode/Targets/OS/Win32/Win32TimerQueue.h new file mode 100644 index 000000000..3df187e07 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32TimerQueue.h @@ -0,0 +1,188 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported. +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. +// You may obtain a copy of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing +// permissions and limitations under the License. +// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +#include +#include +#include +#include +#include "EnumFlags.h" + +namespace Microsoft +{ + namespace Win32 + { + // std swap implementation for HANDLES + inline void swap(HANDLE& a, HANDLE& b) + { + HANDLE c = a; + a = b; + b= c; + } + + enum class TimerOption + { + ExecuteDefault = WT_EXECUTEDEFAULT, + OneShot = WT_EXECUTEONLYONCE, + ExecuteOnTimerThread = WT_EXECUTEINTIMERTHREAD + }; + ENUM_FLAGS( TimerOption ); + + // class to implement timers based on Win32 TimerQueueTimers + // Win32 TimerQueue timers with WT_EXECUTEDEFAULT (the default) + // will trigger callbacks on a threadpool thread when the timer + // expires. + class Timer + { + public: + Timer( HANDLE hQueue, UINT32 initialPeriod, UINT32 period, TimerOption flags, std::function func ) + : hQueue( hQueue ) + , hTimer( NULL ) + , Callback( std::make_unique< std::function< void() > >( func ) ) + , Period( period ) + , Flags( flags | ( period == 0 ? TimerOption::OneShot : TimerOption::ExecuteDefault ) ) + { + Start(initialPeriod, period ); + } + + Timer() + : Timer( nullptr, 0, 0, TimerOption::ExecuteDefault, [](){}) + { + } + + Timer( UINT32 initialPeriod, UINT32 period, TimerOption flags, std::function func ) + : Timer( nullptr, initialPeriod, period, flags, func ) + { + } + + Timer( UINT32 initialPeriod, std::function func) + : Timer( nullptr, initialPeriod, 0, TimerOption::ExecuteDefault | TimerOption::OneShot, func ) + { + } + + Timer( TimerOption flags, std::function func ) + : Timer( nullptr, 0, 0, flags, func ) + { + } + + Timer( std::function func) + : Timer( nullptr, 0, 0, TimerOption::ExecuteDefault, func ) + { + } + + ~Timer( ) + { + Cancel(); + } + + void Cancel() + { + if( hTimer != nullptr ) + { + if( !DeleteTimerQueueTimer( hQueue, hTimer, nullptr ) ) + { + auto err = ::GetLastError(); + if( ERROR_IO_PENDING != err ) + throw std::exception( "Internal error: DeleteTimerQueueTimer() FAILED!", err); + } + } + + hTimer = nullptr; + } + + void Start( UINT32 initialPeriod, bool periodic ) + { + Start( initialPeriod, periodic ? initialPeriod : 0 ); + } + + void Start( UINT32 initialPeriod, UINT32 period = 0) + { + Cancel(); + if( !(bool)Callback ) + throw std::exception("Internal error: timer callback is empty!"); + + Period = initialPeriod; + if( initialPeriod > 0 ) + { + // period is 0 for a one-shot timer otherwise it is the period for a periodic timer + // which is normally, but not necessarily the same as initialPeriod. + if( period == 0 ) + Flags |= TimerOption::OneShot; + + // NOTE: using Callback.get() as the callback arg to avoid complications + // of tieing the OS callback to this exact instance, which would prevent + // move assign/copy etc... Using a unique pointer ensures that only one + // instance actually owns the pointer, but it can be moved around without + // impacting the actual OS callback. If "this" was used the OS would call + // the callback passing in a "this" pointer to a potentially long since + // destroyed instance (due to move assign/copy) + CreateTimerQueueTimer( &hTimer + , hQueue + , ( WAITORTIMERCALLBACK )OsTimerCallbackStub + , Callback.get() + , initialPeriod + , period + , (ULONG)Flags + ); + } + } + + void Restart() + { + Start( Period ); + } + + Timer(const Timer& ) = delete; + Timer& operator=(const Timer& ) = delete; + + // move copyable + Timer( Timer&& other) + : hQueue( nullptr ) + , hTimer( NULL ) + , Period( 0 ) + { + swap( hQueue, other.hQueue ); + swap( hTimer, other.hTimer ); + swap( std::move( Callback ), std::move( other.Callback ) ); + Period = other.Period; + Flags = other.Flags; + } + + // move assignable + Timer& operator=(Timer&& other) + { + swap( hQueue, other.hQueue ); + swap( hTimer, other.hTimer ); + swap( Callback, other.Callback ); + std::swap( Period, other.Period ); + std::swap( Flags, other.Flags); + return *this; + } + + private: + HANDLE hQueue; + std::unique_ptr< std::function > Callback; + HANDLE hTimer; + UINT32 Period; + TimerOption Flags; + + static void CALLBACK OsTimerCallbackStub( _In_ void* lpParameter, _In_ BOOLEAN TimerOrWaitFired ) + { + UNREFERENCED_PARAMETER( TimerOrWaitFired ); + auto pCallback = reinterpret_cast< std::function* >( lpParameter ); + if( (bool)( *pCallback ) ) + (*pCallback)(); + } + }; + } +} \ No newline at end of file diff --git a/DeviceCode/Targets/OS/Win32/Win32_template_selector.h b/DeviceCode/Targets/OS/Win32/Win32_template_selector.h new file mode 100644 index 000000000..6397c2675 --- /dev/null +++ b/DeviceCode/Targets/OS/Win32/Win32_template_selector.h @@ -0,0 +1,66 @@ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Copyright (c) Microsoft Corporation. All rights reserved. +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifndef _PLATFORM_