From 82e276d69f4ca1dda7dd640d5fcfac0a429d9a64 Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Fri, 5 Aug 2016 15:31:47 +0100 Subject: [PATCH 1/5] Remove custom heap - remove all references and code related with custom heap - rework scatter files, AppEntry, FirstEntry and TinyHAL - reworked startup files to perform memory initializations - clean-up unused code --- .../EraseDeployment/EraseDeployment.cpp | 2 - Application/MicroBooter/MicroBooter.cpp | 14 +- Application/MicroBooter/SrecProcessor.cpp | 2 +- Application/TinyBooter/Commands.cpp | 48 +-- Application/TinyBooter/Commands.h | 2 +- .../TinyBooter/ConfigurationManager.cpp | 4 +- Application/TinyBooter/CryptoInterface.cpp | 2 +- Application/TinyBooter/TinyBooter.cpp | 11 - .../TinyBooter/TinyBooterDecompressor.cpp | 2 - CLR/Core/CLR_RT_HeapBlock.cpp | 8 +- CLR/Core/CLR_RT_HeapBlock_Array.cpp | 2 +- CLR/Core/CLR_RT_Memory.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 | 20 +- CLR/Graphics/Graphics.cpp | 8 +- CLR/Include/TinyCLR_Messaging.h | 2 +- CLR/Include/TinyCLR_PlatformDef.h | 4 +- CLR/Include/TinyCLR_Runtime__HeapBlock.h | 30 +- CLR/Include/TinyCLR_Types.h | 22 +- ...untime_CompilerServices_RuntimeHelpers.cpp | 4 +- ...ve_Microsoft_SPOT_Hardware_LargeBuffer.cpp | 6 +- ...Microsoft_SPOT_MFUpdate_MFNativeUpdate.cpp | 6 +- CLR/Messaging/Messaging.cpp | 8 +- CLR/Messaging/Messaging_stub.cpp | 2 +- CLR/Tools/BuildHelper/BuildHelper.cpp | 2 - .../MetaDataProcessor/MetaDataProcessor.cpp | 1 - CLR/Tools/TFConvert/TFConvert.cpp | 1 - CLR/Tools/Tools.settings | 5 - .../CortexMx/TinyHal/GNU_S/AppEntry.s | 99 +++-- .../CortexMx/TinyHal/GNU_S/FirstEntry.s | 95 ++-- .../TinyHal/GNU_S/VectorTable_Template.s | 4 +- .../Flash/AM29DL_16/AM29DL_16_driver.cpp | 8 +- .../Flash/I28F_16/I28F_16_driver.cpp | 8 +- .../Flash/SST39WF_16/SST39WF_16_driver.cpp | 8 +- .../WearLeveling/BS_WearLeveling_Driver.cpp | 9 +- DeviceCode/Drivers/FS/FAT/FAT_SectorCache.cpp | 6 +- .../Drivers/MFUpdate/MicroBooterUpdate.cpp | 4 +- .../Stubs/TempForGCC/missFunctions.cpp | 14 +- DeviceCode/Initialization/tinyhal.cpp | 407 +++--------------- .../STM32F4_Bootstrap/GNU_S/VectorTable.s | 4 +- .../STM32F4_Bootstrap/STM32F4_bootstrap.cpp | 4 +- DeviceCode/include/Sockets_decl.h | 2 +- DeviceCode/include/TinyCLR_Endian.h | 4 +- DeviceCode/include/tinyhal.h | 131 +----- DeviceCode/pal/COM/usb/usb.cpp | 4 +- .../OpenSSL/OpenSSL_1_0_0/tinyclr/ssl_types.h | 8 +- DeviceCode/pal/SimpleHeap/SimpleHeap.cpp | 298 ------------- DeviceCode/pal/SimpleHeap/dotNetMF.proj | 47 -- .../pal/SimpleHeap/stubs/SimpleHeap_stubs.cpp | 25 -- DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj | 44 -- .../SimpleHeap_config/SimpleHeap_config.cpp | 40 -- .../Stubs/SimpleHeap_config_stubs.cpp | 16 - .../pal/SimpleHeap_config/Stubs/dotNetMF.proj | 44 -- .../pal/SimpleHeap_config/dotNetMF.proj | 46 -- DeviceCode/pal/configuration/ConfigHelper.cpp | 16 +- DeviceCode/pal/dotNetMF.proj | 4 - DeviceCode/pal/fs/fs_pal.cpp | 6 +- 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/piezo/Piezo.cpp | 8 +- Framework/Features/Graphics.featureproj | 1 - .../NativeSample/NativeSample.cpp | 3 - ProjectTemplates/PortBooter/portBooter.cpp | 2 - .../PortBooter/portBooterLoader.cpp | 2 - .../DeviceCode/Initialization/tinyhal.cpp | 232 +--------- .../DeviceCode/TinyHal/GNU_S/AppEntry.s | 93 ++-- .../DeviceCode/TinyHal/GNU_S/FirstEntry.s | 94 ++-- Solutions/MCBSTM32F400/MCBSTM32F400.settings | 1 + .../MCBSTM32F400/MCBSTM32F400_NONET.settings | 1 + .../MCBSTM32F400/MicroBooter/MicroBooter.proj | 8 - .../MCBSTM32F400/TinyBooter/TinyBooter.proj | 10 +- .../MCBSTM32F400/TinyBooter/allocator.cpp | 13 + .../TinyBooter/scatterfile_bootloader_gcc.xml | 172 +++++--- Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj | 10 +- Solutions/MCBSTM32F400/TinyCLR/allocator.cpp | 21 +- .../TinyCLR/scatterfile_tinyclr_gcc.xml | 215 +++++---- .../TinyCLR_NONET/TinyCLR_NONET.proj | 10 +- .../MCBSTM32F400/TinyCLR_NONET/allocator.cpp | 21 +- .../scatterfile_tinyclr_nonet_gcc.xml | 181 +++++--- Solutions/MCBSTM32F400/build_gcc.cmd | 11 + Solutions/MCBSTM32F400/dotnetmf.proj | 2 +- .../scatterfile_gcc_missing_symbols.xml | 19 - .../DeviceCode/Initialization/tinyhal.cpp | 222 +--------- .../STM32F429IDISCOVERY.settings | 1 + .../TinyBooter/TinyBooter.proj | 10 +- .../TinyBooter/allocator.cpp | 13 + .../TinyBooter/scatterfile_bootloader_gcc.xml | 187 +++++--- .../STM32F429IDISCOVERY/TinyCLR/TinyCLR.proj | 10 +- .../STM32F429IDISCOVERY/TinyCLR/allocator.cpp | 21 +- .../TinyCLR/scatterfile_tinyclr_gcc.xml | 193 ++++++--- .../scatterfile_gcc_missing_symbols.xml | 18 - .../DeviceCode/Initialization/tinyhal.cpp | 237 +--------- .../STM32F4DISCOVERY.settings | 1 + .../TinyBooter/TinyBooter.proj | 10 +- .../STM32F4DISCOVERY/TinyBooter/allocator.cpp | 13 + .../TinyBooter/scatterfile_bootloader_gcc.xml | 179 +++++--- .../STM32F4DISCOVERY/TinyCLR/TinyCLR.proj | 2 +- .../STM32F4DISCOVERY/TinyCLR/allocator.cpp | 21 +- .../TinyCLR/scatterfile_tinyclr_gcc.xml | 191 +++++--- .../scatterfile_gcc_missing_symbols.xml | 19 - Solutions/Template/PortBooter/portBooter.cpp | 2 - Solutions/Template/PortBooter/portBooter.proj | 8 - .../Template/PortBooter/portBooterLoader.cpp | 2 - .../Template/PortBooter/portBooterloader.proj | 8 - Solutions/Template/TinyBooter/TinyBooter.proj | 8 - .../TinyBooter/TinyBooterDecompressor.proj | 8 - Solutions/Template/TinyCLR/TinyCLR.proj | 8 - .../Template_BE/NativeSample/NativeSample.cpp | 2 - .../NativeSample/NativeSample.proj | 8 - .../Template_BE/PortBooter/portBooter.cpp | 2 - .../Template_BE/PortBooter/portBooter.proj | 8 - .../PortBooter/portBooterLoader.cpp | 2 - .../PortBooter/portBooterloader.proj | 8 - Solutions/Template_BE/TinyCLR/TinyCLR.proj | 8 - Solutions/Windows/TinyCLR/TinyCLR.proj | 9 - Solutions/Windows/TinyCLR/TinyCLR.vcxproj | 4 +- Solutions/Windows2/TinyCLR/EmulatorNative.cpp | 2 - Solutions/Windows2/TinyCLR/TinyCLR.proj | 4 - Solutions/Windows2/TinyCLR/TinyCLR.proj.port | 4 - .../TinyCLR/TinyCLR.proj_no_floating_point | 4 - Support/Include/WireProtocol.h | 2 +- Support/WireProtocol/WireProtocol.cpp | 14 +- .../CLR/Microsoft.SPOT.Graphics/BitmapTest.cs | 2 +- tools/DisAsmPE/Include/UnalignedAccess.h | 10 +- .../Targets/Microsoft.Spot.system.gcc.targets | 12 +- .../Targets/Microsoft.Spot.system.mdk.targets | 4 +- 137 files changed, 1495 insertions(+), 2813 deletions(-) delete mode 100644 DeviceCode/pal/SimpleHeap/SimpleHeap.cpp delete mode 100644 DeviceCode/pal/SimpleHeap/dotNetMF.proj delete mode 100644 DeviceCode/pal/SimpleHeap/stubs/SimpleHeap_stubs.cpp delete mode 100644 DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj delete mode 100644 DeviceCode/pal/SimpleHeap_config/SimpleHeap_config.cpp delete mode 100644 DeviceCode/pal/SimpleHeap_config/Stubs/SimpleHeap_config_stubs.cpp delete mode 100644 DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj delete mode 100644 DeviceCode/pal/SimpleHeap_config/dotNetMF.proj create mode 100644 Solutions/MCBSTM32F400/build_gcc.cmd delete mode 100644 Solutions/MCBSTM32F400/scatterfile_gcc_missing_symbols.xml delete mode 100644 Solutions/STM32F429IDISCOVERY/scatterfile_gcc_missing_symbols.xml delete mode 100644 Solutions/STM32F4DISCOVERY/scatterfile_gcc_missing_symbols.xml diff --git a/Application/EraseDeployment/EraseDeployment.cpp b/Application/EraseDeployment/EraseDeployment.cpp index cff7d5afd..bd87c5ec4 100644 --- a/Application/EraseDeployment/EraseDeployment.cpp +++ b/Application/EraseDeployment/EraseDeployment.cpp @@ -9,8 +9,6 @@ #include "tinyhal.h" -HAL_DECLARE_NULL_HEAP(); - void ApplicationEntryPoint() { int nSects = 0; diff --git a/Application/MicroBooter/MicroBooter.cpp b/Application/MicroBooter/MicroBooter.cpp index 4185b6247..ae782f454 100644 --- a/Application/MicroBooter/MicroBooter.cpp +++ b/Application/MicroBooter/MicroBooter.cpp @@ -3,7 +3,7 @@ // // // Microsoft dotNetMF Project -// Copyright ©2004 Microsoft Corporation +// Copyright �2004 Microsoft Corporation // One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. // All rights reserved. // MICROSOFT CONFIDENTIAL @@ -22,8 +22,6 @@ BOOL MemStreamSeekBlockAddress( BlockStorageStream &stream, UINT32 address ); static SREC_Handler g_SREC; #endif -HAL_DECLARE_CUSTOM_HEAP( SimpleHeap_Allocate, SimpleHeap_Release, SimpleHeap_ReAllocate ); - #pragma arm section zidata = "s_SystemStates" static INT32 s_SystemStates[SYSTEM_STATE_TOTAL_STATES]; #pragma arm section zidata @@ -265,7 +263,7 @@ static BOOL Memory_Read( UINT32 address, UINT32 length, BYTE* data ) if(s_ReadBuffer == NULL) { - s_ReadBuffer = (UINT8*)private_malloc(readBufferSize); + s_ReadBuffer = (UINT8*)malloc(readBufferSize); ASSERT(s_ReadBuffer != NULL); if(s_ReadBuffer == NULL) return FALSE; @@ -433,14 +431,6 @@ void BootEntryLoader() Events_Initialize(); - UINT8* BaseAddress; - UINT32 SizeInBytes; - - HeapLocation( BaseAddress, SizeInBytes ); - - // Initialize custom heap with heap block returned from CustomHeapLocation - SimpleHeap_Initialize( BaseAddress, SizeInBytes ); - // this is the place where interrupts are enabled after boot for the first time after boot ENABLE_INTERRUPTS(); diff --git a/Application/MicroBooter/SrecProcessor.cpp b/Application/MicroBooter/SrecProcessor.cpp index feb4b904b..9377e2443 100644 --- a/Application/MicroBooter/SrecProcessor.cpp +++ b/Application/MicroBooter/SrecProcessor.cpp @@ -55,7 +55,7 @@ BOOL SREC_Handler::Process( char c ) if(!m_Stream.IsXIP()) { - dstExec = (UINT32)private_malloc(m_ImageLength); + dstExec = (UINT32)malloc(m_ImageLength); MemStreamSeekBlockAddress( m_Stream, m_ImageStart ); diff --git a/Application/TinyBooter/Commands.cpp b/Application/TinyBooter/Commands.cpp index 6c7bf7768..ce2886f17 100644 --- a/Application/TinyBooter/Commands.cpp +++ b/Application/TinyBooter/Commands.cpp @@ -80,7 +80,7 @@ struct BitFieldManager { const BlockDeviceInfo* deviceInfo = m_blockDevice->GetDeviceInfo(); - data = (BYTE*)private_malloc( m_region->BytesPerBlock ); + data = (BYTE*)malloc( m_region->BytesPerBlock ); if(data != NULL) { @@ -99,7 +99,7 @@ struct BitFieldManager ConfigurationSector *pCfg = (ConfigurationSector*)data; memset( (void*)&pCfg->SignatureCheck[ 0 ], 0xFF, sizeof(pCfg->SignatureCheck) ); m_blockDevice->Write( m_cfgPhysicalAddress, m_region->BytesPerBlock,data, FALSE ); - private_free(data); + free(data); } else { @@ -150,7 +150,7 @@ struct BitFieldManager else { UINT32 length = m_region->BytesPerBlock; - BYTE* dataptr = (BYTE*)private_malloc(length); + BYTE* dataptr = (BYTE*)malloc(length); if(dataptr != NULL) { @@ -174,7 +174,7 @@ struct BitFieldManager // write back to sector, as we only change one bit from 0 to 1, no need to erase sector m_blockDevice->Write( m_cfgPhysicalAddress, length, dataptr, FALSE ); - private_free(dataptr); + free(dataptr); } } @@ -227,7 +227,7 @@ struct BitFieldManager UINT32 length = sizeof(ConfigurationSector); memset( &m_skipCfgSectorCheck, 0xff, sizeof(m_skipCfgSectorCheck) ); - data = (BYTE*)private_malloc(length); + data = (BYTE*)malloc(length); stream.Device->Read( m_cfgPhysicalAddress, length, (BYTE *)data ); configSector = (ConfigurationSector*)data; m_signatureCheck = NULL; @@ -253,7 +253,7 @@ struct BitFieldManager m_signatureCheck = &m_skipCfgSectorCheck; } - private_free(data); + free(data); } else // XIP device @@ -476,7 +476,7 @@ static bool AccessMemory( UINT32 location, UINT32 lengthInBytes, BYTE* buf, int { if (mode == AccessMemory_Check) { - bufPtr = (BYTE*) private_malloc(NumOfBytes); + bufPtr = (BYTE*) malloc(NumOfBytes); if(!bufPtr) return false; } @@ -486,7 +486,7 @@ static bool AccessMemory( UINT32 location, UINT32 lengthInBytes, BYTE* buf, int { if (mode == AccessMemory_Check) { - private_free(bufPtr); + free(bufPtr); } break; @@ -495,7 +495,7 @@ static bool AccessMemory( UINT32 location, UINT32 lengthInBytes, BYTE* buf, int if (mode == AccessMemory_Check) { *(UINT32*)buf = SUPPORT_ComputeCRC( bufPtr, NumOfBytes, *(UINT32*)buf ); - private_free(bufPtr); + free(bufPtr); } } break; @@ -525,18 +525,18 @@ static bool AccessMemory( UINT32 location, UINT32 lengthInBytes, BYTE* buf, int { if(g_ConfigBuffer != NULL) { - private_free(g_ConfigBuffer); + free(g_ConfigBuffer); } g_ConfigBufferLength = 0; - // g_ConfigBuffer = (UINT8*)private_malloc(pRegion->BytesPerBlock); + // g_ConfigBuffer = (UINT8*)malloc(pRegion->BytesPerBlock); // Just allocate the configuration Sector size, configuration block can be large and not necessary to have that buffer. - g_ConfigBuffer = (UINT8*)private_malloc(g_ConfigBufferTotalSize); + g_ConfigBuffer = (UINT8*)malloc(g_ConfigBufferTotalSize); } else if(g_ConfigBufferTotalSize < ( g_ConfigBufferLength + lengthInBytes)) { - UINT8* tmp = (UINT8*)private_malloc(g_ConfigBufferLength + lengthInBytes); + UINT8* tmp = (UINT8*)malloc(g_ConfigBufferLength + lengthInBytes); if(tmp == NULL) { @@ -545,7 +545,7 @@ static bool AccessMemory( UINT32 location, UINT32 lengthInBytes, BYTE* buf, int memcpy( tmp, g_ConfigBuffer, g_ConfigBufferLength ); - private_free(g_ConfigBuffer); + free(g_ConfigBuffer); g_ConfigBuffer = tmp; } @@ -754,7 +754,7 @@ bool Loader_Engine::SignedDataState::VerifySignature( UINT8* signature, UINT32 l const BlockDeviceInfo* deviceInfo = m_pDevice->GetDeviceInfo(); if(!deviceInfo->Attribute.SupportsXIP) { - signCheckedAddr = (BYTE*)private_malloc(m_dataLength); + signCheckedAddr = (BYTE*)malloc(m_dataLength); if (signCheckedAddr == NULL) { EraseMemoryAndReset(); @@ -764,7 +764,7 @@ bool Loader_Engine::SignedDataState::VerifySignature( UINT8* signature, UINT32 l if(!m_pDevice->Read( m_dataAddress, m_dataLength, signCheckedAddr )) { EraseMemoryAndReset(); - private_free(signCheckedAddr); + free(signCheckedAddr); return false; } @@ -791,7 +791,7 @@ bool Loader_Engine::SignedDataState::VerifySignature( UINT8* signature, UINT32 l if(!deviceInfo->Attribute.SupportsXIP) { - private_free(signCheckedAddr); + free(signCheckedAddr); } return fret; @@ -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 @@ -1542,7 +1542,7 @@ bool Loader_Engine::Monitor_FlashSectorMap( WP_Message* msg ) if(cnt == 1) { - pData = (struct Flash_Sector*)private_malloc(rangeCount * sizeof(struct Flash_Sector)); + pData = (struct Flash_Sector*)malloc(rangeCount * sizeof(struct Flash_Sector)); if(pData == NULL) { @@ -1582,12 +1582,12 @@ bool Loader_Engine::Monitor_FlashSectorMap( WP_Message* msg ) ReplyToCommand(msg, true, false, (void*)pData, rangeCount * sizeof (struct Flash_Sector) ); - private_free(pData); + free(pData); 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/Application/TinyBooter/ConfigurationManager.cpp b/Application/TinyBooter/ConfigurationManager.cpp index c3a43da18..acd012582 100644 --- a/Application/TinyBooter/ConfigurationManager.cpp +++ b/Application/TinyBooter/ConfigurationManager.cpp @@ -130,7 +130,7 @@ void ConfigurationSectorManager::WriteConfiguration( UINT32 writeOffset, BYTE *d // Copy the whole block to a buffer, for NonXIP or need to erase block if ((eraseWrite) || (!m_fSupportsXIP)) { - configurationInBytes =(BYTE*)private_malloc(writeLengthInBytes); + configurationInBytes =(BYTE*)malloc(writeLengthInBytes); // load data to the local buffer. if (configurationInBytes) @@ -154,7 +154,7 @@ void ConfigurationSectorManager::WriteConfiguration( UINT32 writeOffset, BYTE *d // rewrite from the start of block m_device->Write( m_cfgPhysicalAddress, writeLengthInBytes, configurationInBytes, FALSE ); - private_free(configurationInBytes); + free(configurationInBytes); } diff --git a/Application/TinyBooter/CryptoInterface.cpp b/Application/TinyBooter/CryptoInterface.cpp index caf1afe3c..40ac50f36 100644 --- a/Application/TinyBooter/CryptoInterface.cpp +++ b/Application/TinyBooter/CryptoInterface.cpp @@ -111,7 +111,7 @@ bool CryptoState::VerifySignature( UINT32 keyIndex ) } // free RAM buffer - private_free(g_ConfigBuffer); + free(g_ConfigBuffer); g_ConfigBuffer = NULL; return fRet; diff --git a/Application/TinyBooter/TinyBooter.cpp b/Application/TinyBooter/TinyBooter.cpp index 9b98750bc..0c702af97 100644 --- a/Application/TinyBooter/TinyBooter.cpp +++ b/Application/TinyBooter/TinyBooter.cpp @@ -18,22 +18,11 @@ Loader_Engine g_eng; //--// -HAL_DECLARE_CUSTOM_HEAP( SimpleHeap_Allocate, SimpleHeap_Release, SimpleHeap_ReAllocate ); - -//--// - void ApplicationEntryPoint() { INT32 timeout = 20000; // 20 second timeout bool enterBootMode = false; - // crypto API needs to allocate memory. Initialize simple heap for it. - UINT8* BaseAddress; - UINT32 SizeInBytes; - - HeapLocation ( BaseAddress, SizeInBytes ); - SimpleHeap_Initialize( BaseAddress, SizeInBytes ); - g_eng.Initialize( HalSystemConfig.DebuggerPorts[ 0 ] ); // internal reset and stop check diff --git a/Application/TinyBooter/TinyBooterDecompressor.cpp b/Application/TinyBooter/TinyBooterDecompressor.cpp index 45449f93e..60f988795 100644 --- a/Application/TinyBooter/TinyBooterDecompressor.cpp +++ b/Application/TinyBooter/TinyBooterDecompressor.cpp @@ -12,8 +12,6 @@ typedef unsigned char UINT8; int LZ77_Decompress( UINT8* inBuf, int inSize, UINT8* outBuf, int outSize ); -HAL_DECLARE_NULL_HEAP(); - typedef void (*APP_ENTRY_POINT)(); extern "C" 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/CLR_RT_Memory.cpp b/CLR/Core/CLR_RT_Memory.cpp index 0b9998bc0..456f7cad2 100644 --- a/CLR/Core/CLR_RT_Memory.cpp +++ b/CLR/Core/CLR_RT_Memory.cpp @@ -16,8 +16,6 @@ static int s_PreHeapInitIndex = 0; //////////////////////////////////////////////////////////// -HAL_DECLARE_CUSTOM_HEAP( CLR_RT_Memory::Allocate, CLR_RT_Memory::Release, CLR_RT_Memory::ReAllocate ); - //--// void CLR_RT_Memory::Reset() 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..24eb93b16 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; @@ -427,7 +427,7 @@ bool CLR_DBG_Debugger::Monitor_FlashSectorMap( WP_Message* msg, void* owner ) if(cnt == 1) { - pData = (struct Flash_Sector*)private_malloc(rangeCount * sizeof(struct Flash_Sector)); + pData = (struct Flash_Sector*)malloc(rangeCount * sizeof(struct Flash_Sector)); if(pData == NULL) { @@ -467,7 +467,7 @@ bool CLR_DBG_Debugger::Monitor_FlashSectorMap( WP_Message* msg, void* owner ) dbg->m_messaging->ReplyToCommand( msg, true, false, (void*)pData, rangeCount * sizeof (struct Flash_Sector) ); - private_free(pData); + free(pData); } return true; @@ -1210,7 +1210,7 @@ bool CLR_DBG_Debugger::Debugging_MFUpdate_AuthCommand( WP_Message* msg, void* ow { int cmdSize = respLen + offsetof(CLR_DBG_Commands::Debugging_MFUpdate_AuthCommand::Reply, m_response); - CLR_DBG_Commands::Debugging_MFUpdate_AuthCommand::Reply* pTmp = (CLR_DBG_Commands::Debugging_MFUpdate_AuthCommand::Reply*)private_malloc(cmdSize); + CLR_DBG_Commands::Debugging_MFUpdate_AuthCommand::Reply* pTmp = (CLR_DBG_Commands::Debugging_MFUpdate_AuthCommand::Reply*)malloc(cmdSize); if(pTmp != NULL) { @@ -1223,7 +1223,7 @@ bool CLR_DBG_Debugger::Debugging_MFUpdate_AuthCommand( WP_Message* msg, void* ow } else { - private_free(pTmp); + free(pTmp); } } } @@ -1233,7 +1233,7 @@ bool CLR_DBG_Debugger::Debugging_MFUpdate_AuthCommand( WP_Message* msg, void* ow if(pReply != &reply) { - private_free(pReply); + free(pReply); } return true; @@ -1297,7 +1297,7 @@ bool CLR_DBG_Debugger::Debugging_MFUpdate_GetMissingPkts( WP_Message* msg, void* if(MFUpdate_GetMissingPackets(cmd->m_updateHandle, &s_missingPkts[0], &int32Cnt)) { - pReply = (CLR_DBG_Commands::Debugging_MFUpdate_GetMissingPkts::Reply*)private_malloc(sizeBytes); + pReply = (CLR_DBG_Commands::Debugging_MFUpdate_GetMissingPkts::Reply*)malloc(sizeBytes); if(pReply != NULL) { @@ -1318,7 +1318,7 @@ bool CLR_DBG_Debugger::Debugging_MFUpdate_GetMissingPkts( WP_Message* msg, void* if(pReply != &reply) { - private_free(pReply); + free(pReply); } return true; @@ -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 { @@ -1953,7 +1953,7 @@ bool CLR_DBG_Debugger::Debugging_Thread_Get( WP_Message* msg, void* owner ) if(!fFound) { - pThread = (CLR_RT_HeapBlock*)private_malloc(sizeof(CLR_RT_HeapBlock)); + pThread = (CLR_RT_HeapBlock*)malloc(sizeof(CLR_RT_HeapBlock)); //Create the managed thread. //This implies that there is no state in the managed object. This is not exactly true, as the managed thread diff --git a/CLR/Graphics/Graphics.cpp b/CLR/Graphics/Graphics.cpp index 71e59349d..033ea1231 100644 --- a/CLR/Graphics/Graphics.cpp +++ b/CLR/Graphics/Graphics.cpp @@ -109,8 +109,8 @@ HRESULT CLR_GFX_Bitmap::CreateInstance( CLR_RT_HeapBlock& ref, const CLR_GFX_Bit } else { - //The bitmap is too big to fit on the managed heap, so put it on the SimpleHeap - bitmap = (CLR_GFX_Bitmap*)SimpleHeap_Allocate(size); + //The bitmap is too big to fit on the managed heap, so put it on the heap + bitmap = (CLR_GFX_Bitmap*)malloc(size); ref.SetInteger((CLR_UINT32)bitmap); ref.PerformBoxingIfNeeded(); @@ -195,7 +195,7 @@ HRESULT CLR_GFX_Bitmap::CreateInstance( CLR_RT_HeapBlock& ref, const CLR_UINT8* /* When loading a Windows BMP, GIF, or JPEG file, it is converted in-place to the native BPP. * When loading a compressed TinyCLR Bitmap from a resource file, two bitmaps are needed to decompress, then convert. * This fragments the heap and wastes space until the next garbage collection is done. - * When using the SimpleHeap, there is no relocation, so decompressing into a temp bitmap into the simpleheap wastes + * When using the heap, there is no relocation, so decompressing into a temp bitmap into the heap wastes * memory 6.25% the size of the 16bpp bitmap that's saved. */ @@ -310,7 +310,7 @@ HRESULT CLR_GFX_Bitmap::DeleteInstance( CLR_RT_HeapBlock& ref ) if (blob->IsBoxed() && blob[ 1 ].DataType() == DATATYPE_U4) { bitmap = (CLR_GFX_Bitmap*)(blob[ 1 ].NumericByRefConst().u4); - SimpleHeap_Release (bitmap); + free(bitmap); } 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_Hardware/spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer.cpp b/CLR/Libraries/SPOT_Hardware/spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer.cpp index 7a5b4f522..b647ed4c9 100644 --- a/CLR/Libraries/SPOT_Hardware/spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer.cpp +++ b/CLR/Libraries/SPOT_Hardware/spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer.cpp @@ -17,7 +17,7 @@ HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer::Create reflex.m_levels = 1; reflex.m_data.m_type = g_CLR_RT_WellKnownTypes.m_UInt8; - CLR_RT_HeapBlock_Array* pData = (CLR_RT_HeapBlock_Array*)SimpleHeap_Allocate(size + sizeof(CLR_RT_HeapBlock_Array)); CHECK_ALLOCATION(pData); + CLR_RT_HeapBlock_Array* pData = (CLR_RT_HeapBlock_Array*)malloc(size + sizeof(CLR_RT_HeapBlock_Array)); CHECK_ALLOCATION(pData); CLR_RT_Memory::ZeroFill(pData, size + sizeof(CLR_RT_HeapBlock_Array)); @@ -57,7 +57,7 @@ HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer::Intern CLR_RT_HeapBlock_Array* hbRef = hbBytes.DereferenceArray(); FAULT_ON_NULL(hbRef); - SimpleHeap_Release(hbRef); + free(hbRef); hbBytes.SetObjectReference( NULL ); @@ -112,7 +112,7 @@ HRESULT Library_spot_hardware_native_Microsoft_SPOT_Hardware_LargeBufferMarshall if(array->m_numOfElements != size) { - SimpleHeap_Release(array); + free(array); TINYCLR_CHECK_HRESULT(Library_spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer::CreateBufferHelper( pLB[Library_spot_hardware_native_Microsoft_SPOT_Hardware_LargeBuffer::FIELD__m_bytes], size )); 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/CLR/Tools/BuildHelper/BuildHelper.cpp b/CLR/Tools/BuildHelper/BuildHelper.cpp index 03a6be931..299642aff 100644 --- a/CLR/Tools/BuildHelper/BuildHelper.cpp +++ b/CLR/Tools/BuildHelper/BuildHelper.cpp @@ -875,8 +875,6 @@ int _tmain(int argc, _TCHAR* argv[]) TINYCLR_CHECK_HRESULT(HAL_Windows::Memory_Resize( 64 * 1024 * 1024 )); - HAL_Init_Custom_Heap(); - CLR_RT_Memory::Reset (); st.PushArguments( argc-1, argv+1, vec ); diff --git a/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp b/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp index 9a91480eb..6ef1aa7cf 100644 --- a/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp +++ b/CLR/Tools/MetaDataProcessor/MetaDataProcessor.cpp @@ -1784,7 +1784,6 @@ int _tmain(int argc, _TCHAR* argv[]) ::CoInitialize( 0 ); TINYCLR_CHECK_HRESULT(HAL_Windows::Memory_Resize( 64 * 1024 * 1024 )); - HAL_Init_Custom_Heap(); // do not display assembly load information s_CLR_RT_fTrace_AssemblyOverhead = 0; diff --git a/CLR/Tools/TFConvert/TFConvert.cpp b/CLR/Tools/TFConvert/TFConvert.cpp index 5f215c76d..691d83594 100644 --- a/CLR/Tools/TFConvert/TFConvert.cpp +++ b/CLR/Tools/TFConvert/TFConvert.cpp @@ -192,7 +192,6 @@ int _tmain(int argc, _TCHAR* argv[]) TINYCLR_CHECK_HRESULT(::CoInitialize( 0 )); TINYCLR_CHECK_HRESULT(HAL_Windows::Memory_Resize( 16 * 1024 * 1024 )); - HAL_Init_Custom_Heap(); CLR_RT_Memory::Reset (); diff --git a/CLR/Tools/Tools.settings b/CLR/Tools/Tools.settings index c6627a6f3..e3478fb81 100644 --- a/CLR/Tools/Tools.settings +++ b/CLR/Tools/Tools.settings @@ -31,11 +31,6 @@ - - - - - diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/AppEntry.s b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/AppEntry.s index 14b29179c..3e37666af 100644 --- a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/AppEntry.s +++ b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/AppEntry.s @@ -24,13 +24,9 @@ .global EntryPoint - .global StackBottom - .global StackTop .global HeapBegin .global HeapEnd - .global CustomHeapBegin - .global CustomHeapEnd - .global __initial_sp + .global _end .global Reset_Handler .extern BootEntry @@ -39,30 +35,32 @@ @************************************************************************* - .section SectionForStackBottom, "w", %nobits -StackBottom: - .word 0 - - .section SectionForStackTop, "w", %nobits -__initial_sp: -StackTop: - .word 0 - - .section SectionForHeapBegin, "w", %nobits -HeapBegin: - .word 0 - - .section SectionForHeapEnd, "w", %nobits -HeapEnd: - .word 0 - - .section SectionForCustomHeapBegin, "w", %nobits -CustomHeapBegin: - .word 0 - - .section SectionForCustomHeapEnd, "w", %nobits -CustomHeapEnd: - .word 0 + /* start address for the initialization values of the .data section. + defined in linker script */ + .word _sidata + /* start address for the .data section. defined in linker script */ + .word _sdata + /* end address for the .data section. defined in linker script */ + .word _edata + /* start address for the .bss section. defined in linker script */ + .word _sbss + /* end address for the .bss section. defined in linker script */ + .word _ebss + /* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + + /* start address of managed heap */ + .word HeapBegin + /* end address of managed heap */ + .word HeapEnd + +/** + * @brief This is the code that gets called when the processor first + * starts execution following a reset event. Only the absolutely + * necessary set is performed, after which the application + * supplied main() routine is called. + * @param None + * @retval : None +*/ .section i.EntryPoint, "ax", %progbits @@ -99,10 +97,45 @@ EntryPoint: .word 0 @ [ UNUSED ] Reset_Handler: - @@ reload the stack pointer as there's no returning to the loader - ldr sp, =__initial_sp - bl BootstrapCode - b BootEntry + ldr sp, =_estack /* set stack pointer */ + + /* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + + CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + + LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss + /* Zero fill the bss segment. */ + FillZerobss: + movs r3, #0 + str r3, [r2], #4 + + LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + + /* Call the clock system intitialization function.*/ + bl SystemInit + + /* Call static constructors */ + bl __libc_init_array + + /* Call the application's entry point.*/ + bl main + bx lr .pool .size Reset_Handler, . - Reset_Handler diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/FirstEntry.s b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/FirstEntry.s index 8986a5c95..60a9a3ef4 100644 --- a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/FirstEntry.s +++ b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/FirstEntry.s @@ -16,47 +16,33 @@ .thumb .global EntryPoint - .global __initial_sp .global Reset_Handler - .global StackBottom - .global StackTop .global HeapBegin .global HeapEnd - .global CustomHeapBegin - .global CustomHeapEnd + .global _end .global PowerOnReset - .extern PreStackInit - - .extern BootEntry - .extern BootstrapCode + .extern SystemInit @************************************************************************* - .section SectionForStackBottom, "w", %nobits -StackBottom: - .word 0 - - .section SectionForStackTop, "w", %nobits -__initial_sp: -StackTop: - .word 0 - - .section SectionForHeapBegin, "w", %nobits -HeapBegin: - .word 0 - - .section SectionForHeapEnd, "w", %nobits -HeapEnd: - .word 0 - - .section SectionForCustomHeapBegin, "w", %nobits -CustomHeapBegin: - .word 0 - - .section SectionForCustomHeapEnd, "w", %nobits -CustomHeapEnd: - .word 0 + /* start address for the initialization values of the .data section. + defined in linker script */ + .word _sidata + /* start address for the .data section. defined in linker script */ + .word _sdata + /* end address for the .data section. defined in linker script */ + .word _edata + /* start address for the .bss section. defined in linker script */ + .word _sbss + /* end address for the .bss section. defined in linker script */ + .word _ebss + /* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + + /* start address of managed heap */ + .word HeapBegin + /* end address of managed heap */ + .word HeapEnd @ Power On Reset vector table for the device @ This is placed at physical address 0 by the @@ -68,7 +54,7 @@ CustomHeapEnd: .section SectionForPowerOnReset, "x", %progbits PowerOnReset: - .word __initial_sp + .word _estack .word Reset_Handler @ Reset .word Fault_Handler @ NMI .word Fault_Handler @ Hard Fault @@ -86,8 +72,45 @@ PowerOnReset: .section i.EntryPoint, "ax", %progbits EntryPoint: Reset_Handler: - bl BootstrapCode - b BootEntry + ldr sp, =_estack /* set stack pointer */ + + /* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + + /* Call the clock system intitialization function.*/ + bl SystemInit + + /* Call static constructors */ + bl __libc_init_array + + /* Call the application's entry point.*/ + bl main + bx lr .pool .size Reset_Handler, . - Reset_Handler diff --git a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/VectorTable_Template.s b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/VectorTable_Template.s index acd395e9f..0ba1215dc 100644 --- a/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/VectorTable_Template.s +++ b/DeviceCode/Cores/arm/Processors/CortexMx/TinyHal/GNU_S/VectorTable_Template.s @@ -25,7 +25,7 @@ .thumb @ Initial Stack pointer for power on reset - .extern __initial_sp + .extern _estack @ Import standard Cortex-M handlers .extern Reset_Handler @@ -145,7 +145,7 @@ ; The first 16 entries are all architecturally defined by ARM ARM_Vectors: - .long __initial_sp @ Top of Stack + .long _estack @ Top of Stack .long Reset_Handler @ Reset Handler .long NMI_Handler @ NMI Handler .long HardFault_Handler @ Hard Fault Handler diff --git a/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/AM29DL_16_driver.cpp b/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/AM29DL_16_driver.cpp index 7c6d2c0a4..7ee1f6393 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/AM29DL_16_driver.cpp +++ b/DeviceCode/Drivers/BlockStorage/Flash/AM29DL_16/AM29DL_16_driver.cpp @@ -210,7 +210,7 @@ BOOL __section("SectionForFlashOperations") AM29DL_16_BS_Driver::Write(void* con ByteAddress addrEnd = Address + NumBytes; UINT32 index = 0; - pBuf = (BYTE*)private_malloc(bytesPerBlock); + pBuf = (BYTE*)malloc(bytesPerBlock); if(pBuf == NULL) { @@ -262,9 +262,9 @@ BOOL __section("SectionForFlashOperations") AM29DL_16_BS_Driver::Write(void* con regionEnd = deviceInfo->Regions[region].Start + deviceInfo->Regions[region].Size(); bytesPerBlock = deviceInfo->Regions[region].BytesPerBlock; - private_free(pBuf); + free(pBuf); - pBuf = (BYTE*)private_malloc(bytesPerBlock); + pBuf = (BYTE*)malloc(bytesPerBlock); if(pBuf == NULL) { @@ -277,7 +277,7 @@ BOOL __section("SectionForFlashOperations") AM29DL_16_BS_Driver::Write(void* con if(pBuf != NULL) { - private_free(pBuf); + free(pBuf); } return fRet; diff --git a/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/I28F_16_driver.cpp b/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/I28F_16_driver.cpp index 931b6e570..879d7377b 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/I28F_16_driver.cpp +++ b/DeviceCode/Drivers/BlockStorage/Flash/I28F_16/I28F_16_driver.cpp @@ -263,7 +263,7 @@ BOOL __section("SectionForFlashOperations")I28F_16_BS_Driver::Write(void* contex ByteAddress addrEnd = Address + NumBytes; UINT32 index = 0; - pBuf = (BYTE*)private_malloc(bytesPerBlock); + pBuf = (BYTE*)malloc(bytesPerBlock); if(pBuf == NULL) return FALSE; @@ -312,9 +312,9 @@ BOOL __section("SectionForFlashOperations")I28F_16_BS_Driver::Write(void* contex regionEnd = deviceInfo->Regions[region].Start + deviceInfo->Regions[region].Size(); bytesPerBlock = deviceInfo->Regions[region].BytesPerBlock; - private_free(pBuf); + free(pBuf); - pBuf = (BYTE*)private_malloc(bytesPerBlock); + pBuf = (BYTE*)malloc(bytesPerBlock); if(pBuf == NULL) fRet = FALSE; } @@ -324,7 +324,7 @@ BOOL __section("SectionForFlashOperations")I28F_16_BS_Driver::Write(void* contex if(pBuf != NULL) { - private_free(pBuf); + free(pBuf); } return fRet; diff --git a/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/SST39WF_16_driver.cpp b/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/SST39WF_16_driver.cpp index eca0c9773..3748d7024 100644 --- a/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/SST39WF_16_driver.cpp +++ b/DeviceCode/Drivers/BlockStorage/Flash/SST39WF_16/SST39WF_16_driver.cpp @@ -236,7 +236,7 @@ BOOL __section("SectionForFlashOperations")SST39WF_16_BS_Driver::Write(void* con ByteAddress addrEnd = Address + NumBytes; UINT32 index = 0; - pBuf = (BYTE*)private_malloc(bytesPerBlock); + pBuf = (BYTE*)malloc(bytesPerBlock); if(pBuf == NULL) return FALSE; @@ -283,9 +283,9 @@ BOOL __section("SectionForFlashOperations")SST39WF_16_BS_Driver::Write(void* con regionEnd = deviceInfo->Regions[region].Start + deviceInfo->Regions[region].Size(); bytesPerBlock = deviceInfo->Regions[region].BytesPerBlock; - private_free(pBuf); + free(pBuf); - pBuf = (BYTE*)private_malloc(bytesPerBlock); + pBuf = (BYTE*)malloc(bytesPerBlock); if(pBuf == NULL) fRet = FALSE; } @@ -295,7 +295,7 @@ BOOL __section("SectionForFlashOperations")SST39WF_16_BS_Driver::Write(void* con if(pBuf != NULL) { - private_free(pBuf); + free(pBuf); } return fRet; diff --git a/DeviceCode/Drivers/BlockStorage/WearLeveling/BS_WearLeveling_Driver.cpp b/DeviceCode/Drivers/BlockStorage/WearLeveling/BS_WearLeveling_Driver.cpp index 52c7c4a7c..cc679afe2 100644 --- a/DeviceCode/Drivers/BlockStorage/WearLeveling/BS_WearLeveling_Driver.cpp +++ b/DeviceCode/Drivers/BlockStorage/WearLeveling/BS_WearLeveling_Driver.cpp @@ -107,12 +107,6 @@ BOOL BS_WearLeveling_Driver::InitializeDevice(void *context) config->BlockIndexMask = 0x80000000; - // verify that we have simple heap support - void* tmp = SimpleHeap_Allocate(4); - - if(NULL == tmp) { _WEAR_LEVEL_ASSERT(FALSE); return FALSE; } - else { SimpleHeap_Release(tmp); } - // // Block index mas is used to determine block map addressing // @@ -1777,7 +1771,8 @@ BOOL BS_WearLeveling_Driver::WriteToSector(BS_WearLeveling_Config* config, ByteA // // we only need a new sector if we are moving any bits from 0 -> 1 // - //if(origPhyMeta.IsSectorDirty()) + //if(origPhyMeta.IsSectorDirty()) + //{ // fReadModifyNeeded = TRUE; //} diff --git a/DeviceCode/Drivers/FS/FAT/FAT_SectorCache.cpp b/DeviceCode/Drivers/FS/FAT/FAT_SectorCache.cpp index 5db790593..46d30499d 100644 --- a/DeviceCode/Drivers/FS/FAT/FAT_SectorCache.cpp +++ b/DeviceCode/Drivers/FS/FAT/FAT_SectorCache.cpp @@ -70,7 +70,7 @@ void FAT_SectorCache::Uninitialize() { FlushSector( cacheLine ); - private_free( cacheLine->m_buffer ); + free( cacheLine->m_buffer ); cacheLine->m_buffer = NULL; cacheLine->m_flags = 0; @@ -101,7 +101,7 @@ BYTE* FAT_SectorCache::GetSector( UINT32 sectorIndex, BOOL useLRU, BOOL forWrite if(!cacheLine->m_buffer) { - cacheLine->m_buffer = (BYTE*)private_malloc( SECTORCACHE_LINESIZE ); + cacheLine->m_buffer = (BYTE*)malloc( SECTORCACHE_LINESIZE ); if(!cacheLine->m_buffer) return NULL; } @@ -113,7 +113,7 @@ BYTE* FAT_SectorCache::GetSector( UINT32 sectorIndex, BOOL useLRU, BOOL forWrite if(!m_blockStorageDevice->Read( cacheLine->m_bsByteAddress, SECTORCACHE_LINESIZE, cacheLine->m_buffer )) { - private_free( cacheLine->m_buffer ); + free( cacheLine->m_buffer ); cacheLine->m_buffer = NULL; diff --git a/DeviceCode/Drivers/MFUpdate/MicroBooterUpdate.cpp b/DeviceCode/Drivers/MFUpdate/MicroBooterUpdate.cpp index a7dce78b0..0953cb021 100644 --- a/DeviceCode/Drivers/MFUpdate/MicroBooterUpdate.cpp +++ b/DeviceCode/Drivers/MFUpdate/MicroBooterUpdate.cpp @@ -118,7 +118,7 @@ BOOL MicroBooterUpdateProvider::InstallUpdate( MFUpdate* pUpdate, UINT8* pValida if(!isXIP) { - headerBuffer = (BYTE*)private_malloc( headerInBytes ); if(!headerBuffer) return FALSE; + headerBuffer = (BYTE*)malloc( headerInBytes ); if(!headerBuffer) return FALSE; memset( headerBuffer, 0, headerInBytes ); } @@ -157,7 +157,7 @@ BOOL MicroBooterUpdateProvider::InstallUpdate( MFUpdate* pUpdate, UINT8* pValida stream.Seek( AssemblySizeInByte ); } - if(!isXIP) private_free( headerBuffer ); + if(!isXIP) free( headerBuffer ); } while(stream.NextStream()); diff --git a/DeviceCode/Drivers/Stubs/TempForGCC/missFunctions.cpp b/DeviceCode/Drivers/Stubs/TempForGCC/missFunctions.cpp index 67b806373..625af85a8 100644 --- a/DeviceCode/Drivers/Stubs/TempForGCC/missFunctions.cpp +++ b/DeviceCode/Drivers/Stubs/TempForGCC/missFunctions.cpp @@ -54,7 +54,8 @@ double pow(double x, double y) } double floor(double x) -{ +{ + if (x >0) return 1; else @@ -63,7 +64,8 @@ double floor(double x) double fmod(double x, double y) -{ +{ + if (x >0) return 1; else @@ -87,11 +89,6 @@ void longjmp (jmp_buf env, int val) } #endif -//////////////////////// - -#define malloc(y) private_malloc(y) - -#define free(x) private_free((void*)x) //////////////////// @@ -120,7 +117,8 @@ void * memset ( void * dst, int value, size_t len ) return dst; } -void * memmove ( void * dst, const void * src, size_t num ) +void * memmove ( void * dst, const void * src, size_t num ) + { if (dst==NULL) diff --git a/DeviceCode/Initialization/tinyhal.cpp b/DeviceCode/Initialization/tinyhal.cpp index 48f42b66d..c7a4a6c7c 100644 --- a/DeviceCode/Initialization/tinyhal.cpp +++ b/DeviceCode/Initialization/tinyhal.cpp @@ -10,205 +10,14 @@ //--// -// we need this to force inclusion from library at link time -#pragma import(EntryPoint) - - #undef TRACE_ALWAYS #define TRACE_ALWAYS 0x00000001 #undef DEBUG_TRACE #define DEBUG_TRACE (TRACE_ALWAYS) -//--// - -#if !defined(BUILD_RTM) && !defined(PLATFORM_ARM_OS_PORT) - -UINT32 Stack_MaxUsed() -{ - // this is the value we check for stack overruns - const UINT32 StackCheckVal = 0xBAADF00D; - - size_t size = (size_t)&StackTop - (size_t)&StackBottom; - UINT32* ptr = (UINT32*)&StackBottom; - - DEBUG_TRACE1(TRACE_ALWAYS, "Stack Max = %d\r\n", size); - - while(*ptr == StackCheckVal) - { - size -= 4; - ptr++; - } - - DEBUG_TRACE1(TRACE_ALWAYS, "Stack Used = %d\r\n", size); - - return size; -} - -#endif // !defined(BUILD_RTM) //--// -// this is the first C function called after bootstrapping ourselves into ram - -// these define the region to zero initialize -extern UINT32 Image$$ER_RAM_RW$$ZI$$Base; -extern UINT32 Image$$ER_RAM_RW$$ZI$$Length; - -// here is the execution address/length of code to move from FLASH to RAM -#define IMAGE_RAM_RO_BASE Image$$ER_RAM_RO$$Base -#define IMAGE_RAM_RO_LENGTH Image$$ER_RAM_RO$$Length - -extern UINT32 IMAGE_RAM_RO_BASE; -extern UINT32 IMAGE_RAM_RO_LENGTH; - -// here is the execution address/length of data to move from FLASH to RAM -extern UINT32 Image$$ER_RAM_RW$$Base; -extern UINT32 Image$$ER_RAM_RW$$Length; - -// here is the load address of the RAM code/data -#define LOAD_RAM_RO_BASE Load$$ER_RAM_RO$$Base - -extern UINT32 LOAD_RAM_RO_BASE; -extern UINT32 Load$$ER_RAM_RW$$Base; - -//--// - -#if defined(TARGETLOCATION_RAM) - -extern UINT32 Load$$ER_RAM$$Base; -extern UINT32 Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - -extern UINT32 Load$$ER_FLASH$$Base; -extern UINT32 Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - -UINT32 LOAD_IMAGE_Start; -UINT32 LOAD_IMAGE_Length; -UINT32 LOAD_IMAGE_CalcCRC; - -// -// The ARM linker is not keeping FirstEntry.obj (and EntryPoint) for RTM builds of NativeSample (possibly others) -// The --keep FirstEntry.obj linker option also does not work, however, this unused method call to EntryPoint does the trick. -// -void KEEP_THE_LINKER_HAPPY_SINCE_KEEP_IS_NOT_WORKING() -{ - EntryPoint(); -} - -//--// - -#pragma arm section code = "SectionForBootstrapOperations" - -static void __section("SectionForBootstrapOperations") Prepare_Copy( UINT32* src, UINT32* dst, UINT32 len ) -{ - if(dst != src) - { - INT32 extraLen = len & 0x00000003; - len = len & 0xFFFFFFFC; - - while(len != 0) - { - *dst++ = *src++; - - len -= 4; - } - - // thumb2 code can be multiples of 2... - - UINT8 *dst8 = (UINT8*) dst, *src8 = (UINT8*) src; - - while (extraLen > 0) - { - *dst8++ = *src8++; - - extraLen--; - } - } -} - -static void __section("SectionForBootstrapOperations") Prepare_Zero( UINT32* dst, UINT32 len ) -{ - INT32 extraLen = len & 0x00000003; - len = len & 0xFFFFFFFC; - - while(len != 0) - { - *dst++ = 0; - - len -= 4; - } - - // thumb2 code can be multiples of 2... - - UINT8 *dst8 = (UINT8*) dst; - - while (extraLen > 0) - { - *dst8++ = 0; - - extraLen--; - } -} - -void __section("SectionForBootstrapOperations") PrepareImageRegions() -{ - // - // Copy RAM RO regions into proper location. - // - { - UINT32* src = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* dst = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 len = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - Prepare_Copy( src, dst, len ); - } - - // - // Copy RAM RW regions into proper location. - // - { - UINT32* src = (UINT32*)&Load$$ER_RAM_RW$$Base; - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$Base; - UINT32 len = (UINT32)&Image$$ER_RAM_RW$$Length; - - Prepare_Copy( src, dst, len ); - } - - // - // Initialize RAM ZI regions. - // - { - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$ZI$$Base; - UINT32 len = (UINT32 )&Image$$ER_RAM_RW$$ZI$$Length; - - Prepare_Zero( dst, len ); - } -} - -#pragma arm section code - -//--// - -static void InitCRuntime() -{ -#if (defined(HAL_REDUCESIZE) || defined(PLATFORM_EMULATED_FLOATINGPOINT)) - - // Don't initialize floating-point on small builds. - -#else - -#if !defined(__GNUC__) - _fp_init(); -#endif - - setlocale( LC_ALL, "" ); -#endif -} #if !defined(BUILD_RTM) static UINT32 g_Boot_RAMConstants_CRC = 0; @@ -309,7 +118,7 @@ void HAL_EnterBooterMode() ::Watchdog_ResetCounter(); - BYTE *data = (BYTE*) private_malloc(pBlockRegionInfo->BytesPerBlock); + BYTE *data = (BYTE*) malloc(pBlockRegionInfo->BytesPerBlock); if(data != NULL) { @@ -338,7 +147,7 @@ void HAL_EnterBooterMode() // write back to sector, as we only change one bit from 0 to 1, no need to erase sector bRet = (TRUE == pBlockDevice->Write( configSectAddress, pBlockRegionInfo->BytesPerBlock, data, FALSE )); - private_free(data); + free(data); } } @@ -349,20 +158,31 @@ void HAL_EnterBooterMode() bool g_fDoNotUninitializeDebuggerPort = false; void HAL_Initialize() -{ +{ +#if defined(PLATFORM_ARM_OS_PORT) + // Interrupts must be enabled to handle calls to OS + // (Network stack uses the CMSIS-RTX OS, which uses + // SVC calls, which will hard fault if the interrupts + // are disabled at the Svc instruction ) + // SystemInit handles this for the startup from reset + // However, this is also called from the CLR when doing + // a soft reboot. + __enable_irq(); +#endif + HAL_CONTINUATION::InitializeList(); HAL_COMPLETION ::InitializeList(); - HAL_Init_Custom_Heap(); - Time_Initialize(); Events_Initialize(); CPU_GPIO_Initialize(); CPU_SPI_Initialize(); +#if !defined(PLATFORM_ARM_OS_PORT) // this is the place where interrupts are enabled after boot for the first time after boot ENABLE_INTERRUPTS(); +#endif // have to initialize the blockstorage first, as the USB device needs to update the configure block @@ -483,87 +303,29 @@ void HAL_Uninitialize() extern "C" { - -void BootEntry() +// defined as weak to allow it to be overriden by equivalent function at Solution level +__attribute__((weak)) int main(void) { - -#if (defined(GCCOP) && defined(COMPILE_THUMB)) - -// the IRQ_Handler routine generated from the compiler is incorrect, the return address LR has been decrement twice -// it decrements LR at the first instruction of IRQ_handler and then before return, it decrements LR again. -// temporary fix is at the ARM_Vector ( IRQ), make it jump to 2nd instruction of IRQ_handler to skip teh first subs LR, LR #4; -// - volatile int *ptr; - ptr =(int*) 0x28; - *ptr = *ptr +4; -#endif - - -#if !defined(BUILD_RTM) && !defined(PLATFORM_ARM_OS_PORT) - { - int marker; - int* ptr = &marker - 1; // This will point to the current top of the stack. - int* end = &StackBottom; - - while(ptr >= end) - { - *ptr-- = 0xBAADF00D; - } - } -#endif - - // these are needed for patch access - -#if defined(TARGETLOCATION_RAM) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_RAM$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_FLASH$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - - InitCRuntime(); - - LOAD_IMAGE_Length += (UINT32)&IMAGE_RAM_RO_LENGTH + (UINT32)&Image$$ER_RAM_RW$$Length; - -#if !defined(BUILD_RTM) - g_Boot_RAMConstants_CRC = Checksum_RAMConstants(); -#endif - - - CPU_Initialize(); - HAL_Time_Initialize(); HAL_Initialize(); -#if !defined(BUILD_RTM) - DEBUG_TRACE4( STREAM_LCD, ".NetMF v%d.%d.%d.%d\r\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION); - DEBUG_TRACE3(TRACE_ALWAYS, "%s, Build Date:\r\n\t%s %s\r\n", HalName, __DATE__, __TIME__); -#if defined(__GNUC__) - DEBUG_TRACE1(TRACE_ALWAYS, "GNU Compiler version %d\r\n", __GNUC__); -#else - DEBUG_TRACE1(TRACE_ALWAYS, "ARM Compiler version %d\r\n", __ARMCC_VERSION); -#endif - UINT8* BaseAddress; - UINT32 SizeInBytes; - HeapLocation( BaseAddress, SizeInBytes ); - memset ( BaseAddress, 0, SizeInBytes ); - - lcd_printf("\f"); +#if !defined(BUILD_RTM) + //DEBUG_TRACE4( STREAM_LCD, ".NetMF v%d.%d.%d.%d\r\n", VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION); + //DEBUG_TRACE3(TRACE_ALWAYS, "%s, Build Date:\r\n\t%s %s\r\n", HalName, __DATE__, __TIME__); + + #if defined(__GNUC__) + //DEBUG_TRACE1(TRACE_ALWAYS, "GNU Compiler version %d\r\n", __GNUC__); + #else + //DEBUG_TRACE1(TRACE_ALWAYS, "ARM Compiler version %d\r\n", __ARMCC_VERSION); + #endif - lcd_printf("%-15s\r\n", HalName); - lcd_printf("%-15s\r\n", "Build Date:"); - lcd_printf(" %-13s\r\n", __DATE__); - lcd_printf(" %-13s\r\n", __TIME__); + debug_printf("%-15s\r\n", HalName); + debug_printf("%-15s\r\n", "Build Date:"); + debug_printf(" %-13s\r\n", __DATE__); + debug_printf(" %-13s\r\n", __TIME__); #endif // !defined(BUILD_RTM) @@ -575,20 +337,15 @@ void BootEntry() #endif } - // - // the runtime is by default using a watchdog - // - Watchdog_GetSetTimeout ( WATCHDOG_TIMEOUT , TRUE ); Watchdog_GetSetBehavior( WATCHDOG_BEHAVIOR, TRUE ); Watchdog_GetSetEnabled ( WATCHDOG_ENABLE, TRUE ); - - + // HAL initialization completed. Interrupts are enabled. Jump to the Application routine ApplicationEntryPoint(); lcd_printf("\fmain exited!!???. Halting CPU\r\n"); - debug_printf("main exited!!???. Halting CPU\r\n"); + //debug_printf("main exited!!???. Halting CPU\r\n"); #if defined(BUILD_RTM) CPU_Reset(); @@ -599,6 +356,29 @@ void BootEntry() } // extern "C" +extern "C" void BootstrapCode(); + +// performs base level system initialization +// This typically consists of setting up clocks +// and PLLs along with any external memory needed +// to boot. +// NOTE: +// It is important to keep in mind that this is +// called *BEFORE* any C/C++ runtime initialization +// That is, zero init of uninitialied writeable data +// and copying of initialized values for initialized +// writeable data have not yet occured. Thus, any code +// called from SystemInit must not use or rely on +// initializtion having occured. This also precludes +// the use of any OS provided primitives and support +// as the kernel isn't initialized yet either. +extern "C" void SystemInit() +{ + BootstrapCode(); + CPU_Initialize(); + __enable_irq(); +} + //--// #if !defined(BUILD_RTM) @@ -701,78 +481,3 @@ BOOL SystemState_Query( SYSTEM_STATE State ) return SystemState_QueryNoLock( State ); } - -//--// - -#if !defined(BUILD_RTM) - -UINT32 Checksum_RAMConstants() -{ - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - UINT32 CRC; - - // start with Vector area CRC - CRC = SUPPORT_ComputeCRC( NULL, 0x00000020, 0 ); - - // add the big block of RAM constants to CRC - CRC = SUPPORT_ComputeCRC( RAMConstants, Length, CRC ); - - return CRC; -} - -void Verify_RAMConstants( void* arg ) -{ - BOOL BreakpointOnError = (BOOL)arg; - - //debug_printf("RAMC\r\n"); - - UINT32 CRC = Checksum_RAMConstants(); - - if(CRC != g_Boot_RAMConstants_CRC) - { - hal_printf( "RAMC CRC:%08x!=%08x\r\n", CRC, g_Boot_RAMConstants_CRC ); - - UINT32* ROMConstants = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - BOOL FoundMismatch = FALSE; - - for(int i = 0; i < Length; i += 4) - { - if(*RAMConstants != *ROMConstants) - { - hal_printf( "RAMC %08x:%08x!=%08x\r\n", (UINT32) RAMConstants, *RAMConstants, *ROMConstants ); - - if(!FoundMismatch) lcd_printf( "\fRAMC:%08x\r\n", (UINT32)RAMConstants ); // first one only to LCD - FoundMismatch = TRUE; - } - - RAMConstants++; - ROMConstants++; - } - - if(!FoundMismatch) - { - // the vector area must have been trashed - lcd_printf("\fRAMC:%08x\r\n", (UINT32) NULL); - RAMConstants = (UINT32*)NULL; - - for(int i = 0; i < 32; i += 4) - { - hal_printf( "RAMC %02x:%08x\r\n", i, *RAMConstants ); - lcd_printf( "%02x:%08x\r\n" , i, *RAMConstants++ ); - } - } - - DebuggerPort_Flush( HalSystemConfig.DebugTextPort ); - - if(BreakpointOnError) - { - HARD_BREAKPOINT(); - } - } -} - -#endif // !defined(BUILD_RTM) diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/GNU_S/VectorTable.s b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/GNU_S/VectorTable.s index b99e0a15e..490dd7e8f 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/GNU_S/VectorTable.s +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/GNU_S/VectorTable.s @@ -24,7 +24,7 @@ .arch armv7-m @ Initial Stack pointer for power on reset - .extern __initial_sp + .extern _estack @ Import standard Cortex-M handlers .extern Reset_Handler @@ -144,7 +144,7 @@ @ The first 16 entries are all architecturally defined by ARM ARM_Vectors: - .long __initial_sp @ Top of Stack + .long _estack @ Top of Stack .long Reset_Handler @ Reset Handler .long NMI_Handler @ NMI Handler .long HardFault_Handler @ Hard Fault Handler diff --git a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/STM32F4_bootstrap.cpp b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/STM32F4_bootstrap.cpp index 779e4dab8..f6af2a787 100644 --- a/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/STM32F4_bootstrap.cpp +++ b/DeviceCode/Targets/Native/STM32F4/DeviceCode/STM32F4_Bootstrap/STM32F4_bootstrap.cpp @@ -285,9 +285,7 @@ void __section("SectionForBootstrapOperations") STM32F4_BootstrapCode() __section("SectionForBootstrapOperations") void BootstrapCode() { STM32F4_BootstrapCode(); - - PrepareImageRegions(); - + BootstrapCode_GPIO(); } 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/include/tinyhal.h b/DeviceCode/include/tinyhal.h index 12df2f1c7..f9d0160cd 100644 --- a/DeviceCode/include/tinyhal.h +++ b/DeviceCode/include/tinyhal.h @@ -1155,119 +1155,9 @@ extern INT64 s_timewarp_compensate; extern int HeapBegin; extern int HeapEnd; -extern int CustomHeapBegin; -extern int CustomHeapEnd; -extern int StackBottom; -extern int StackTop; - -#if !defined(BUILD_RTM) - -// Registers[n] == Rn in ARM terms, R13=sp, R14=lr, R15=pc -typedef void (*AbortHandlerFunc)(UINT32 cpsr, UINT32 Registers[16]); - -extern "C" -{ -void StackOverflow( UINT32 sp ); - -void NULL_Pointer_Write(); -} - -UINT32 Stack_MaxUsed(); - -#endif #endif // defined(PLATFORM_ARM) -//--// - -// Simple Heap is for use by Porting Kit users who need private memory allocation. -/************************************************************************************* -** -** Function: SimpleHeap_Allocate -** -** Synopsis: Initializes simple heap from supplied buffer. -** Pointer to buffer is saved in global variable. -** Later is used for allocation of blocks by SimpleHeap_Allocate -** -** Arguments: [pHeapBuffer] - Pointer to heap buffer. This pointer is saved in global variable, -** later used by SimpleHeap_* function. -** [pHeapBuffer] - Size of memory block pointed by pHeapBuffer -** -**************************************************************************************/ -void SimpleHeap_Initialize( void* pHeapBuffer, UINT32 heapBuufferSize ); - -/********************************************************************** -** -** Function: SimpleHeap_Allocate -** -** Synopsis: Allocates block of memory from heap buffer initialized by SimpleHeap_Initialize -** -** -** Arguments: [len] - Size of block to allocate. -** -** Returns: Pointer to newly allocated memory - or NULL if there is no free memory to accomodate block of size len -**********************************************************************/ -void* SimpleHeap_Allocate ( size_t len ); - -/********************************************************************** -** -** Function: SimpleHeap_Release -** -** Synopsis: Releases memory block allocated by SimpleHeap_Allocate -** -** -** Arguments: [pHeapBlock] - Memory block to release. -** -**********************************************************************/ -void SimpleHeap_Release ( void* pHeapBlock ); - - -/********************************************************************** -** -** Function: SimpleHeap_ReAllocate -** -** Synopsis: Reallocates memory on an existing pointer and copies bck the -** data -** -** Arguments: [pHeapBlock] - Memory block to reallocate. -** Arguments: [len] - Size of block to allocate. -** -**********************************************************************/ -void* SimpleHeap_ReAllocate( void* pHeapBlock, size_t len ); - -/********************************************************************** -** -** Function: SimpleHeap_IsAllocated -** -** Synopsis: Checks if pHeapBlock points to memory block allocated by SimpleHeap_Allocate -** -** Arguments: [pHeapBlock] - Memory block to release. -** -** Returns: TRUE if pHeapBlock points to memory allocated, FALSE otherwise. -**********************************************************************/ -BOOL SimpleHeap_IsAllocated( void* pHeapBlock ); - -/********************************************************************** -** -** Function: HAL_Init_Custom_Heap -** -** Synopsis: Initializes simple heap with memory buffer provided by CustomHeapLocation function. -** -**********************************************************************/ -inline void HAL_Init_Custom_Heap() -{ - UINT8* BaseAddress = 0; - UINT32 SizeInBytes = 0; - - // Retrieve location for Custom Heap. The location is defined in scatter file. - CustomHeapLocation( BaseAddress, SizeInBytes ); - - // Initialize custom heap with heap block returned from CustomHeapLocation - SimpleHeap_Initialize( BaseAddress, SizeInBytes ); -} - - //--// // hal cleanup for CLR reboot @@ -1303,7 +1193,7 @@ template __inline void private_release( T& ref ) { ref = NULL; - private_free( ptr ); + free( ptr ); } } @@ -1311,25 +1201,6 @@ template __inline void private_release( T& ref ) __inline void* ReAllocate_NotImplemented( void * ptr, size_t len ) { ASSERT(FALSE); return NULL; } -//--// - -#define HAL_DECLARE_CUSTOM_HEAP(allocFtn,freeFtn,reallocFtn) \ - extern "C" { \ - void* private_malloc ( size_t len ) { return allocFtn ( len ); } \ - void private_free ( void* ptr ) { freeFtn ( ptr ); } \ - void* private_realloc( void* ptr, size_t len ) { return reallocFtn( ptr, len ); } \ - } - -#define HAL_DECLARE_NULL_HEAP() \ - extern "C" { \ - void* private_malloc ( size_t len ) { return NULL; } \ - void private_free ( void* ptr ) { } \ - void* private_realloc( void * ptr, size_t len ) { return NULL; } \ - } - - -//--// - extern UINT32 LOAD_IMAGE_Start; extern UINT32 LOAD_IMAGE_Length; extern UINT32 LOAD_IMAGE_CRC; diff --git a/DeviceCode/pal/COM/usb/usb.cpp b/DeviceCode/pal/COM/usb/usb.cpp index 56ea0c0ab..a3acae6d0 100644 --- a/DeviceCode/pal/COM/usb/usb.cpp +++ b/DeviceCode/pal/COM/usb/usb.cpp @@ -330,13 +330,13 @@ int USB_Driver::Configure( int Controller, const USB_DYNAMIC_CONFIGURATION* Conf // if(State->Configuration != &UsbDefaultConfiguration) { - private_free((void*)State->Configuration); + free((void*)State->Configuration); } // // Make sure that we allocate the native configuration buffer, the one passed in will be garbage collected // - State->Configuration = (USB_DYNAMIC_CONFIGURATION*)private_malloc(Length); + State->Configuration = (USB_DYNAMIC_CONFIGURATION*)malloc(Length); // 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 b598573c4..d6c0fd37b 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 @@ -65,7 +65,7 @@ typedef int _ssize_t; typedef int ssize_t; #endif -#if defined(LITTLE_ENDIAN) +#if defined(NETMF_TARGET_LITTLE_ENDIAN) #define SSL_LONG_LITTLE_ENDIAN(x) (x) #define SSL_ntohl(x) SOCK_htonl(x) #else @@ -299,9 +299,9 @@ extern int hal_fprintf_ssl(OPENSSL_TYPE__FILE* x, const char* format, ... ); #define TINYCLR_SSL_QSORT qsort #define TINYCLR_SSL_EXIT(x) if (x==0) return else TINYCLR_SSL_ASSERT(x) #define TINYCLR_SSL_ABORT() {TINYCLR_SSL_PRINTF("%s:%d",__FILE__,__LINE__);TINYCLR_SSL_ASSERT(1);} -#define TINYCLR_SSL_MALLOC private_malloc -#define TINYCLR_SSL_FREE private_free -#define TINYCLR_SSL_REALLOC private_realloc +#define TINYCLR_SSL_MALLOC malloc +#define TINYCLR_SSL_FREE free +#define TINYCLR_SSL_REALLOC realloc #define TINYCLR_SSL_GETENV(x) (NULL) #else #define TINYCLR_SSL_STRCAT strcat diff --git a/DeviceCode/pal/SimpleHeap/SimpleHeap.cpp b/DeviceCode/pal/SimpleHeap/SimpleHeap.cpp deleted file mode 100644 index f64a9fa16..000000000 --- a/DeviceCode/pal/SimpleHeap/SimpleHeap.cpp +++ /dev/null @@ -1,298 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Copyright (c) Microsoft Corporation. All rights reserved. -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -#if defined(_DEBUG) -//#define SIMPLEHEAP_VERBOSE 1 -#define SIMPLEHEAD_DEBUG -#endif - -//#define SIMPLEHEAD_DEBUG -//#define SIMPLEHEAP_VERBOSE 1 - -#define SIMPLE_HEAP_GUARDWORD 1 - -struct BlockHeader -{ - struct BlockHeader* next; - struct BlockHeader* prev; - UINT32 length; - UINT32 signature; -#if defined(SIMPLE_HEAP_GUARDWORD) - UINT32 head_guard; -#endif -}; - -static const UINT32 c_Free = 0xDEADBEEF; -static const UINT32 c_Busy = 0xDEADBE5E; -#if defined(SIMPLE_HEAP_GUARDWORD) -static const UINT32 c_Guard = 0xbab1f00d; -#endif - -#if defined(SIMPLEHEAP_VERBOSE) -#if defined(PATCH_BUILD) -const UINT32 g_heapmem_used = 0; -#else -UINT32 g_heapmem_used = 0; -#endif // defined(PATCH_BUILD) -#endif - -#if defined(PATCH_BUILD) -static struct BlockHeader * const g_s_FirstCluster = NULL; -#else -static struct BlockHeader *g_s_FirstCluster; -#endif // defined(PATCH_BUILD) - -//--// - -void SimpleHeap_Initialize( void* buffer, UINT32 length ) -{ - struct BlockHeader **s_FirstCluster = (struct BlockHeader **) &g_s_FirstCluster; - - *s_FirstCluster = (struct BlockHeader *) buffer; - - (*s_FirstCluster)->length = length; - (*s_FirstCluster)->next = NULL; - (*s_FirstCluster)->prev = NULL; - (*s_FirstCluster)->signature = c_Free; -#if defined(SIMPLE_HEAP_GUARDWORD) - (*s_FirstCluster)->head_guard = c_Guard; -#endif -} - -//--// - -BOOL SimpleHeap_IsAllocated( void *ptr ) -{ - if(ptr) - { - struct BlockHeader* blk = (struct BlockHeader*)ptr; blk--; - - if(blk->signature == c_Busy) - { - return TRUE; - } - else if(blk->signature == c_Free) - { - return FALSE; - } - else - { - // corrupt pointer to memory - hal_printf( "SimpleHeap: Bad Ptr: 0x%08x\r\n", (size_t)ptr ); - ASSERT(0); - return FALSE; - } - } - - return FALSE; -} - -//--// - -void SimpleHeap_Release( void* ptr ) -{ -#if defined(SIMPLEHEAP_VERBOSE) - UINT32 *p_heapmem_used = (UINT32 *) &g_heapmem_used; -#endif // defined(SIMPLEHEAP_VERBOSE) - -#if defined(SIMPLEHEAP_VERBOSE) - //printf("SimpleHeap_Release(0x%08x)\r\n", (UINT32) ptr); -#endif - - if(ptr) - { - struct BlockHeader* next; - struct BlockHeader* prev; - struct BlockHeader* blk = (struct BlockHeader*)ptr; blk--; - -#if defined(SIMPLEHEAD_DEBUG) - if(blk->signature != c_Busy) - { - if(blk->signature != c_Free) - { - hal_printf( " Memory(%08x): CORRUPTION: %08x %08x\r\n", (UINT32) ptr, blk->signature, blk->length ); - } - else - { - hal_printf( " Memory(%08x): RELEASE TWICE: %08x\r\n", (UINT32) ptr, blk->length ); - } - HARD_BREAKPOINT(); - } -#endif - -#if defined(SIMPLE_HEAP_GUARDWORD) - if(blk->head_guard != c_Guard) - { - hal_printf( "SimpleHeap_Release: Memory block head corruption: %08x %08x\r\n", blk->head_guard, blk->length ); - HARD_BREAKPOINT(); - } - - if(*(UINT32*)((UINT32)&blk[0] + blk->length - sizeof( c_Guard )) != c_Guard) - { - hal_printf( "SimpleHeap_Release: Memory block tail corruption: %08x %08x\r\n", *(UINT32 *)((UINT32)&blk[0] + blk->length - sizeof( c_Guard )), blk->length ); - HARD_BREAKPOINT(); - } -#endif - - //--// - - blk->signature = c_Free; - -#if defined(SIMPLEHEAP_VERBOSE) - *p_heapmem_used -= blk->length; - - hal_printf("F:%4d:%08x T:%6d\r\n", blk->length, (UINT32) ptr, *p_heapmem_used); -#endif - // - // First merge with the following block, if free. - // - next = blk->next; - if(next && next->signature == c_Free) - { - struct BlockHeader* nextnext; - - blk->length += next->length; - - nextnext = next->next; - - blk->next = nextnext; - - if(nextnext) nextnext->prev = blk; - } - - // - // Then merge with the preceding block, if free. - // - prev = blk->prev; - if(prev && prev->signature == c_Free) - { - prev->length += blk->length; - - next = blk->next; - - prev->next = next; - - if(next) next->prev = prev; - } - } - else - { - // releasing a null pointer is OK - //ASSERT(0); - } -} - -//--// - -void* SimpleHeap_Allocate( size_t len ) -{ - struct BlockHeader **pptr = (struct BlockHeader **) &g_s_FirstCluster; - struct BlockHeader *ptr = *pptr; -#if defined(SIMPLEHEAP_VERBOSE) - UINT32 *p_heapmem_used = (UINT32 *) &g_heapmem_used; -#endif // defined(SIMPLEHEAP_VERBOSE) - -#if defined(SIMPLEHEAP_VERBOSE) - //printf("SimpleHeap_Allocate(%d)\r\n", len); - - //Events_WaitForEventsInternal(0, 30); // delay 30mSec to simulate a long GC/compact allocation -#endif - - len += sizeof( struct BlockHeader ); -#if defined(SIMPLE_HEAP_GUARDWORD) - len += sizeof( c_Guard ); // leave room for tail guard -#endif - len = (len + sizeof(UINT32) - 1) & ~(sizeof(UINT32)-1); - - while(ptr) - { - if(ptr->signature == c_Free && ptr->length >= len) - { - if(ptr->length <= (len + sizeof(struct BlockHeader)*2)) - { - // - // Perfect or almost perfect fit, nothing else to do. - // - - // note that ptr->length is set to block size, not allocated size, - // which then gets lost, so we can only check tail guard - // based on actual size, not requested size, blah... - break; - } - else - { - // - // Split the block in two. - // - struct BlockHeader* prev; - struct BlockHeader* next; - - prev = ptr; - ptr = (struct BlockHeader*)((UINT8*)ptr + ptr->length - len); - next = prev->next; - - ptr->next = next; - ptr->prev = prev; - - prev->next = ptr; - if(next) next->prev = ptr; - - ptr ->length = (int)len; - prev->length -= (int)len; - break; - } - } - - ptr = ptr->next; - } - - if(ptr) - { - ptr->signature = c_Busy; -#if defined(SIMPLE_HEAP_GUARDWORD) - ptr->head_guard = c_Guard; // set the head guard word - *(UINT32 *)((UINT32)&ptr[0] + ptr->length - sizeof( c_Guard )) = c_Guard; // set the tail guard word -#endif - -#if defined(SIMPLEHEAP_VERBOSE) - *p_heapmem_used += ptr->length; - - hal_printf("A:%4d:%08x T:%6d\r\n", len, (UINT32) &ptr[1], *p_heapmem_used); -#endif - return &ptr[1]; - } - else - { - hal_printf( " Memory: OUTOFMEMORY!! %d\r\n", len ); - -#if defined(SIMPLEHEAP_VERBOSE) - hal_printf("SimpleHeap_Allocate(%d)=0x%08x\r\n", len, NULL); -#endif - - return NULL; - } -} - -//--// - -void* SimpleHeap_ReAllocate( void* ptr, size_t len ) -{ - void* p = SimpleHeap_Allocate( len ); if(!p) return NULL; - - if(ptr) - { - struct BlockHeader* blk = (struct BlockHeader*)ptr; blk--; - - memcpy( p, ptr, len > blk->length ? blk->length : len ); - - SimpleHeap_Release( ptr ); - - ptr = p; - } - - return p; -} - diff --git a/DeviceCode/pal/SimpleHeap/dotNetMF.proj b/DeviceCode/pal/SimpleHeap/dotNetMF.proj deleted file mode 100644 index b3a995865..000000000 --- a/DeviceCode/pal/SimpleHeap/dotNetMF.proj +++ /dev/null @@ -1,47 +0,0 @@ - - - - SimpleHeap - - - {F10DFBFE-17D7-4BB5-A53E-8FB8BE11B3EF} - SimpleHeap unmanaged heap - PAL - SimpleHeap.$(LIB_EXT) - $(SPOCLIENT)\DeviceCode\PAL\SimpleHeap\dotNetMF.proj - SimpleHeap.$(LIB_EXT).manifest - System - - - - 4 - 0 - 0 - 0 - - 2009-04-30 - - - - - - False - False - - False - False - DeviceCode\pal\SimpleHeap - Library - false - 4.0.0.0 - - - - - - - - - - - \ No newline at end of file diff --git a/DeviceCode/pal/SimpleHeap/stubs/SimpleHeap_stubs.cpp b/DeviceCode/pal/SimpleHeap/stubs/SimpleHeap_stubs.cpp deleted file mode 100644 index 05c40f48c..000000000 --- a/DeviceCode/pal/SimpleHeap/stubs/SimpleHeap_stubs.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Copyright (c) Microsoft Corporation. All rights reserved. -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "tinyhal.h" - -//--// - -void SimpleHeap_Initialize( void* buffer, UINT32 length ) -{ -} - -void* SimpleHeap_Allocate( size_t len ) -{ - return NULL; -} - -void SimpleHeap_Release( void* ptr ) -{ -} - -void* SimpleHeap_ReAllocate( void* ptr, size_t len ) -{ - return NULL; -} diff --git a/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj b/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj deleted file mode 100644 index 03a14eea4..000000000 --- a/DeviceCode/pal/SimpleHeap/stubs/dotNetMF.proj +++ /dev/null @@ -1,44 +0,0 @@ - - - - SimpleHeap_stubs - - - {CFD0FC57-C506-461D-B460-9D44C8A6A6B6} - SimpleHeap unmanaged heap stub library - PAL - SimpleHeap_stubs.$(LIB_EXT) - $(SPOCLIENT)\DeviceCode\PAL\SimpleHeap\stubs\dotNetMF.proj - SimpleHeap_stubs.$(LIB_EXT).manifest - System - - - - 4 - 0 - 0 - 0 - - 2009-04-30 - - - - - - False - False - False - True - DeviceCode\pal\SimpleHeap\stubs - Library - false - 4.0.0.0 - - - - - - - - - \ No newline at end of file diff --git a/DeviceCode/pal/SimpleHeap_config/SimpleHeap_config.cpp b/DeviceCode/pal/SimpleHeap_config/SimpleHeap_config.cpp deleted file mode 100644 index 2cab5dd36..000000000 --- a/DeviceCode/pal/SimpleHeap_config/SimpleHeap_config.cpp +++ /dev/null @@ -1,40 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Copyright (c) Microsoft Corporation. All rights reserved. -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include - -/********************************************************************** -** -** Function: CustomHeapLocation retrives the buffer to be used for Simple Heap allocations -** PK customers need to implement this function if they want to use it with Simple Heap. -** This function returns the buffer location and the size of the buffer. -** inline void HAL_Init_Custom_Heap() ( in tynihal.h )calls CustomHeapLocation to retrive -** custom heap location and initialize custom heap. -** -** Arguments: [BaseAddress] - Reference to pointer to buffer for custom heap. Filled by function -** [SizeInBytes] - Reference to varialbe that receives size of the buffer. -**********************************************************************/ -void CustomHeapLocation( UINT8*& BaseAddress, UINT32& SizeInBytes ) - -{ - NATIVE_PROFILE_PAL_HEAP(); -#if defined (PLATFORM_ARM) - - BaseAddress = (UINT8*) &CustomHeapBegin; - SizeInBytes = (UINT32)((size_t)&CustomHeapEnd - (size_t)&CustomHeapBegin + sizeof(CustomHeapEnd)); - -#elif defined(PLATFORM_BLACKFIN) - - BaseAddress = 0; - SizeInBytes = 0; - -#elif defined(PLATFORM_SH) - - BaseAddress = 0; - SizeInBytes = 0; - - -#endif -} - diff --git a/DeviceCode/pal/SimpleHeap_config/Stubs/SimpleHeap_config_stubs.cpp b/DeviceCode/pal/SimpleHeap_config/Stubs/SimpleHeap_config_stubs.cpp deleted file mode 100644 index 93d38b1c3..000000000 --- a/DeviceCode/pal/SimpleHeap_config/Stubs/SimpleHeap_config_stubs.cpp +++ /dev/null @@ -1,16 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Copyright (c) Microsoft Corporation. All rights reserved. -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#include "tinyhal.h" - -//--// - -void CustomHeapLocation( UINT8*& BaseAddress, UINT32& SizeInBytes ) - -{ - NATIVE_PROFILE_PAL_HEAP(); - BaseAddress = 0; - SizeInBytes = 0; -} - diff --git a/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj b/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj deleted file mode 100644 index c64944a3f..000000000 --- a/DeviceCode/pal/SimpleHeap_config/Stubs/dotNetMF.proj +++ /dev/null @@ -1,44 +0,0 @@ - - - - SimpleHeap_config_stubs - - - {C2E23FAE-3112-4376-9D4B-08BB9523FA69} - SimpleHeap configuration stub library - PAL - SimpleHeap_config_stubs.$(LIB_EXT) - $(SPOCLIENT)\DeviceCode\PAL\SimpleHeap_config\Stubs\dotNetMF.proj - SimpleHeap_config_stubs.$(LIB_EXT).manifest - System - - - - 4 - 0 - 0 - 0 - - 2009-04-30 - - - - - - False - False - False - True - DeviceCode\pal\SimpleHeap_config\Stubs - Library - false - 4.0.0.0 - - - - - - - - - \ No newline at end of file diff --git a/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj b/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj deleted file mode 100644 index ab0eeb140..000000000 --- a/DeviceCode/pal/SimpleHeap_config/dotNetMF.proj +++ /dev/null @@ -1,46 +0,0 @@ - - - - SimpleHeap_config - - - {742F3095-DC26-4F8E-8689-74900D30602E} - Simple unmanaged heap - PAL - SimpleHeap_config.$(LIB_EXT) - $(SPOCLIENT)\DeviceCode\PAL\SimpleHeap_config\dotNetMF.proj - SimpleHeap_config.$(LIB_EXT).manifest - System - - - - 4 - 0 - 0 - 0 - - 2009-04-30 - - - - - - False - False - False - False - DeviceCode\pal\SimpleHeap_config - Library - false - 4.0.0.0 - - - - - - - - - - - \ No newline at end of file diff --git a/DeviceCode/pal/configuration/ConfigHelper.cpp b/DeviceCode/pal/configuration/ConfigHelper.cpp index 3bf81f25e..77eb1b23c 100644 --- a/DeviceCode/pal/configuration/ConfigHelper.cpp +++ b/DeviceCode/pal/configuration/ConfigHelper.cpp @@ -193,7 +193,7 @@ BOOL HAL_CONFIG_BLOCK::CompactBlock(HAL_CONFIG_BLOCK_STORAGE_DATA& blData, const int saveLength = (UINT32)cfgEnd - blData.ConfigAddress; // - UINT8 *pBackup = (UINT8*)private_malloc( saveLength ); + UINT8 *pBackup = (UINT8*)malloc( saveLength ); if(pBackup) { @@ -228,7 +228,7 @@ BOOL HAL_CONFIG_BLOCK::CompactBlock(HAL_CONFIG_BLOCK_STORAGE_DATA& blData, const fRet = blData.Device->Write((UINT32)blData.ConfigAddress, writeLength, pBackup, FALSE); // if the heap is not yet initialized this does nothing - private_free( pBackup ); + free( pBackup ); } return fRet; @@ -305,7 +305,7 @@ BOOL HAL_CONFIG_BLOCK::UpdateBlockWithName( const char* Name, void* Data, size_t } else { - pXipConfigBuf = (BYTE*)private_malloc(blData.BlockLength); + pXipConfigBuf = (BYTE*)malloc(blData.BlockLength); if(pXipConfigBuf != NULL) { @@ -349,7 +349,7 @@ BOOL HAL_CONFIG_BLOCK::UpdateBlockWithName( const char* Name, void* Data, size_t physAddr = (const void*)(blData.ConfigAddress + ((size_t)pConfig - (size_t)pXipConfigBuf)); physEnd = (const void*)(blData.ConfigAddress + ((size_t)pLastConfig - (size_t)pXipConfigBuf)); - private_free(pXipConfigBuf); + free(pXipConfigBuf); pXipConfigBuf = NULL; } @@ -395,7 +395,7 @@ BOOL HAL_CONFIG_BLOCK::UpdateBlockWithName( const char* Name, void* Data, size_t if(pXipConfigBuf != NULL) { - private_free(pXipConfigBuf); + free(pXipConfigBuf); } return fRet; @@ -428,7 +428,7 @@ BOOL HAL_CONFIG_BLOCK::ApplyConfig( const char* Name, void* Address, size_t Leng } else { - pXipConfigBuf = (BYTE*)private_malloc(blData.BlockLength); + pXipConfigBuf = (BYTE*)malloc(blData.BlockLength); if(pXipConfigBuf != NULL) @@ -448,7 +448,7 @@ BOOL HAL_CONFIG_BLOCK::ApplyConfig( const char* Name, void* Address, size_t Leng { if(newAlloc != NULL) { - *newAlloc = private_malloc(header->Size); + *newAlloc = malloc(header->Size); if(*newAlloc) { @@ -470,7 +470,7 @@ BOOL HAL_CONFIG_BLOCK::ApplyConfig( const char* Name, void* Address, size_t Leng if(pXipConfigBuf != NULL) { - private_free(pXipConfigBuf); + free(pXipConfigBuf); } return FALSE; diff --git a/DeviceCode/pal/dotNetMF.proj b/DeviceCode/pal/dotNetMF.proj index 7bbee8a98..7e4b7109a 100644 --- a/DeviceCode/pal/dotNetMF.proj +++ b/DeviceCode/pal/dotNetMF.proj @@ -31,10 +31,6 @@ - - - - diff --git a/DeviceCode/pal/fs/fs_pal.cpp b/DeviceCode/pal/fs/fs_pal.cpp index df7b6a79a..0b7a9e3b7 100644 --- a/DeviceCode/pal/fs/fs_pal.cpp +++ b/DeviceCode/pal/fs/fs_pal.cpp @@ -118,7 +118,7 @@ void FS_MountVolume( LPCSTR nameSpace, UINT32 serialNumber, UINT32 deviceFlags, { current->Unlink(); - private_free( current ); + free( current ); } current = next; @@ -146,7 +146,7 @@ void FS_MountVolume( LPCSTR nameSpace, UINT32 serialNumber, UINT32 deviceFlags, for (i = 0; i < numVolumes; i++) { // Allocate the memory for this FileSystemVolume - volume = (FileSystemVolume*)private_malloc( sizeof(FileSystemVolume) ); + volume = (FileSystemVolume*)malloc( sizeof(FileSystemVolume) ); if(!volume) // allocation failed { @@ -160,7 +160,7 @@ void FS_MountVolume( LPCSTR nameSpace, UINT32 serialNumber, UINT32 deviceFlags, streamDriver, fsDriver, blockStorageDevice, i, (fsDriver) ? TRUE : FALSE )) // init only when we have a valid fsDriver { // If for some reason, AddVolume fails, we'll keep trying other volumes - private_free( volume ); + free( volume ); continue; } 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/DeviceCode/pal/piezo/Piezo.cpp b/DeviceCode/pal/piezo/Piezo.cpp index 90213d1d9..245f5fbf9 100644 --- a/DeviceCode/pal/piezo/Piezo.cpp +++ b/DeviceCode/pal/piezo/Piezo.cpp @@ -153,7 +153,7 @@ BOOL Piezo_Driver::Tone( UINT32 Frequency_Hertz, UINT32 Duration_Milliseconds ) // irq.Release(); - Tone = (PIEZO_TONE*)private_malloc( sizeof(PIEZO_TONE) ); + Tone = (PIEZO_TONE*)malloc( sizeof(PIEZO_TONE) ); Tone->Initialize(); @@ -254,7 +254,7 @@ void Piezo_Driver::ToneRelease( void* Param ) // irq.Release(); - private_free( Tone ); + free( Tone ); irq.Acquire(); } @@ -338,7 +338,7 @@ BOOL PolyphonicPiezo_Driver::Tone( const PIEZO_POLY_TONE& ToneRef ) // irq.Release(); - Tone = (PIEZO_POLY_TONE*)private_malloc( sizeof(PIEZO_POLY_TONE) ); + Tone = (PIEZO_POLY_TONE*)malloc( sizeof(PIEZO_POLY_TONE) ); irq.Acquire(); } @@ -440,7 +440,7 @@ void PolyphonicPiezo_Driver::ToneRelease( void* Param ) // irq.Release(); - private_free( Tone ); + free( Tone ); irq.Acquire(); } diff --git a/Framework/Features/Graphics.featureproj b/Framework/Features/Graphics.featureproj index 49e4c3bf2..ed4c78ef8 100644 --- a/Framework/Features/Graphics.featureproj +++ b/Framework/Features/Graphics.featureproj @@ -14,7 +14,6 @@ - Core graphics functionality {af24014a-d92b-44dd-a6d0-d46d14d553cc} diff --git a/ProjectTemplates/NativeSample/NativeSample.cpp b/ProjectTemplates/NativeSample/NativeSample.cpp index ae8d13f4c..c7d2b7b47 100644 --- a/ProjectTemplates/NativeSample/NativeSample.cpp +++ b/ProjectTemplates/NativeSample/NativeSample.cpp @@ -7,9 +7,6 @@ #include #include "nativesample.h" - -HAL_DECLARE_NULL_HEAP(); - void PostManagedEvent( UINT8 category, UINT8 subCategory, UINT16 data1, UINT32 data2 ) { } diff --git a/ProjectTemplates/PortBooter/portBooter.cpp b/ProjectTemplates/PortBooter/portBooter.cpp index 49129c1e6..0fca2d883 100644 --- a/ProjectTemplates/PortBooter/portBooter.cpp +++ b/ProjectTemplates/PortBooter/portBooter.cpp @@ -710,8 +710,6 @@ XREC_Handler g_XREC; //--// -HAL_DECLARE_NULL_HEAP(); - void ApplicationEntryPoint() { UINT32 ComEvent; diff --git a/ProjectTemplates/PortBooter/portBooterLoader.cpp b/ProjectTemplates/PortBooter/portBooterLoader.cpp index ffd2a1482..f80d71f93 100644 --- a/ProjectTemplates/PortBooter/portBooterLoader.cpp +++ b/ProjectTemplates/PortBooter/portBooterLoader.cpp @@ -13,8 +13,6 @@ typedef unsigned char UINT8; int LZ77_Decompress( UINT8* inBuf, int inSize, UINT8* outBuf, int outSize ); -HAL_DECLARE_NULL_HEAP(); - extern "C" { void BootEntryLoader() diff --git a/Solutions/MCBSTM32F400/DeviceCode/Initialization/tinyhal.cpp b/Solutions/MCBSTM32F400/DeviceCode/Initialization/tinyhal.cpp index a81e9ebdf..97e1e1e27 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/Initialization/tinyhal.cpp +++ b/Solutions/MCBSTM32F400/DeviceCode/Initialization/tinyhal.cpp @@ -24,44 +24,6 @@ #undef DEBUG_TRACE #define DEBUG_TRACE (TRACE_ALWAYS) -// these define the region to zero initialize -extern UINT32 Image$$ER_RAM_RW$$ZI$$Base; -extern UINT32 Image$$ER_RAM_RW$$ZI$$Length; - -// here is the execution address/length of code to move from FLASH to RAM -#define IMAGE_RAM_RO_BASE Image$$ER_RAM_RO$$Base -#define IMAGE_RAM_RO_LENGTH Image$$ER_RAM_RO$$Length - -extern UINT32 IMAGE_RAM_RO_BASE; -extern UINT32 IMAGE_RAM_RO_LENGTH; - -// here is the execution address/length of data to move from FLASH to RAM -extern UINT32 Image$$ER_RAM_RW$$Base; -extern UINT32 Image$$ER_RAM_RW$$Length; - -// here is the load address of the RAM code/data -#define LOAD_RAM_RO_BASE Load$$ER_RAM_RO$$Base - -extern UINT32 LOAD_RAM_RO_BASE; -extern UINT32 Load$$ER_RAM_RW$$Base; - -#if defined(TARGETLOCATION_RAM) - -extern UINT32 Load$$ER_RAM$$Base; -extern UINT32 Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - -extern UINT32 Load$$ER_FLASH$$Base; -extern UINT32 Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - -UINT32 LOAD_IMAGE_Start; -UINT32 LOAD_IMAGE_Length; -UINT32 LOAD_IMAGE_CalcCRC; #if defined(PLATFORM_ARM_OS_PORT) && defined(TCPIP_LWIP_OS) extern UINT32 Load$$ER_LWIP_OS$$RW$$Base; @@ -124,64 +86,10 @@ static void __section("SectionForBootstrapOperations") Prepare_Zero( UINT32* dst } } -#if !defined(PLATFORM_ARM_OS_PORT) || defined(__GNUC__) -void __section("SectionForBootstrapOperations") PrepareImageRegions() -{ - // - // Copy RAM RO regions into proper location. - // - { - UINT32* src = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* dst = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 len = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - Prepare_Copy( src, dst, len ); - } - - // - // Copy RAM RW regions into proper location. - // - { - UINT32* src = (UINT32*)&Load$$ER_RAM_RW$$Base; - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$Base; - UINT32 len = (UINT32)&Image$$ER_RAM_RW$$Length; - - Prepare_Copy( src, dst, len ); - } - - // - // Initialize RAM ZI regions. - // - { - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$ZI$$Base; - UINT32 len = (UINT32 )&Image$$ER_RAM_RW$$ZI$$Length; - - Prepare_Zero( dst, len ); - } -} -#else -extern "C" void PrepareImageRegions() -{ - // This space intentionally left blank... 8^) - // - // The OS boot of CLR on CMSIS-RTX doesn't - // use this as it relies on the C/C++ runtime - // to handle initialization. However, to keep - // from adding more libraries or #if checks - // in code this is defined to allow normal - // linking with the same HAL libs used in a - // boot loader. -} -#endif - #pragma arm section code //--// -#if !defined(BUILD_RTM) -static UINT32 g_Boot_RAMConstants_CRC = 0; -#endif - static ON_SOFT_REBOOT_HANDLER s_rebootHandlers[16] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; void HAL_AddSoftRebootHandler(ON_SOFT_REBOOT_HANDLER handler) @@ -276,7 +184,7 @@ void HAL_EnterBooterMode() ::Watchdog_ResetCounter(); - BYTE *data = (BYTE*) private_malloc(pBlockRegionInfo->BytesPerBlock); + BYTE *data = (BYTE*) malloc(pBlockRegionInfo->BytesPerBlock); if(data != NULL) { @@ -305,7 +213,7 @@ void HAL_EnterBooterMode() // write back to sector, as we only change one bit from 0 to 1, no need to erase sector bRet = (TRUE == pBlockDevice->Write( configSectAddress, pBlockRegionInfo->BytesPerBlock, data, FALSE )); - private_free(data); + free(data); } } @@ -331,8 +239,6 @@ void HAL_Initialize() HAL_CONTINUATION::InitializeList(); HAL_COMPLETION ::InitializeList(); - HAL_Init_Custom_Heap(); - Time_Initialize(); Events_Initialize(); @@ -512,61 +418,10 @@ void HAL_Uninitialize() extern "C" { -#if defined( __GNUC__ ) - extern "C++" int main(void); - extern void __libc_init_array(); - void __main() - { - // Copy writeable data and zero init BSS - PrepareImageRegions(); - - // Call static constructors - __libc_init_array(); - - // Call the application's entry point. - main(); - } -#endif #if !defined(PLATFORM_ARM_OS_PORT) void BootEntry() { -#if !defined(BUILD_RTM) - { - int marker; - int* ptr = &marker - 1; // This will point to the current top of the stack. - int* end = &StackBottom; - - while(ptr >= end) - { - *ptr-- = 0xBAADF00D; - } - } -#endif - - // these are needed for patch access - -#if defined(TARGETLOCATION_RAM) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_RAM$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_FLASH$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - - LOAD_IMAGE_Length += (UINT32)&IMAGE_RAM_RO_LENGTH + (UINT32)&Image$$ER_RAM_RW$$Length; - -#if !defined(BUILD_RTM) - g_Boot_RAMConstants_CRC = Checksum_RAMConstants(); -#endif - - CPU_Initialize(); HAL_Time_Initialize(); @@ -582,12 +437,6 @@ void BootEntry() DEBUG_TRACE1(TRACE_ALWAYS, "ARM Compiler version %d\r\n", __ARMCC_VERSION); #endif - UINT8* BaseAddress; - UINT32 SizeInBytes; - - HeapLocation( BaseAddress, SizeInBytes ); - memset ( BaseAddress, 0, SizeInBytes ); - debug_printf("\f"); debug_printf("%-15s\r\n", HalName); @@ -629,7 +478,7 @@ void BootEntry() #if defined(PLATFORM_ARM_OS_PORT) -extern "C" void STM32F4_BootstrapCode(); +extern "C" void BootstrapCode(); // performs base level system initialization // This typically consists of setting up clocks @@ -647,7 +496,7 @@ extern "C" void STM32F4_BootstrapCode(); // as the kernel isn't initialized yet either. extern "C" void SystemInit() { - STM32F4_BootstrapCode(); + BootstrapCode(); CPU_Initialize(); __enable_irq(); } @@ -685,76 +534,3 @@ void lcd_printf( const char* format, ... ) } #endif // !defined(BUILD_RTM) - -#if !defined(BUILD_RTM) - -UINT32 Checksum_RAMConstants() -{ - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - UINT32 crc; - - // start with Vector area CRC - crc = SUPPORT_ComputeCRC(NULL, 0x00000020, 0); - - // add the big block of RAM constants to CRC - crc = SUPPORT_ComputeCRC(RAMConstants, Length, crc); - - return crc; -} - -void Verify_RAMConstants( void* arg ) -{ - BOOL BreakpointOnError = (BOOL)arg; - - //debug_printf("RAMC\r\n"); - - UINT32 crc = Checksum_RAMConstants(); - - if (crc != g_Boot_RAMConstants_CRC) - { - hal_printf("RAMC CRC:%08x!=%08x\r\n", crc, g_Boot_RAMConstants_CRC); - - UINT32* ROMConstants = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - BOOL FoundMismatch = FALSE; - - for(int i = 0; i < Length; i += 4) - { - if(*RAMConstants != *ROMConstants) - { - hal_printf( "RAMC %08x:%08x!=%08x\r\n", (UINT32) RAMConstants, *RAMConstants, *ROMConstants ); - - if(!FoundMismatch) lcd_printf( "\fRAMC:%08x\r\n", (UINT32)RAMConstants ); // first one only to LCD - FoundMismatch = TRUE; - } - - RAMConstants++; - ROMConstants++; - } - - if(!FoundMismatch) - { - // the vector area must have been trashed - lcd_printf("\fRAMC:%08x\r\n", (UINT32) NULL); - RAMConstants = (UINT32*)NULL; - - for(int i = 0; i < 32; i += 4) - { - hal_printf( "RAMC %02x:%08x\r\n", i, *RAMConstants ); - lcd_printf( "%02x:%08x\r\n" , i, *RAMConstants++ ); - } - } - - DebuggerPort_Flush( HalSystemConfig.DebugTextPort ); - - if(BreakpointOnError) - { - HARD_BREAKPOINT(); - } - } -} - -#endif // !defined(BUILD_RTM) diff --git a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/AppEntry.s b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/AppEntry.s index 9fe126a4a..fb3ec1e85 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/AppEntry.s +++ b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/AppEntry.s @@ -24,44 +24,32 @@ .global EntryPoint - .global StackBottom - .global StackTop .global HeapBegin .global HeapEnd - .global CustomHeapBegin - .global CustomHeapEnd - .global __initial_sp + .global _stack .global Reset_Handler .extern SystemInit - .extern __main @************************************************************************* - .section SectionForStackBottom, "w", %nobits -StackBottom: - .word 0 - - .section SectionForStackTop, "w", %nobits -__initial_sp: -StackTop: - .word 0 - - .section SectionForHeapBegin, "w", %nobits -HeapBegin: - .word 0 - - .section SectionForHeapEnd, "w", %nobits -HeapEnd: - .word 0 - - .section SectionForCustomHeapBegin, "w", %nobits -CustomHeapBegin: - .word 0 - - .section SectionForCustomHeapEnd, "w", %nobits -CustomHeapEnd: - .word 0 + /* start address for the initialization values of the .data section. + defined in linker script */ + .word _sidata + /* start address for the .data section. defined in linker script */ + .word _sdata + /* end address for the .data section. defined in linker script */ + .word _edata + /* start address for the .bss section. defined in linker script */ + .word _sbss + /* end address for the .bss section. defined in linker script */ + .word _ebss + /* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + + /* start address of managed heap */ + .word HeapBegin + /* end address of managed heap */ + .word HeapEnd .section i.EntryPoint, "ax", %progbits EntryPoint: @@ -96,12 +84,45 @@ EntryPoint: Reset_Handler: @@ reload the stack pointer as there's no returning to the loader - ldr sp, =__initial_sp - LDR R0, =SystemInit - BLX R0 - LDR R0, =__main - BX R0 - + ldr sp, =_estack /* set stack pointer */ + + /* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + + /* Call the clock system intitialization function.*/ + bl SystemInit + + /* Call static constructors */ + bl __libc_init_array + + /* Call the application's entry point.*/ + bl main + bx lr .pool .size Reset_Handler, . - Reset_Handler diff --git a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/FirstEntry.s b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/FirstEntry.s index d181e5576..6d660149e 100644 --- a/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/FirstEntry.s +++ b/Solutions/MCBSTM32F400/DeviceCode/TinyHal/GNU_S/FirstEntry.s @@ -16,47 +16,35 @@ .thumb .global EntryPoint - .global __initial_sp .global Reset_Handler - .global StackBottom - .global StackTop .global HeapBegin .global HeapEnd - .global CustomHeapBegin - .global CustomHeapEnd + .global _end .global PowerOnReset - .extern PreStackInit - .extern BootEntry .extern BootstrapCode @************************************************************************* - .section SectionForStackBottom, "w", %nobits -StackBottom: - .word 0 - - .section SectionForStackTop, "w", %nobits -__initial_sp: -StackTop: - .word 0 - - .section SectionForHeapBegin, "w", %nobits -HeapBegin: - .word 0 - - .section SectionForHeapEnd, "w", %nobits -HeapEnd: - .word 0 - - .section SectionForCustomHeapBegin, "w", %nobits -CustomHeapBegin: - .word 0 - - .section SectionForCustomHeapEnd, "w", %nobits -CustomHeapEnd: - .word 0 + /* start address for the initialization values of the .data section. + defined in linker script */ + .word _sidata + /* start address for the .data section. defined in linker script */ + .word _sdata + /* end address for the .data section. defined in linker script */ + .word _edata + /* start address for the .bss section. defined in linker script */ + .word _sbss + /* end address for the .bss section. defined in linker script */ + .word _ebss + /* stack used for SystemInit_ExtMemCtl; always internal RAM used */ + + /* start address of managed heap */ + .word HeapBegin + /* end address of managed heap */ + .word HeapEnd + @ Power On Reset vector table for the device @ This is placed at physical address 0 by the @@ -68,7 +56,7 @@ CustomHeapEnd: .section SectionForPowerOnReset, "x", %progbits PowerOnReset: - .word __initial_sp + .word _estack .word Reset_Handler @ Reset .word Fault_Handler @ NMI .word Fault_Handler @ Hard Fault @@ -86,11 +74,47 @@ PowerOnReset: .section i.EntryPoint, "ax", %progbits EntryPoint: Reset_Handler: - bl BootstrapCode - b BootEntry + ldr sp, =_estack /* set stack pointer */ + + /* Copy the data segment initializers from flash to SRAM */ + movs r1, #0 + b LoopCopyDataInit + +CopyDataInit: + ldr r3, =_sidata + ldr r3, [r3, r1] + str r3, [r0, r1] + adds r1, r1, #4 + +LoopCopyDataInit: + ldr r0, =_sdata + ldr r3, =_edata + adds r2, r0, r1 + cmp r2, r3 + bcc CopyDataInit + ldr r2, =_sbss + b LoopFillZerobss +/* Zero fill the bss segment. */ +FillZerobss: + movs r3, #0 + str r3, [r2], #4 + +LoopFillZerobss: + ldr r3, = _ebss + cmp r2, r3 + bcc FillZerobss + + /* Call the clock system intitialization function.*/ + bl SystemInit + /* Call static constructors */ + bl __libc_init_array + /* Call the application's entry point.*/ + + bl main + bx lr .pool - .size Reset_Handler, . - Reset_Handler + .size Reset_Handler, .-Reset_Handler .balign 4 diff --git a/Solutions/MCBSTM32F400/MCBSTM32F400.settings b/Solutions/MCBSTM32F400/MCBSTM32F400.settings index 19746763e..4283412de 100644 --- a/Solutions/MCBSTM32F400/MCBSTM32F400.settings +++ b/Solutions/MCBSTM32F400/MCBSTM32F400.settings @@ -14,6 +14,7 @@ le true LWIP_1_4_1_OS + true Copyright (C) Microsoft Corporation diff --git a/Solutions/MCBSTM32F400/MCBSTM32F400_NONET.settings b/Solutions/MCBSTM32F400/MCBSTM32F400_NONET.settings index c9faee51e..0a94c5049 100644 --- a/Solutions/MCBSTM32F400/MCBSTM32F400_NONET.settings +++ b/Solutions/MCBSTM32F400/MCBSTM32F400_NONET.settings @@ -13,6 +13,7 @@ True le true + true Copyright (C) Microsoft .NET Foundation diff --git a/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj b/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj index 269feb407..a6db61d8e 100644 --- a/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj +++ b/Solutions/MCBSTM32F400/MicroBooter/MicroBooter.proj @@ -119,14 +119,6 @@ - - - - - - - - diff --git a/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj b/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj index d9d1375cf..7ce02a0fb 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj +++ b/Solutions/MCBSTM32F400/TinyBooter/TinyBooter.proj @@ -23,6 +23,8 @@ $(ExtraTargets);CompressBin scatterfile_bootloader_$(COMPILER_TOOL).$(SCATTER_EXT) scatterfile_bootloader_$(COMPILER_TOOL).$(SCATTER_EXT) + + true @@ -145,14 +147,6 @@ - - - - - - - - diff --git a/Solutions/MCBSTM32F400/TinyBooter/allocator.cpp b/Solutions/MCBSTM32F400/TinyBooter/allocator.cpp index 59ddd068e..4336cb48d 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/allocator.cpp +++ b/Solutions/MCBSTM32F400/TinyBooter/allocator.cpp @@ -41,3 +41,16 @@ void operator delete[] (void*) } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml b/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml index 1237b057d..64154ce85 100644 --- a/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml +++ b/Solutions/MCBSTM32F400/TinyBooter/scatterfile_bootloader_gcc.xml @@ -70,8 +70,7 @@ - - + @@ -81,7 +80,6 @@ with the SWD pins used for ETM tracing in Debug builds. --> - @@ -106,17 +104,59 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + @@ -139,63 +189,73 @@ - - - - - - + + + + + + + + + + + + + + + + + - - + + + + + - - - - - - - - + + + + + + + + + + + + + - - - + - + - - - + + - - - + + + + + + + - - - - - - - - - - - - - - - diff --git a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj index 2869bc261..ae97e0bb4 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj +++ b/Solutions/MCBSTM32F400/TinyCLR/TinyCLR.proj @@ -27,6 +27,8 @@ false $(BIN_DIR)\$(AssemblyName).dat $(SRC_DIR)\scatterfile_$(AssemblyName)_$(COMPILER_TOOL).$(SCATTER_EXT) + + true EntryPoint TinyClr_Dat_Start g_ConfigurationSector @@ -210,14 +212,6 @@ - - - - - - - - diff --git a/Solutions/MCBSTM32F400/TinyCLR/allocator.cpp b/Solutions/MCBSTM32F400/TinyCLR/allocator.cpp index 372f95138..03d64fe12 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/allocator.cpp +++ b/Solutions/MCBSTM32F400/TinyCLR/allocator.cpp @@ -10,22 +10,35 @@ void *operator new( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void *operator new[]( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void operator delete( void* p ) { - return private_free( p ); + return free( p ); } void operator delete[]( void* p ) { - return private_free( p ); + return free( p ); } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml b/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml index 4fdb0b8f4..80033a149 100644 --- a/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml +++ b/Solutions/MCBSTM32F400/TinyCLR/scatterfile_tinyclr_gcc.xml @@ -38,6 +38,7 @@ + - @@ -80,7 +80,6 @@ with the SWD pins used for ETM tracing in Debug builds. --> - @@ -107,27 +106,58 @@ + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + - - - - - + + + + + + + + + + - - - - - + + - - - + + + + + - - - - - - + + + + + + + - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -236,14 +266,25 @@ actual physical CCM space. The CRT startup code will initialize the region and, if the aligned size puts the end outside of physical memory it will generate an imprecise abort. --> - - - - - - + + + + + + + + + + + + @@ -255,22 +296,6 @@ - - - - - - - - - - - - - - - - diff --git a/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj b/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj index 868d7a2c6..4cf849daf 100644 --- a/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj +++ b/Solutions/MCBSTM32F400/TinyCLR_NONET/TinyCLR_NONET.proj @@ -27,6 +27,8 @@ false $(BIN_DIR)\$(AssemblyName).dat $(SRC_DIR)\scatterfile_$(AssemblyName)_$(COMPILER_TOOL).$(SCATTER_EXT) + + true EntryPoint TinyClr_Dat_Start g_ConfigurationSector @@ -178,14 +180,6 @@ - - - - - - - - diff --git a/Solutions/MCBSTM32F400/TinyCLR_NONET/allocator.cpp b/Solutions/MCBSTM32F400/TinyCLR_NONET/allocator.cpp index 372f95138..03d64fe12 100644 --- a/Solutions/MCBSTM32F400/TinyCLR_NONET/allocator.cpp +++ b/Solutions/MCBSTM32F400/TinyCLR_NONET/allocator.cpp @@ -10,22 +10,35 @@ void *operator new( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void *operator new[]( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void operator delete( void* p ) { - return private_free( p ); + return free( p ); } void operator delete[]( void* p ) { - return private_free( p ); + return free( p ); } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/MCBSTM32F400/TinyCLR_NONET/scatterfile_tinyclr_nonet_gcc.xml b/Solutions/MCBSTM32F400/TinyCLR_NONET/scatterfile_tinyclr_nonet_gcc.xml index c3c7be81f..a9980cf18 100644 --- a/Solutions/MCBSTM32F400/TinyCLR_NONET/scatterfile_tinyclr_nonet_gcc.xml +++ b/Solutions/MCBSTM32F400/TinyCLR_NONET/scatterfile_tinyclr_nonet_gcc.xml @@ -70,7 +70,6 @@ - @@ -80,7 +79,7 @@ with the SWD pins used for ETM tracing in Debug builds. --> - + @@ -105,19 +104,60 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - - - + + + + + + + + + + + - - - - + + - - - - - - + + + + + - - + + + + + + + + - - + + + + + + - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + @@ -197,17 +269,6 @@ - - - - - - - - - - - diff --git a/Solutions/MCBSTM32F400/build_gcc.cmd b/Solutions/MCBSTM32F400/build_gcc.cmd new file mode 100644 index 000000000..f6baecc68 --- /dev/null +++ b/Solutions/MCBSTM32F400/build_gcc.cmd @@ -0,0 +1,11 @@ +echo off +echo Set Environnement variables for GCC +call E:\GitHub\netmf-interpreter\setenv_gcc 5.4.1 E:\GNU_Tools_ARM_Embedded\5_4_2016q2 +call msbuild /t:rebuild /p:flavor=release;memory=flash /filelogger /flp:verbosity=detailed /clp:verbosity=minimal /maxcpucount +del E:\GitHub\netmf-interpreter\BuildOutput\THUMB2FP\GCC4.9\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.bin\*.bin +ren E:\GitHub\netmf-interpreter\BuildOutput\THUMB2FP\GCC4.9\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.bin\ER_CONFIG ER_CONFIG.bin +ren E:\GitHub\netmf-interpreter\BuildOutput\THUMB2FP\GCC4.9\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.bin\ER_FLASH ER_FLASH.bin +del E:\GitHub\netmf-interpreter\BuildOutput\THUMB2FP\GCC4.9\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.hex\*.hex +ren E:\GitHub\netmf-interpreter\BuildOutput\THUMB2FP\GCC4.9\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.hex\ER_CONFIG ER_CONFIG.hex +ren E:\GitHub\netmf-interpreter\BuildOutput\THUMB2FP\GCC4.9\le\FLASH\release\STM32F4DISCOVERY\bin\tinyclr.hex\ER_FLASH ER_FLASH.hex +pause \ No newline at end of file diff --git a/Solutions/MCBSTM32F400/dotnetmf.proj b/Solutions/MCBSTM32F400/dotnetmf.proj index 0904d3e23..fb7f0e76d 100644 --- a/Solutions/MCBSTM32F400/dotnetmf.proj +++ b/Solutions/MCBSTM32F400/dotnetmf.proj @@ -7,7 +7,7 @@ - + diff --git a/Solutions/MCBSTM32F400/scatterfile_gcc_missing_symbols.xml b/Solutions/MCBSTM32F400/scatterfile_gcc_missing_symbols.xml deleted file mode 100644 index 65d649caa..000000000 --- a/Solutions/MCBSTM32F400/scatterfile_gcc_missing_symbols.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Solutions/STM32F429IDISCOVERY/DeviceCode/Initialization/tinyhal.cpp b/Solutions/STM32F429IDISCOVERY/DeviceCode/Initialization/tinyhal.cpp index a81e9ebdf..29663c3c2 100644 --- a/Solutions/STM32F429IDISCOVERY/DeviceCode/Initialization/tinyhal.cpp +++ b/Solutions/STM32F429IDISCOVERY/DeviceCode/Initialization/tinyhal.cpp @@ -24,44 +24,6 @@ #undef DEBUG_TRACE #define DEBUG_TRACE (TRACE_ALWAYS) -// these define the region to zero initialize -extern UINT32 Image$$ER_RAM_RW$$ZI$$Base; -extern UINT32 Image$$ER_RAM_RW$$ZI$$Length; - -// here is the execution address/length of code to move from FLASH to RAM -#define IMAGE_RAM_RO_BASE Image$$ER_RAM_RO$$Base -#define IMAGE_RAM_RO_LENGTH Image$$ER_RAM_RO$$Length - -extern UINT32 IMAGE_RAM_RO_BASE; -extern UINT32 IMAGE_RAM_RO_LENGTH; - -// here is the execution address/length of data to move from FLASH to RAM -extern UINT32 Image$$ER_RAM_RW$$Base; -extern UINT32 Image$$ER_RAM_RW$$Length; - -// here is the load address of the RAM code/data -#define LOAD_RAM_RO_BASE Load$$ER_RAM_RO$$Base - -extern UINT32 LOAD_RAM_RO_BASE; -extern UINT32 Load$$ER_RAM_RW$$Base; - -#if defined(TARGETLOCATION_RAM) - -extern UINT32 Load$$ER_RAM$$Base; -extern UINT32 Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - -extern UINT32 Load$$ER_FLASH$$Base; -extern UINT32 Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - -UINT32 LOAD_IMAGE_Start; -UINT32 LOAD_IMAGE_Length; -UINT32 LOAD_IMAGE_CalcCRC; #if defined(PLATFORM_ARM_OS_PORT) && defined(TCPIP_LWIP_OS) extern UINT32 Load$$ER_LWIP_OS$$RW$$Base; @@ -124,56 +86,6 @@ static void __section("SectionForBootstrapOperations") Prepare_Zero( UINT32* dst } } -#if !defined(PLATFORM_ARM_OS_PORT) || defined(__GNUC__) -void __section("SectionForBootstrapOperations") PrepareImageRegions() -{ - // - // Copy RAM RO regions into proper location. - // - { - UINT32* src = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* dst = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 len = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - Prepare_Copy( src, dst, len ); - } - - // - // Copy RAM RW regions into proper location. - // - { - UINT32* src = (UINT32*)&Load$$ER_RAM_RW$$Base; - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$Base; - UINT32 len = (UINT32)&Image$$ER_RAM_RW$$Length; - - Prepare_Copy( src, dst, len ); - } - - // - // Initialize RAM ZI regions. - // - { - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$ZI$$Base; - UINT32 len = (UINT32 )&Image$$ER_RAM_RW$$ZI$$Length; - - Prepare_Zero( dst, len ); - } -} -#else -extern "C" void PrepareImageRegions() -{ - // This space intentionally left blank... 8^) - // - // The OS boot of CLR on CMSIS-RTX doesn't - // use this as it relies on the C/C++ runtime - // to handle initialization. However, to keep - // from adding more libraries or #if checks - // in code this is defined to allow normal - // linking with the same HAL libs used in a - // boot loader. -} -#endif - #pragma arm section code //--// @@ -276,7 +188,7 @@ void HAL_EnterBooterMode() ::Watchdog_ResetCounter(); - BYTE *data = (BYTE*) private_malloc(pBlockRegionInfo->BytesPerBlock); + BYTE *data = (BYTE*) malloc(pBlockRegionInfo->BytesPerBlock); if(data != NULL) { @@ -305,7 +217,7 @@ void HAL_EnterBooterMode() // write back to sector, as we only change one bit from 0 to 1, no need to erase sector bRet = (TRUE == pBlockDevice->Write( configSectAddress, pBlockRegionInfo->BytesPerBlock, data, FALSE )); - private_free(data); + free(data); } } @@ -331,8 +243,6 @@ void HAL_Initialize() HAL_CONTINUATION::InitializeList(); HAL_COMPLETION ::InitializeList(); - HAL_Init_Custom_Heap(); - Time_Initialize(); Events_Initialize(); @@ -512,55 +422,10 @@ void HAL_Uninitialize() extern "C" { -#if defined( __GNUC__ ) - extern "C++" int main(void); - extern void __libc_init_array(); - void __main() - { - // Copy writeable data and zero init BSS - PrepareImageRegions(); - - // Call static constructors - __libc_init_array(); - - // Call the application's entry point. - main(); - } -#endif #if !defined(PLATFORM_ARM_OS_PORT) void BootEntry() { -#if !defined(BUILD_RTM) - { - int marker; - int* ptr = &marker - 1; // This will point to the current top of the stack. - int* end = &StackBottom; - - while(ptr >= end) - { - *ptr-- = 0xBAADF00D; - } - } -#endif - - // these are needed for patch access - -#if defined(TARGETLOCATION_RAM) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_RAM$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_FLASH$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - - LOAD_IMAGE_Length += (UINT32)&IMAGE_RAM_RO_LENGTH + (UINT32)&Image$$ER_RAM_RW$$Length; #if !defined(BUILD_RTM) g_Boot_RAMConstants_CRC = Checksum_RAMConstants(); @@ -582,12 +447,6 @@ void BootEntry() DEBUG_TRACE1(TRACE_ALWAYS, "ARM Compiler version %d\r\n", __ARMCC_VERSION); #endif - UINT8* BaseAddress; - UINT32 SizeInBytes; - - HeapLocation( BaseAddress, SizeInBytes ); - memset ( BaseAddress, 0, SizeInBytes ); - debug_printf("\f"); debug_printf("%-15s\r\n", HalName); @@ -629,7 +488,7 @@ void BootEntry() #if defined(PLATFORM_ARM_OS_PORT) -extern "C" void STM32F4_BootstrapCode(); +extern "C" void BootstrapCode(); // performs base level system initialization // This typically consists of setting up clocks @@ -647,7 +506,7 @@ extern "C" void STM32F4_BootstrapCode(); // as the kernel isn't initialized yet either. extern "C" void SystemInit() { - STM32F4_BootstrapCode(); + BootstrapCode(); CPU_Initialize(); __enable_irq(); } @@ -685,76 +544,3 @@ void lcd_printf( const char* format, ... ) } #endif // !defined(BUILD_RTM) - -#if !defined(BUILD_RTM) - -UINT32 Checksum_RAMConstants() -{ - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - UINT32 crc; - - // start with Vector area CRC - crc = SUPPORT_ComputeCRC(NULL, 0x00000020, 0); - - // add the big block of RAM constants to CRC - crc = SUPPORT_ComputeCRC(RAMConstants, Length, crc); - - return crc; -} - -void Verify_RAMConstants( void* arg ) -{ - BOOL BreakpointOnError = (BOOL)arg; - - //debug_printf("RAMC\r\n"); - - UINT32 crc = Checksum_RAMConstants(); - - if (crc != g_Boot_RAMConstants_CRC) - { - hal_printf("RAMC CRC:%08x!=%08x\r\n", crc, g_Boot_RAMConstants_CRC); - - UINT32* ROMConstants = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - BOOL FoundMismatch = FALSE; - - for(int i = 0; i < Length; i += 4) - { - if(*RAMConstants != *ROMConstants) - { - hal_printf( "RAMC %08x:%08x!=%08x\r\n", (UINT32) RAMConstants, *RAMConstants, *ROMConstants ); - - if(!FoundMismatch) lcd_printf( "\fRAMC:%08x\r\n", (UINT32)RAMConstants ); // first one only to LCD - FoundMismatch = TRUE; - } - - RAMConstants++; - ROMConstants++; - } - - if(!FoundMismatch) - { - // the vector area must have been trashed - lcd_printf("\fRAMC:%08x\r\n", (UINT32) NULL); - RAMConstants = (UINT32*)NULL; - - for(int i = 0; i < 32; i += 4) - { - hal_printf( "RAMC %02x:%08x\r\n", i, *RAMConstants ); - lcd_printf( "%02x:%08x\r\n" , i, *RAMConstants++ ); - } - } - - DebuggerPort_Flush( HalSystemConfig.DebugTextPort ); - - if(BreakpointOnError) - { - HARD_BREAKPOINT(); - } - } -} - -#endif // !defined(BUILD_RTM) diff --git a/Solutions/STM32F429IDISCOVERY/STM32F429IDISCOVERY.settings b/Solutions/STM32F429IDISCOVERY/STM32F429IDISCOVERY.settings index e3f266ea0..41d37d7a9 100644 --- a/Solutions/STM32F429IDISCOVERY/STM32F429IDISCOVERY.settings +++ b/Solutions/STM32F429IDISCOVERY/STM32F429IDISCOVERY.settings @@ -16,6 +16,7 @@ True le true + true STM32F429IDISCOVERY by CW2 diff --git a/Solutions/STM32F429IDISCOVERY/TinyBooter/TinyBooter.proj b/Solutions/STM32F429IDISCOVERY/TinyBooter/TinyBooter.proj index d26cd7174..704a44650 100644 --- a/Solutions/STM32F429IDISCOVERY/TinyBooter/TinyBooter.proj +++ b/Solutions/STM32F429IDISCOVERY/TinyBooter/TinyBooter.proj @@ -24,6 +24,8 @@ $(ExtraTargets);CompressBin scatterfile_bootloader_$(COMPILER_TOOL).$(SCATTER_EXT) scatterfile_bootloader_$(COMPILER_TOOL).$(SCATTER_EXT) + + true @@ -146,14 +148,6 @@ - - - - - - - - diff --git a/Solutions/STM32F429IDISCOVERY/TinyBooter/allocator.cpp b/Solutions/STM32F429IDISCOVERY/TinyBooter/allocator.cpp index 59ddd068e..4336cb48d 100644 --- a/Solutions/STM32F429IDISCOVERY/TinyBooter/allocator.cpp +++ b/Solutions/STM32F429IDISCOVERY/TinyBooter/allocator.cpp @@ -41,3 +41,16 @@ void operator delete[] (void*) } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/STM32F429IDISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml b/Solutions/STM32F429IDISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml index a43701875..7ed13b14c 100644 --- a/Solutions/STM32F429IDISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml +++ b/Solutions/STM32F429IDISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml @@ -43,12 +43,9 @@ - - - - - - + + + @@ -72,17 +69,59 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + + + - + + + + + - - + - - + + + + + + - + - - - + - - - - + + - - - + + + + + + + + - - - - - - - - - - - - - - diff --git a/Solutions/STM32F429IDISCOVERY/TinyCLR/TinyCLR.proj b/Solutions/STM32F429IDISCOVERY/TinyCLR/TinyCLR.proj index 144360047..b71d3373f 100644 --- a/Solutions/STM32F429IDISCOVERY/TinyCLR/TinyCLR.proj +++ b/Solutions/STM32F429IDISCOVERY/TinyCLR/TinyCLR.proj @@ -32,7 +32,7 @@ TinyClr_Dat_Start g_ConfigurationSector - false + true @@ -181,14 +181,6 @@ - - - - - - - - diff --git a/Solutions/STM32F429IDISCOVERY/TinyCLR/allocator.cpp b/Solutions/STM32F429IDISCOVERY/TinyCLR/allocator.cpp index 372f95138..03d64fe12 100644 --- a/Solutions/STM32F429IDISCOVERY/TinyCLR/allocator.cpp +++ b/Solutions/STM32F429IDISCOVERY/TinyCLR/allocator.cpp @@ -10,22 +10,35 @@ void *operator new( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void *operator new[]( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void operator delete( void* p ) { - return private_free( p ); + return free( p ); } void operator delete[]( void* p ) { - return private_free( p ); + return free( p ); } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/STM32F429IDISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml b/Solutions/STM32F429IDISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml index df984719e..790fa7bc6 100644 --- a/Solutions/STM32F429IDISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml +++ b/Solutions/STM32F429IDISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml @@ -50,12 +50,9 @@ - - - - - - + + + @@ -79,20 +76,61 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + @@ -126,40 +193,49 @@ - - + + + + + + + + + + + + + - - - - - - - - + + + + + + - - - - - + + + - - - - + + - - - - + + - - - + + + + @@ -167,17 +243,6 @@ - - - - - - - - - - - diff --git a/Solutions/STM32F429IDISCOVERY/scatterfile_gcc_missing_symbols.xml b/Solutions/STM32F429IDISCOVERY/scatterfile_gcc_missing_symbols.xml deleted file mode 100644 index 424b8c97f..000000000 --- a/Solutions/STM32F429IDISCOVERY/scatterfile_gcc_missing_symbols.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/tinyhal.cpp b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/tinyhal.cpp index a81e9ebdf..facb63aee 100644 --- a/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/tinyhal.cpp +++ b/Solutions/STM32F4DISCOVERY/DeviceCode/Initialization/tinyhal.cpp @@ -24,44 +24,6 @@ #undef DEBUG_TRACE #define DEBUG_TRACE (TRACE_ALWAYS) -// these define the region to zero initialize -extern UINT32 Image$$ER_RAM_RW$$ZI$$Base; -extern UINT32 Image$$ER_RAM_RW$$ZI$$Length; - -// here is the execution address/length of code to move from FLASH to RAM -#define IMAGE_RAM_RO_BASE Image$$ER_RAM_RO$$Base -#define IMAGE_RAM_RO_LENGTH Image$$ER_RAM_RO$$Length - -extern UINT32 IMAGE_RAM_RO_BASE; -extern UINT32 IMAGE_RAM_RO_LENGTH; - -// here is the execution address/length of data to move from FLASH to RAM -extern UINT32 Image$$ER_RAM_RW$$Base; -extern UINT32 Image$$ER_RAM_RW$$Length; - -// here is the load address of the RAM code/data -#define LOAD_RAM_RO_BASE Load$$ER_RAM_RO$$Base - -extern UINT32 LOAD_RAM_RO_BASE; -extern UINT32 Load$$ER_RAM_RW$$Base; - -#if defined(TARGETLOCATION_RAM) - -extern UINT32 Load$$ER_RAM$$Base; -extern UINT32 Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - -extern UINT32 Load$$ER_FLASH$$Base; -extern UINT32 Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - -UINT32 LOAD_IMAGE_Start; -UINT32 LOAD_IMAGE_Length; -UINT32 LOAD_IMAGE_CalcCRC; #if defined(PLATFORM_ARM_OS_PORT) && defined(TCPIP_LWIP_OS) extern UINT32 Load$$ER_LWIP_OS$$RW$$Base; @@ -124,64 +86,10 @@ static void __section("SectionForBootstrapOperations") Prepare_Zero( UINT32* dst } } -#if !defined(PLATFORM_ARM_OS_PORT) || defined(__GNUC__) -void __section("SectionForBootstrapOperations") PrepareImageRegions() -{ - // - // Copy RAM RO regions into proper location. - // - { - UINT32* src = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* dst = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 len = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - Prepare_Copy( src, dst, len ); - } - - // - // Copy RAM RW regions into proper location. - // - { - UINT32* src = (UINT32*)&Load$$ER_RAM_RW$$Base; - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$Base; - UINT32 len = (UINT32)&Image$$ER_RAM_RW$$Length; - - Prepare_Copy( src, dst, len ); - } - - // - // Initialize RAM ZI regions. - // - { - UINT32* dst = (UINT32*)&Image$$ER_RAM_RW$$ZI$$Base; - UINT32 len = (UINT32 )&Image$$ER_RAM_RW$$ZI$$Length; - - Prepare_Zero( dst, len ); - } -} -#else -extern "C" void PrepareImageRegions() -{ - // This space intentionally left blank... 8^) - // - // The OS boot of CLR on CMSIS-RTX doesn't - // use this as it relies on the C/C++ runtime - // to handle initialization. However, to keep - // from adding more libraries or #if checks - // in code this is defined to allow normal - // linking with the same HAL libs used in a - // boot loader. -} -#endif - #pragma arm section code //--// -#if !defined(BUILD_RTM) -static UINT32 g_Boot_RAMConstants_CRC = 0; -#endif - static ON_SOFT_REBOOT_HANDLER s_rebootHandlers[16] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; void HAL_AddSoftRebootHandler(ON_SOFT_REBOOT_HANDLER handler) @@ -276,7 +184,7 @@ void HAL_EnterBooterMode() ::Watchdog_ResetCounter(); - BYTE *data = (BYTE*) private_malloc(pBlockRegionInfo->BytesPerBlock); + BYTE *data = (BYTE*) malloc(pBlockRegionInfo->BytesPerBlock); if(data != NULL) { @@ -305,7 +213,7 @@ void HAL_EnterBooterMode() // write back to sector, as we only change one bit from 0 to 1, no need to erase sector bRet = (TRUE == pBlockDevice->Write( configSectAddress, pBlockRegionInfo->BytesPerBlock, data, FALSE )); - private_free(data); + free(data); } } @@ -316,7 +224,7 @@ void HAL_EnterBooterMode() bool g_fDoNotUninitializeDebuggerPort = false; void HAL_Initialize() -{ +{ #if defined(PLATFORM_ARM_OS_PORT) // Interrupts must be enabled to handle calls to OS // (Network stack uses the CMSIS-RTX OS, which uses @@ -331,8 +239,6 @@ void HAL_Initialize() HAL_CONTINUATION::InitializeList(); HAL_COMPLETION ::InitializeList(); - HAL_Init_Custom_Heap(); - Time_Initialize(); Events_Initialize(); @@ -512,61 +418,10 @@ void HAL_Uninitialize() extern "C" { -#if defined( __GNUC__ ) - extern "C++" int main(void); - extern void __libc_init_array(); - void __main() - { - // Copy writeable data and zero init BSS - PrepareImageRegions(); - - // Call static constructors - __libc_init_array(); - - // Call the application's entry point. - main(); - } -#endif #if !defined(PLATFORM_ARM_OS_PORT) void BootEntry() { -#if !defined(BUILD_RTM) - { - int marker; - int* ptr = &marker - 1; // This will point to the current top of the stack. - int* end = &StackBottom; - - while(ptr >= end) - { - *ptr-- = 0xBAADF00D; - } - } -#endif - - // these are needed for patch access - -#if defined(TARGETLOCATION_RAM) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_RAM$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_RAM$$Length; - -#elif defined(TARGETLOCATION_FLASH) - - LOAD_IMAGE_Start = (UINT32)&Load$$ER_FLASH$$Base; - LOAD_IMAGE_Length = (UINT32)&Image$$ER_FLASH$$Length; - -#else - !ERROR -#endif - - LOAD_IMAGE_Length += (UINT32)&IMAGE_RAM_RO_LENGTH + (UINT32)&Image$$ER_RAM_RW$$Length; - -#if !defined(BUILD_RTM) - g_Boot_RAMConstants_CRC = Checksum_RAMConstants(); -#endif - - CPU_Initialize(); HAL_Time_Initialize(); @@ -582,12 +437,6 @@ void BootEntry() DEBUG_TRACE1(TRACE_ALWAYS, "ARM Compiler version %d\r\n", __ARMCC_VERSION); #endif - UINT8* BaseAddress; - UINT32 SizeInBytes; - - HeapLocation( BaseAddress, SizeInBytes ); - memset ( BaseAddress, 0, SizeInBytes ); - debug_printf("\f"); debug_printf("%-15s\r\n", HalName); @@ -628,8 +477,7 @@ void BootEntry() } // extern "C" -#if defined(PLATFORM_ARM_OS_PORT) -extern "C" void STM32F4_BootstrapCode(); +extern "C" void BootstrapCode(); // performs base level system initialization // This typically consists of setting up clocks @@ -647,13 +495,11 @@ extern "C" void STM32F4_BootstrapCode(); // as the kernel isn't initialized yet either. extern "C" void SystemInit() { - STM32F4_BootstrapCode(); + BootstrapCode(); CPU_Initialize(); __enable_irq(); } -#endif //PLATFORM_ARM_OS_PORT - #if !defined(BUILD_RTM) void debug_printf( const char* format, ... ) @@ -685,76 +531,3 @@ void lcd_printf( const char* format, ... ) } #endif // !defined(BUILD_RTM) - -#if !defined(BUILD_RTM) - -UINT32 Checksum_RAMConstants() -{ - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - - UINT32 crc; - - // start with Vector area CRC - crc = SUPPORT_ComputeCRC(NULL, 0x00000020, 0); - - // add the big block of RAM constants to CRC - crc = SUPPORT_ComputeCRC(RAMConstants, Length, crc); - - return crc; -} - -void Verify_RAMConstants( void* arg ) -{ - BOOL BreakpointOnError = (BOOL)arg; - - //debug_printf("RAMC\r\n"); - - UINT32 crc = Checksum_RAMConstants(); - - if (crc != g_Boot_RAMConstants_CRC) - { - hal_printf("RAMC CRC:%08x!=%08x\r\n", crc, g_Boot_RAMConstants_CRC); - - UINT32* ROMConstants = (UINT32*)&LOAD_RAM_RO_BASE; - UINT32* RAMConstants = (UINT32*)&IMAGE_RAM_RO_BASE; - UINT32 Length = (UINT32 )&IMAGE_RAM_RO_LENGTH; - BOOL FoundMismatch = FALSE; - - for(int i = 0; i < Length; i += 4) - { - if(*RAMConstants != *ROMConstants) - { - hal_printf( "RAMC %08x:%08x!=%08x\r\n", (UINT32) RAMConstants, *RAMConstants, *ROMConstants ); - - if(!FoundMismatch) lcd_printf( "\fRAMC:%08x\r\n", (UINT32)RAMConstants ); // first one only to LCD - FoundMismatch = TRUE; - } - - RAMConstants++; - ROMConstants++; - } - - if(!FoundMismatch) - { - // the vector area must have been trashed - lcd_printf("\fRAMC:%08x\r\n", (UINT32) NULL); - RAMConstants = (UINT32*)NULL; - - for(int i = 0; i < 32; i += 4) - { - hal_printf( "RAMC %02x:%08x\r\n", i, *RAMConstants ); - lcd_printf( "%02x:%08x\r\n" , i, *RAMConstants++ ); - } - } - - DebuggerPort_Flush( HalSystemConfig.DebugTextPort ); - - if(BreakpointOnError) - { - HARD_BREAKPOINT(); - } - } -} - -#endif // !defined(BUILD_RTM) diff --git a/Solutions/STM32F4DISCOVERY/STM32F4DISCOVERY.settings b/Solutions/STM32F4DISCOVERY/STM32F4DISCOVERY.settings index a2a5d139c..82c3da8a5 100644 --- a/Solutions/STM32F4DISCOVERY/STM32F4DISCOVERY.settings +++ b/Solutions/STM32F4DISCOVERY/STM32F4DISCOVERY.settings @@ -16,6 +16,7 @@ True le true + true diff --git a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj index d8c4f5188..92cb3ffef 100644 --- a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj +++ b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj @@ -23,6 +23,8 @@ $(ExtraTargets);CompressBin scatterfile_bootloader_$(COMPILER_TOOL).$(SCATTER_EXT) scatterfile_bootloader_$(COMPILER_TOOL).$(SCATTER_EXT) + + true @@ -146,12 +148,12 @@ - - + + - - + + diff --git a/Solutions/STM32F4DISCOVERY/TinyBooter/allocator.cpp b/Solutions/STM32F4DISCOVERY/TinyBooter/allocator.cpp index 59ddd068e..4336cb48d 100644 --- a/Solutions/STM32F4DISCOVERY/TinyBooter/allocator.cpp +++ b/Solutions/STM32F4DISCOVERY/TinyBooter/allocator.cpp @@ -41,3 +41,16 @@ void operator delete[] (void*) } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/STM32F4DISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml b/Solutions/STM32F4DISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml index 9b7ada5df..f3129408d 100644 --- a/Solutions/STM32F4DISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml +++ b/Solutions/STM32F4DISCOVERY/TinyBooter/scatterfile_bootloader_gcc.xml @@ -43,12 +43,9 @@ - - - - - - + + + @@ -72,17 +69,59 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - + + + + + + @@ -105,62 +154,72 @@ - - - - - - + + + + + + + + + + + + + + + + + - - - - + + + + + - - - - - + + + + + - - + - - + + + + + + - + - - - + - - - - + + - - - + + + + + + + + - - - - - - - - - - - diff --git a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj index bb8254842..c3161ee1a 100644 --- a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj +++ b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj @@ -31,7 +31,7 @@ TinyClr_Dat_Start g_ConfigurationSector - false + true diff --git a/Solutions/STM32F4DISCOVERY/TinyCLR/allocator.cpp b/Solutions/STM32F4DISCOVERY/TinyCLR/allocator.cpp index 372f95138..03d64fe12 100644 --- a/Solutions/STM32F4DISCOVERY/TinyCLR/allocator.cpp +++ b/Solutions/STM32F4DISCOVERY/TinyCLR/allocator.cpp @@ -10,22 +10,35 @@ void *operator new( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void *operator new[]( size_t n ) { - return private_malloc( n ); + return malloc( n ); } void operator delete( void* p ) { - return private_free( p ); + return free( p ); } void operator delete[]( void* p ) { - return private_free( p ); + return free( p ); } //////////////////////////////////////////////////////////////////////////////// + +// the following remapping seems to be required by the crypto libs, as soon as those are reworked this should be removed +// remap private_malloc to standard C malloc +void *private_malloc(size_t size) +{ + return malloc(size); +} + +// remap private_free to standard C free +void private_free(void *ptr) +{ + free(ptr); +} diff --git a/Solutions/STM32F4DISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml b/Solutions/STM32F4DISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml index ad604bb70..b1b4a75c5 100644 --- a/Solutions/STM32F4DISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml +++ b/Solutions/STM32F4DISCOVERY/TinyCLR/scatterfile_tinyclr_gcc.xml @@ -48,14 +48,11 @@ - + - - - - - - + + + @@ -77,22 +74,63 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - - - - - + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - + + + + + + - + - - - + - - - - + + - - - - + + - - - + + + + @@ -167,17 +237,6 @@ - - - - - - - - - - - diff --git a/Solutions/STM32F4DISCOVERY/scatterfile_gcc_missing_symbols.xml b/Solutions/STM32F4DISCOVERY/scatterfile_gcc_missing_symbols.xml deleted file mode 100644 index 65d649caa..000000000 --- a/Solutions/STM32F4DISCOVERY/scatterfile_gcc_missing_symbols.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/Solutions/Template/PortBooter/portBooter.cpp b/Solutions/Template/PortBooter/portBooter.cpp index 53328c034..61a41b02f 100644 --- a/Solutions/Template/PortBooter/portBooter.cpp +++ b/Solutions/Template/PortBooter/portBooter.cpp @@ -710,8 +710,6 @@ XREC_Handler g_XREC; //--// -HAL_DECLARE_NULL_HEAP(); - void ApplicationEntryPoint() { UINT32 ComEvent; diff --git a/Solutions/Template/PortBooter/portBooter.proj b/Solutions/Template/PortBooter/portBooter.proj index 687ff2d1e..169a4c3f5 100644 --- a/Solutions/Template/PortBooter/portBooter.proj +++ b/Solutions/Template/PortBooter/portBooter.proj @@ -85,14 +85,6 @@ - - - - - - - - diff --git a/Solutions/Template/PortBooter/portBooterLoader.cpp b/Solutions/Template/PortBooter/portBooterLoader.cpp index ffd2a1482..f80d71f93 100644 --- a/Solutions/Template/PortBooter/portBooterLoader.cpp +++ b/Solutions/Template/PortBooter/portBooterLoader.cpp @@ -13,8 +13,6 @@ typedef unsigned char UINT8; int LZ77_Decompress( UINT8* inBuf, int inSize, UINT8* outBuf, int outSize ); -HAL_DECLARE_NULL_HEAP(); - extern "C" { void BootEntryLoader() diff --git a/Solutions/Template/PortBooter/portBooterloader.proj b/Solutions/Template/PortBooter/portBooterloader.proj index b6ee84757..f00bbf011 100644 --- a/Solutions/Template/PortBooter/portBooterloader.proj +++ b/Solutions/Template/PortBooter/portBooterloader.proj @@ -82,14 +82,6 @@ - - - - - - - - diff --git a/Solutions/Template/TinyBooter/TinyBooter.proj b/Solutions/Template/TinyBooter/TinyBooter.proj index 6ac4f5fc9..146aa440c 100644 --- a/Solutions/Template/TinyBooter/TinyBooter.proj +++ b/Solutions/Template/TinyBooter/TinyBooter.proj @@ -91,14 +91,6 @@ - - - - - - - - diff --git a/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj b/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj index f0a0b59ee..49d713df3 100644 --- a/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj +++ b/Solutions/Template/TinyBooter/TinyBooterDecompressor.proj @@ -91,14 +91,6 @@ - - - - - - - - diff --git a/Solutions/Template/TinyCLR/TinyCLR.proj b/Solutions/Template/TinyCLR/TinyCLR.proj index 70319017c..d5ea436a9 100644 --- a/Solutions/Template/TinyCLR/TinyCLR.proj +++ b/Solutions/Template/TinyCLR/TinyCLR.proj @@ -115,14 +115,6 @@ - - - - - - - - diff --git a/Solutions/Template_BE/NativeSample/NativeSample.cpp b/Solutions/Template_BE/NativeSample/NativeSample.cpp index 8fb075b38..466b6780c 100644 --- a/Solutions/Template_BE/NativeSample/NativeSample.cpp +++ b/Solutions/Template_BE/NativeSample/NativeSample.cpp @@ -8,8 +8,6 @@ //--// -HAL_DECLARE_NULL_HEAP(); - void ApplicationEntryPoint() { BOOL result; diff --git a/Solutions/Template_BE/NativeSample/NativeSample.proj b/Solutions/Template_BE/NativeSample/NativeSample.proj index b88e58eb0..a003d45af 100644 --- a/Solutions/Template_BE/NativeSample/NativeSample.proj +++ b/Solutions/Template_BE/NativeSample/NativeSample.proj @@ -77,14 +77,6 @@ - - - - - - - - diff --git a/Solutions/Template_BE/PortBooter/portBooter.cpp b/Solutions/Template_BE/PortBooter/portBooter.cpp index 53328c034..61a41b02f 100644 --- a/Solutions/Template_BE/PortBooter/portBooter.cpp +++ b/Solutions/Template_BE/PortBooter/portBooter.cpp @@ -710,8 +710,6 @@ XREC_Handler g_XREC; //--// -HAL_DECLARE_NULL_HEAP(); - void ApplicationEntryPoint() { UINT32 ComEvent; diff --git a/Solutions/Template_BE/PortBooter/portBooter.proj b/Solutions/Template_BE/PortBooter/portBooter.proj index 133c34dba..b22cdc04c 100644 --- a/Solutions/Template_BE/PortBooter/portBooter.proj +++ b/Solutions/Template_BE/PortBooter/portBooter.proj @@ -89,14 +89,6 @@ - - - - - - - - diff --git a/Solutions/Template_BE/PortBooter/portBooterLoader.cpp b/Solutions/Template_BE/PortBooter/portBooterLoader.cpp index ffd2a1482..f80d71f93 100644 --- a/Solutions/Template_BE/PortBooter/portBooterLoader.cpp +++ b/Solutions/Template_BE/PortBooter/portBooterLoader.cpp @@ -13,8 +13,6 @@ typedef unsigned char UINT8; int LZ77_Decompress( UINT8* inBuf, int inSize, UINT8* outBuf, int outSize ); -HAL_DECLARE_NULL_HEAP(); - extern "C" { void BootEntryLoader() diff --git a/Solutions/Template_BE/PortBooter/portBooterloader.proj b/Solutions/Template_BE/PortBooter/portBooterloader.proj index 553701d40..e8069cbab 100644 --- a/Solutions/Template_BE/PortBooter/portBooterloader.proj +++ b/Solutions/Template_BE/PortBooter/portBooterloader.proj @@ -86,14 +86,6 @@ - - - - - - - - diff --git a/Solutions/Template_BE/TinyCLR/TinyCLR.proj b/Solutions/Template_BE/TinyCLR/TinyCLR.proj index fa7ae5888..05b3b5e45 100644 --- a/Solutions/Template_BE/TinyCLR/TinyCLR.proj +++ b/Solutions/Template_BE/TinyCLR/TinyCLR.proj @@ -119,14 +119,6 @@ - - - - - - - - diff --git a/Solutions/Windows/TinyCLR/TinyCLR.proj b/Solutions/Windows/TinyCLR/TinyCLR.proj index 894977803..99d8f8478 100644 --- a/Solutions/Windows/TinyCLR/TinyCLR.proj +++ b/Solutions/Windows/TinyCLR/TinyCLR.proj @@ -310,11 +310,6 @@ - - - - - @@ -476,10 +471,6 @@ --> - - $(CPP_FLAGS)-xc++ -w -fcheck-new -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics + $(CPP_FLAGS)-std=c++11 -xc++ -w -fcheck-new -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 @@ -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 From b977a848155cd353c9108fd9e2be716621eefb3a Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Tue, 9 Aug 2016 00:51:19 +0100 Subject: [PATCH 2/5] Revert changes with C11 flags and extra debug settings --- tools/Targets/Microsoft.Spot.system.gcc.targets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/Targets/Microsoft.Spot.system.gcc.targets b/tools/Targets/Microsoft.Spot.system.gcc.targets index 1466f2e55..16bb0b296 100644 --- a/tools/Targets/Microsoft.Spot.system.gcc.targets +++ b/tools/Targets/Microsoft.Spot.system.gcc.targets @@ -50,14 +50,14 @@ $(CC_CPP_TARGETTYPE_FLAGS) -O3 $(CC_CPP_TARGETTYPE_FLAGS) -Og -femit-class-debug-always -g3 -ggdb $(CC_CPP_TARGETTYPE_FLAGS) -O0 - $(CC_CPP_TARGETTYPE_FLAGS) -Os -g3 -ggdb + $(CC_CPP_TARGETTYPE_FLAGS) -Os - $(CC_FLAGS)-std=c11 -xc + $(CC_FLAGS)-xc -O3 -Og -femit-class-debug-always -g3 -ggdb -O0 - -Os -g3 -ggdb + -Os - $(CPP_FLAGS)-std=c++11 -xc++ -w -fcheck-new -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics + $(CPP_FLAGS)-xc++ -w -fcheck-new -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -mfloat-abi=hard -mfpu=fpv4-sp-d16 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 From ecd0fa385b1c1d6250b998fe7f302171fb4a08da Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Tue, 9 Aug 2016 09:09:19 +0100 Subject: [PATCH 3/5] Repalced "unknown" char with (hopefully right) copyright char --- Application/MicroBooter/MicroBooter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/MicroBooter/MicroBooter.cpp b/Application/MicroBooter/MicroBooter.cpp index ae782f454..96c801bdb 100644 --- a/Application/MicroBooter/MicroBooter.cpp +++ b/Application/MicroBooter/MicroBooter.cpp @@ -3,7 +3,7 @@ // // // Microsoft dotNetMF Project -// Copyright �2004 Microsoft Corporation +// Copyright ©2004 Microsoft Corporation // One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. // All rights reserved. // MICROSOFT CONFIDENTIAL From 6a8107efd2b29c99213d73e917fd891540cfce86 Mon Sep 17 00:00:00 2001 From: Jose Simoes Date: Tue, 9 Aug 2016 16:47:08 +0100 Subject: [PATCH 4/5] Save - again - with Windows 1252 encoding --- Application/MicroBooter/MicroBooter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Application/MicroBooter/MicroBooter.cpp b/Application/MicroBooter/MicroBooter.cpp index 96c801bdb..01974507a 100644 --- a/Application/MicroBooter/MicroBooter.cpp +++ b/Application/MicroBooter/MicroBooter.cpp @@ -3,7 +3,7 @@ // // // Microsoft dotNetMF Project -// Copyright ©2004 Microsoft Corporation +// Copyright ©2004 Microsoft Corporation // One Microsoft Way, Redmond, Washington 98052-6399 U.S.A. // All rights reserved. // MICROSOFT CONFIDENTIAL From 27f1ea7bc08f73b453f455c587077edceab93c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Fri, 4 Nov 2016 17:56:15 +0000 Subject: [PATCH 5/5] Remove SimpleHeap stubs projects --- Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj | 8 -------- Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj | 8 -------- 2 files changed, 16 deletions(-) diff --git a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj index 92cb3ffef..f2f6df953 100644 --- a/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj +++ b/Solutions/STM32F4DISCOVERY/TinyBooter/TinyBooter.proj @@ -147,14 +147,6 @@ - - - - - - - - diff --git a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj index c3161ee1a..ff01ea1b0 100644 --- a/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj +++ b/Solutions/STM32F4DISCOVERY/TinyCLR/TinyCLR.proj @@ -180,14 +180,6 @@ - - - - - - - -