43 #ifndef __OTE_SERVICE_H
44 #define __OTE_SERVICE_H
48 #include <sys/types.h>
50 #include <common/ote_ioctl.h>
53 #include <trusty_ipc.h>
56 #define TE_PRINTF_MAX_SIZE 512
57 #define MAX_NUM_SUPPORTED_GUESTS 16U
58 #define DEFAULT_GUEST_ID 0xDEADFEED
61 #define LIBTA_CRITICAL(args...) te_fprintf(TE_CRITICAL, args)
62 #define LIBTA_ERR(args...) te_fprintf(TE_ERR, args)
63 #define LIBTA_INFO(args...) te_fprintf(TE_INFO, args)
64 #define LIBTA_SECURE(args...) te_fprintf(TE_SECURE, args)
94 uint32_t dest_uuid[4];
261 #define DEVICE_UID_SIZE_BYTES 16
281 #define RSA2K_NUM_BYTES 256
284 uint8_t dtb_pub_key[RSA2K_NUM_BYTES];
285 uint8_t boot_pub_key[RSA2K_NUM_BYTES];
291 #define VERIFIED_BOOT_KEY_SIZE_BYTES 256
308 #define OTE_PANIC_MSG_MAX_SIZE 128
319 void te_panic(
char *msg) __attribute__ ((noreturn));
323 #define OTE_TE_FPRINTF_PREFIX_MAX_LENGTH (OTE_TASK_NAME_MAX_LENGTH + 4)
361 uint32_t events_mask);
390 #define LOG_PREFIX_CRITICAL 'C'
391 #define LOG_PREFIX_INFO 'I'
392 #define LOG_PREFIX_ERR 'E'
393 #define LOG_PREFIX_SECURE 'S'
433 #define ENABLE_SPECULATION_BARRIER
434 #ifdef ENABLE_SPECULATION_BARRIER
437 __asm__
volatile(
"dsb sy\n\t"
458 extern const char *TRUSTY_LOG_TAG;
void te_close_session_iface(void *sctx)
Closes an opened session.
te_error_t te_get_dsi_panel_config(bool *res)
Gets whether the device has DSI panel attached or not.
te_error_t te_get_current_guest_id(uint32_t *guest_id)
Returns the current guest id requesting service from this TA.
void te_oper_dump_param(te_oper_param_t *param)
Prints out the list of parameters for debugging.
te_property_type_t prop
Holds the TE_PROPERTY_* value.
te_error_t te_request_se_keyslot(uint32_t keyslot_type, uint32_t *keyslot_idx)
Returns the index of a free SE keyslot if one is available.
te_error_t te_get_client_ta_identity(te_identity_t *value)
Gets the current client's identity only if it is a secure TA.
te_error_t te_get_device_unique_id(te_device_unique_id *uid)
Gets the device's unique ID.
void te_exit_service(void)
Holds operation object information that is to be delivered to the TLK Secure Service.
#define VERIFIED_BOOT_KEY_SIZE_BYTES
te_property_type_t
Defines the property data information.
te_error_t te_receive_operation_iface(void *sctx, te_operation_t *oper)
Receives an operation.
Holds the identity of a client/caller.
#define DEVICE_UID_SIZE_BYTES
void * ote_get_instance_data(void)
Gets the instance context data.
void ote_set_instance_data(void *sessionContext)
Sets an instance context data.
Holds the device unique ID.
te_error_t te_check_se_keyslot_owner(uint32_t keyslot_type, uint32_t keyslot_idx, te_service_id_t *uuid)
Checks if the client TA is the owner of the keyslot it wants to write to.
te_error_t(* ta_event_handler_t)(ta_event_args_t *args)
NVIDIA Trusted Little Kernel Interface: Common Declarations
te_error_t te_open_session_iface(void **sctx, te_operation_t *oper)
Opens a session.
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
size_t value_size
Holds the size of return value.
void te_oper_dump_param_list(te_operation_t *te_op)
Prints out the list of parameters for debugging.
te_error_t te_rollback_check(te_rollback_args_t *rb_args)
Holds data about the TA client.
Defines a unique 16-byte ID for each TLK service.
te_error_t check_client_uuid(te_service_id_t *service_id)
Validates the client's identity.
uint64_t cmnptr_t
Holds a pointer large enough to support 32- and 64-bit clients.
te_error_t check_client_login(uint32_t login, te_identity_t *client_id_p)
Validates client's login scheme with the expected login type.
static void te_speculation_barrier(void)
Holds the root of trust for TLK.
void te_destroy_instance_iface(void)
Destroys an instance of the service.
te_error_t te_release_se_keyslot(uint32_t keyslot_type, uint32_t keyslot_idx)
Releases a keyslot.
te_error_t te_get_root_of_trust(te_root_of_trust *r_o_t)
Gets the root of trust.
te_error_t te_get_current_ta_uuid(te_service_id_t *value)
Gets the service ID for the current Trusted Application (TA).
Holds the layout of the te_oper_param_t structures which must match the layout sent in by the non-sec...
te_error_t te_get_client_identity(te_identity_t *value)
Gets the current client's identity.
void convert_fd_to_log_prefix(int fd, char *log_level)
Maps the fd level to a corresponding logger prefix character.
te_rollback_fields rollback_field
#define OTE_PANIC_MSG_MAX_SIZE
Holds the panic information.
te_error_t
Defines Open Trusted Environment (OTE) error codes.
void te_fprintf_set_prefix(const char *prefix)
Sets a printable prefix string that te_fprintf() outputs in front of every log message from this task...
Holds the operation object parameters.
te_error_t te_register_ta_event_handler(ta_event_handler_t handler, uint32_t events_mask)
void te_panic(char *msg)
Panics the system.
uint32_t data_type
Holds the data type of property.
char * uuid_to_str(te_service_id_t *uuid)
Converts a UUID to string format.
void te_destroy(void)
Deinitializes the service.
te_error_t te_create_instance_iface(void)
Creates a new instance of the service.
te_error_t te_init(int argc, char **argv)
Initializes the service.