14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
+
17
18
#include < time.h>
18
19
#include " platform/platform.h"
19
20
#include " platform/FilePath.h"
@@ -904,6 +905,9 @@ extern "C" long PREFIX(_flen)(FILEHANDLE fh)
904
905
return size;
905
906
}
906
907
908
+ // Do not compile this code for TFM secure target
909
+ #if !defined(COMPONENT_SPE) || !defined(TARGET_TFM)
910
+
907
911
extern " C" char Image$$RW_IRAM1$$ZI$$Limit[];
908
912
909
913
extern " C" MBED_WEAK __value_in_regs struct __initial_stackheap _mbed_user_setup_stackheap (uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3)
@@ -924,6 +928,8 @@ extern "C" __value_in_regs struct __initial_stackheap __user_setup_stackheap(uin
924
928
return _mbed_user_setup_stackheap (R0, R1, R2, R3);
925
929
}
926
930
931
+ #endif // !defined(COMPONENT_SPE) || !defined(TARGET_TFM)
932
+
927
933
#endif
928
934
929
935
@@ -1205,7 +1211,7 @@ extern "C" WEAK void __cxa_pure_virtual(void)
1205
1211
// SP. This make it compatible with RTX RTOS thread stacks.
1206
1212
#if defined(TOOLCHAIN_GCC_ARM)
1207
1213
1208
- #if defined(TARGET_CORTEX_A)
1214
+ #if defined(TARGET_CORTEX_A) || (defined(TARGET_TFM) && defined(COMPONENT_SPE))
1209
1215
extern " C" uint32_t __HeapLimit;
1210
1216
#endif
1211
1217
@@ -1234,7 +1240,7 @@ extern "C" WEAK caddr_t _sbrk(int incr)
1234
1240
unsigned char *prev_heap = heap;
1235
1241
unsigned char *new_heap = heap + incr;
1236
1242
1237
- #if defined(TARGET_CORTEX_A)
1243
+ #if defined(TARGET_CORTEX_A) || (defined(TARGET_TFM) && defined(COMPONENT_SPE))
1238
1244
if (new_heap >= (unsigned char *)&__HeapLimit) { /* __HeapLimit is end of heap section */
1239
1245
#else
1240
1246
if (new_heap >= (unsigned char *)__get_MSP ()) {
0 commit comments