diff --git a/Application/TinyBooter/Commands.cpp b/Application/TinyBooter/Commands.cpp index 6c7bf7768..e130c73c2 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 @@ -1587,7 +1587,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 55d2c932c..da8eb7c19 100644 --- a/CLR/Core/Execution.cpp +++ b/CLR/Core/Execution.cpp @@ -3067,7 +3067,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 b247ef499..7b5314fe9 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 53a377760..5b5c48684 100644 --- a/CLR/Debugger/Debugger.cpp +++ b/CLR/Debugger/Debugger.cpp @@ -370,7 +370,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; @@ -1432,7 +1432,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 32c68a435..5251f8ac1 100644 --- a/CLR/Include/TinyCLR_PlatformDef.h +++ b/CLR/Include/TinyCLR_PlatformDef.h @@ -8,7 +8,7 @@ #include #ifdef _WIN32 -#define LITTLE_ENDIAN +#define NETMF_TARGET_LITTLE_ENDIAN #endif //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -32,7 +32,7 @@ #endif #if !defined(PLATFORM_WINDOWS_EMULATOR) && !defined(PLATFORM_WINCE) -#if !defined(LITTLE_ENDIAN) && !defined(BIG_ENDIAN) +#if !defined(NETMF_TARGET_LITTLE_ENDIAN) && !defined(NETMF_TARGET_BIG_ENDIAN) #error ENDIANNESS NOT DEFINED #endif #endif 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 c2a21eea3..93811e38e 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 b7225718a..36eab74ef 100644 --- a/CLR/Messaging/Messaging.cpp +++ b/CLR/Messaging/Messaging.cpp @@ -416,7 +416,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; @@ -531,7 +531,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 @@ -652,7 +652,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 @@ -668,7 +668,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 b64280d81..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) +#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 20ffb3f3f..42162184a 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 156be7f0b..961d5a6d6 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 977cc2cbd..436980210 100644 --- a/Support/WireProtocol/WireProtocol.cpp +++ b/Support/WireProtocol/WireProtocol.cpp @@ -57,11 +57,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 @@ -84,11 +84,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 } @@ -113,7 +113,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 ); @@ -226,7 +226,7 @@ bool WP_Message::Process() bool fBadPacket=true; if( VerifyHeader() ) { -#if defined(BIG_ENDIAN) +#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 ); @@ -320,7 +320,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 index fddc62233..0a663bf66 100644 --- a/tools/DisAsmPE/Include/UnalignedAccess.h +++ b/tools/DisAsmPE/Include/UnalignedAccess.h @@ -25,7 +25,7 @@ namespace Microsoft inline uint16_t ReadUnalignedUInt16( uint8_t const*& ip) { uint16_t retVal; - #if !defined(BIG_ENDIAN) + #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; @@ -42,7 +42,7 @@ namespace Microsoft inline uint32_t ReadUnalignedUInt32( uint8_t const*& ip) { uint32_t retVal; - #if !defined(BIG_ENDIAN) + #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; @@ -60,14 +60,14 @@ namespace Microsoft ip += sizeof(uint8_t); retVal |= (uint32_t)(*(const uint8_t *)ip); ip += sizeof(uint8_t); - #endif //BIG_ENDIAN + #endif //NETMF_TARGET_BIG_ENDIAN return retVal; } inline uint64_t ReadUnalignedUInt64( uint8_t const*& ip) { uint64_t retVal; - #if !defined(BIG_ENDIAN) + #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; @@ -101,7 +101,7 @@ namespace Microsoft ip += sizeof(uint8_t); retVal |= (uint64_t)(*(const uint8_t *)ip); ip += sizeof(uint8_t); - #endif //BIG_ENDIAN + #endif //NETMF_TARGET_BIG_ENDIAN return retVal; } diff --git a/tools/Targets/Microsoft.Spot.system.gcc.targets b/tools/Targets/Microsoft.Spot.system.gcc.targets index b5be1785d..16bb0b296 100644 --- a/tools/Targets/Microsoft.Spot.system.gcc.targets +++ b/tools/Targets/Microsoft.Spot.system.gcc.targets @@ -151,8 +151,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 5936b2436..924952a8d 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