OpTEE implementation of **UnifiedTADevkit.cmake.template.in** is named **UnifiedTADevkit.cmake.optee.in**.
#### Implementation of UnifiedTADevkit.cmake.template.in
-Implementation of **UnifiedTADevkit.cmake.template.in** should contains all defines/includes/targets needed by TEEOS devkit. Includes UnifiedTADevkitCommon.cmake. Implementing this file is mandatory. You should also implement:
+Implementation of **UnifiedTADevkit.cmake.template.in** should contain all defines/includes/targets needed by TEEOS devkit. Includes UnifiedTADevkitCommon.cmake. Implementing this file is mandatory. You should also implement:
```cmake
# MACRO GENERATE_TA_IMAGE unifies compiling dependencies and signing/encrypting
# Parameters:
# TargetName [in] - name of target that represent TA
# TAElfTargetName [in] - TA binary target name before signing
-# TAManifestFile [in] - manifest file name with a path
+# TAConfDir [in] - backend-specific configuration directory
# TAImageName [in] - final TA binary name
-MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAManifestFile TAImageName)
+MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAConfDir TAImageName)
# Fill this function with Your implementation
ENDMACRO()
```
TAElfTargetName - should be a target from ADD_EXECUTABLE or ADD_LIBRARY
+TAConfDir - This is a base directory for backend-specific configurations. Your backend can require specific files to be put in a subdirectory matching you backend's name, in order to use them for building the TA.
#### UnifiedTADevkitCommon.cmake
Defines common variables for all backends.
${YOUR_TA_DEPS_STATIC_LIBRARIES}
)
```
+
+Different TEE backends use different methods of configuration - for example, OpTEE requires a configuration header, while the simulator requires an xml manifest. For that purpose, you should prepare a directory with backend-specific configurations. The backends use following files:
+- OpTEE - (base directory)/optee/include/user_ta_header_defines.h
+- Simulator - (base directory)/simulator/manifest.xml
+
+Once configuration is provided, you can use the GENERATE_TA_IMAGE macro to creae the TA image.
# Parameters:
# TargetName [in] - name of target that represent TA
# TAElfTargetName [in] - TA binary target name before signing
-# TAManifestFile [in] - manifest file name with a path (tef-simulator)
+# TAConfDir [in] - backend-specific configuration directory
# TAImageName [in] - final TA binary name
-MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAManifestFile TAImageName)
+MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAConfDir TAImageName)
# Dependency to compiled linker script
ADD_DEPENDENCIES(${TAElfTargetName} ta-core-ld ${DEVKIT_TA_TARGET})
# Parameters:
# TargetName [in] - name of target that represent TA
# TAElfTargetName [in] - TA binary target name before signing
-# TAManifestFile [in] - manifest file name with a path (tef-simulator)
+# TAConfDir [in] - backend-specific configuration directory
# TAImageName [in] - final TA binary name
-MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAManifestFile TAImageName)
+MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAConfDir TAImageName)
# TEEStub is built in C++, so we must force linking using C++ linker
SET_TARGET_PROPERTIES(${TAElfTargetName} PROPERTIES
LINKER_LANGUAGE "CXX"
)
- TEF_GENERATE_TA_IMAGE(${TargetName} ${TAElfTargetName} ${TAManifestFile} ${TAImageName})
+ TEF_GENERATE_TA_IMAGE(${TargetName} ${TAElfTargetName} ${TAConfDir}/simulator/manifest.xml ${TAImageName})
ENDMACRO()
# Parameters:
# TargetName [in] - name of target that represent TA
# TAElfTargetName [in] - TA binary target name before signing
-# TAManifestFile [in] - manifest file name with a path
+# TAConfDir [in] - backend-specific configuration directory
# TAImageName [in] - final TA binary name
-MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAManifestFile TAImageName)
+MACRO(GENERATE_TA_IMAGE TargetName TAElfTargetName TAConfDir TAImageName)
# Fill this function with Your implementation
ENDMACRO()
${TA_DEPS_STATIC_LIBRARIES}
)
-GENERATE_TA_IMAGE(SIGNED_TA ${TARGET_TA} ${TA_PATH}/example.xml ${TA_NAME})
+GENERATE_TA_IMAGE(SIGNED_TA ${TARGET_TA} ${TA_PATH} ${TA_NAME})
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${TA_NAME} DESTINATION ${TASTORE_DIR})
INSTALL(FILES ${TA_HEADERS} DESTINATION ${INCLUDE_DIR})