NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ote_common.h File Reference

Detailed Description

NVIDIA Trusted Little Kernel Interface: Common Declarations

Description: Declares the common declarations in the TLK interface.

Definition in file ote_common.h.

Go to the source code of this file.

Data Structures

struct  te_service_id_t
 Defines a unique 16-byte ID for each TLK service. More...
 
struct  te_service_status_t
 
union  te_session_t
 Holds session information. More...
 
struct  te_oper_param_t
 Holds the operation object parameters. More...
 
struct  te_operation_t
 Holds operation object information that is to be delivered to the TLK Secure Service. More...
 
struct  task_identifier
 Holds Unique Task identifiers, including uuid and port name. More...
 

Macros

#define SERVICE_PORT_NAME_PREFIX   "com.nvidia.tos"
 
#define UUID_STR_SIZE_BYTES   ((2U * sizeof(te_service_id_t)) + 4U)
 
#define MAX_PORT_NAME_LENGTH   sizeof(SERVICE_PORT_NAME_PREFIX) + UUID_STR_SIZE_BYTES
 
#define OTE_TASK_NAME_MAX_LENGTH   24
 Defines the maximum length of a zero-terminated informative task name. More...
 
#define OTE_TASK_PRIVATE_DATA_LENGTH   20
 Defines the length of private data for the Trusted Application (TA). More...
 
#define TIPC_MAX_CHUNK_SIZE   4040
 
#define TIPC_CHUNK_MSG_ACK   0xcafefeedU
 
#define WORD_SIZE   sizeof(uint32_t)
 
#define ROUNDUP(a, b)   (((a) + ((b)-1)) & ~((b)-1))
 
#define ROUNDDOWN(a, b)   ((a) & ~((b)-1))
 

Typedefs

typedef uint64_t cmnptr_t
 Holds a pointer large enough to support 32- and 64-bit clients. More...
 

Enumerations

enum  te_oper_param_type_t {
  TE_PARAM_TYPE_NONE = 0x0U,
  TE_PARAM_TYPE_INT_RO = 0x1U,
  TE_PARAM_TYPE_INT_RW = 0x2U,
  TE_PARAM_TYPE_MEM_RO = 0x3U,
  TE_PARAM_TYPE_MEM_RW = 0x4U,
  TE_PARAM_TYPE_PERSIST_MEM_RO = 0x100U,
  TE_PARAM_TYPE_PERSIST_MEM_RW = 0x101U,
  TE_PARAM_TYPE_FLAGS_PHYS_LIST = 0x1000U,
  TE_PARAM_TYPE_ALL_FLAGS
}
 Specifies the operation object's parameter types. More...
 
enum  {
  TE_MEM_TYPE_NS_USER = 0x0U,
  TE_MEM_TYPE_NS_KERNEL = 0x1U
}
 
enum  {
  TE_CRITICAL = 0U,
  TE_ERR = 1U,
  TE_INFO = 2U,
  TE_SPEW = 3U,
  TE_SECURE = 4U,
  TE_INTERFACE = 5U,
  TE_RESULT = 6U
}
 

Functions

te_result_origin_t te_get_result_origin (te_session_t *session)
 Returns the origin of a returned result. More...
 
int te_fprintf (int fd, const char *fmt,...) __PRINTFLIKE(2
 For secure tasks: Redirects prints to Trusted Little Kernel (TLK) writes. More...
 
int int te_vfprintf (int lvl, const char *fmt, va_list ap)
 
te_error_t get_port_name_by_uuid (char *path, uint32_t max_len, te_service_id_t *service)
 Returns the port name of a secure task. More...
 
te_error_t tipc_error_to_ote_error (int err_num)
 Translates TIPC Error Code to an OTE Error Code. More...
 
te_error_t te_uuid_to_string (char *ustr, uint32_t ulen, const te_service_id_t *uuid)
 Converts UUID to a string format. More...
 
const char * te_strerror (te_error_t errcode)
 Converts an error code to appropriate string description. More...
 
bool te_validate_range (void *range_base, uint32_t range_size, void *base, uint32_t size)
 Implements a range checker which is free from integer overflow. More...
 

Enumeration Type Documentation

anonymous enum
Enumerator
TE_CRITICAL 
TE_ERR 
TE_INFO 
TE_SPEW 
TE_SECURE 
TE_INTERFACE 
TE_RESULT 

Definition at line 206 of file ote_common.h.

Function Documentation

te_error_t get_port_name_by_uuid ( char *  path,
uint32_t  max_len,
te_service_id_t service 
)

Returns the port name of a secure task.

Parameters
[out]pathPort name of Secure Task.
[in]max_lenMaximum length of the port name.
[in]serviceUUID of Secure Task.
Returns
OTE_SUCCESS if successful, or an error code otherwise.
int te_fprintf ( int  fd,
const char *  fmt,
  ... 
)

For secure tasks: Redirects prints to Trusted Little Kernel (TLK) writes.

This is a printf function for TLK services.

For clients: Prints to stdout.

const char* te_strerror ( te_error_t  errcode)

Converts an error code to appropriate string description.

Parameters
[in]errcodeto be translated to string
Returns
Error string corresponding to error code
te_error_t te_uuid_to_string ( char *  ustr,
uint32_t  ulen,
const te_service_id_t uuid 
)

Converts UUID to a string format.

Parameters
[out]ustrA pointer to a char * array in which to store the result.
[in]ulenLength of the char * array.
[in]uuidUUID to convert.
Return values
Errorcode.
bool te_validate_range ( void *  range_base,
uint32_t  range_size,
void *  base,
uint32_t  size 
)

Implements a range checker which is free from integer overflow.

Parameters
[in]range_baseBase address of valid range to check against.
[in]range_sizeSize of valid range to check against
[in]baseBase address to check against range_base
[in]sizeSize to check against range_size
Return values
trueif {base, to base+size} lies within {range_base to range_base+range_size}, false otherwise..
int int te_vfprintf ( int  lvl,
const char *  fmt,
va_list  ap 
)
te_error_t tipc_error_to_ote_error ( int  err_num)

Translates TIPC Error Code to an OTE Error Code.

Parameters
[in]err_numTIPC Error code.
Returns
OTE Error Code.