mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:43:33 +08:00
crypto: define XMALLOC & XFREE for sw_crypto
Use the same memory allocation in sw_crypto driver as what is used in src/lib/crypto libraries In addition, in nuttx protected build, allocate all memory from kernel heap Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
committed by
Daniel Agar
parent
a537925c3c
commit
9c94e4c5ef
@@ -99,4 +99,14 @@ target_link_libraries(libtomcrypt
|
||||
# "der_encode_asn1_identifier.c:39:18: error: comparison is always false due to limited range of data type"
|
||||
target_compile_options(libtomcrypt PRIVATE -Wno-type-limits)
|
||||
|
||||
# Re-define memory allocation macros if we are building for
|
||||
# memory protected build in nuttx. All allocations happen in
|
||||
# kernel heap there
|
||||
|
||||
if (NOT DEFINED CONFIG_BUILD_FLAT AND "${PX4_PLATFORM}" MATCHES "nuttx")
|
||||
target_compile_options(libtomcrypt PUBLIC -DXMALLOC=kmm_malloc -DXFREE=kmm_free -DXREALLOC=kmm_realloc -DXCALLOC=kmm_calloc)
|
||||
target_compile_options(libtommath PUBLIC -DMP_MALLOC=kmm_malloc -DMP_FREE\(p,s\)=kmm_free\(p\) -DMP_REALLOC\(p,o,n\)=kmm_realloc\(p,n\) -DMP_CALLOC=kmm_calloc)
|
||||
target_link_libraries(libtommath PRIVATE nuttx_kmm)
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user