NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Detailed Description

Defines Trusted Little Kernel (TLK) storage services declarations and functions.

Macros

#define TE_STORAGE_OBJID_MAX_LEN   64
 Defines the maximum file name length in bytes. More...
 

Typedefs

typedef struct
__te_storage_object * 
te_storage_object_t
 

Enumerations

enum  te_storage_flags_t {
  OTE_STORAGE_FLAG_ACCESS_READ = 0x1,
  OTE_STORAGE_FLAG_ACCESS_WRITE = 0x2,
  OTE_STORAGE_FLAG_ACCESS_WRITE_META = 0x4
}
 Defines file access flags. More...
 
enum  te_storage_whence_t {
  OTE_STORAGE_SEEK_WHENCE_SET = 0x1,
  OTE_STORAGE_SEEK_WHENCE_CUR = 0x2,
  OTE_STORAGE_SEEK_WHENCE_END = 0x3
}
 Defines seek whence options. More...
 

Functions

te_error_t te_create_storage_object (char *name, te_storage_flags_t flags, te_storage_object_t *obj)
 Creates a persistent storage object handle. More...
 
te_error_t te_open_storage_object (char *name, te_storage_flags_t flags, te_storage_object_t *obj)
 Opens a persistent storage object. More...
 
te_error_t te_read_storage_object (te_storage_object_t obj, void *buffer, uint32_t size, uint32_t *count)
 Reads data from a persistent object. More...
 
te_error_t te_write_storage_object (te_storage_object_t obj, const void *buffer, uint32_t size)
 Writes data to the persistent object. More...
 
te_error_t te_get_storage_object_size (te_storage_object_t obj, uint32_t *size)
 Gets the size of the data stored in the persistent object. More...
 
te_error_t te_seek_storage_object (te_storage_object_t obj, int32_t offset, te_storage_whence_t whence)
 Seeks to the specified offset in the persistent object. More...
 
te_error_t te_trunc_storage_object (te_storage_object_t obj, uint32_t size)
 Truncates the data stored in the persistent object to the specified size. More...
 
te_error_t te_delete_storage_object (te_storage_object_t obj)
 Deletes a persistent object. More...
 
te_error_t te_delete_named_storage_object (const char *name)
 Deletes a persistent object by name. More...
 
te_error_t te_close_storage_object (te_storage_object_t obj)
 Closes the persistent object handle. More...
 

Macro Definition Documentation

#define TE_STORAGE_OBJID_MAX_LEN   64

Defines the maximum file name length in bytes.

Definition at line 50 of file ote_storage.h.

Typedef Documentation

typedef struct __te_storage_object* te_storage_object_t

Definition at line 54 of file ote_storage.h.

Enumeration Type Documentation

Defines file access flags.

Enumerator
OTE_STORAGE_FLAG_ACCESS_READ 

Specifies read access.

OTE_STORAGE_FLAG_ACCESS_WRITE 

Specifies write access.

OTE_STORAGE_FLAG_ACCESS_WRITE_META 

Specifies delete access.

Definition at line 57 of file ote_storage.h.

Defines seek whence options.

Enumerator
OTE_STORAGE_SEEK_WHENCE_SET 

Apply specified offset to start of file.

OTE_STORAGE_SEEK_WHENCE_CUR 

Apply specified offset to current position in file.

OTE_STORAGE_SEEK_WHENCE_END 

Apply specified offset to current end of file.

Definition at line 129 of file ote_storage.h.

Function Documentation

te_error_t te_close_storage_object ( te_storage_object_t  obj)

Closes the persistent object handle.

This must be called when a client is done using the handle. On completion the handle will be invalid and te_open_storage_object() must be used again to obtain a new handle.

Parameters
[in]objHandle returned by te_open_storage_object().
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_create_storage_object ( char *  name,
te_storage_flags_t  flags,
te_storage_object_t obj 
)

Creates a persistent storage object handle.

Precondition
This function must be called before accessing a file.
Parameters
[in]nameName of the persistent storage object (file).
[in]flagsFile access flags.
[out]objA pointer to persistent object handle.
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_delete_named_storage_object ( const char *  name)

Deletes a persistent object by name.

Parameters
[in]nameName of the persistent storage object (file).
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_delete_storage_object ( te_storage_object_t  obj)

Deletes a persistent object.

Parameters
[in]objHandle returned by te_open_storage_object().
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_get_storage_object_size ( te_storage_object_t  obj,
uint32_t *  size 
)

Gets the size of the data stored in the persistent object.

Parameters
[in]objHandle returned by te_open_storage_object().
[in]sizeA pointer to hold the data size.
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_open_storage_object ( char *  name,
te_storage_flags_t  flags,
te_storage_object_t obj 
)

Opens a persistent storage object.

Precondition
This function must be called before accessing a file.
Parameters
[in]nameName of the persistent storage object (file).
[in]flagsFile access flags.
[out]objA pointer to a persistent object handle.
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_read_storage_object ( te_storage_object_t  obj,
void *  buffer,
uint32_t  size,
uint32_t *  count 
)

Reads data from a persistent object.

The actual number of bytes read can be less than the requested value and does not necessarily mean a read failure.

Parameters
[in]objHandle returned by te_open_storage_object().
[in]bufferData buffer.
[in]sizeSize of the data buffer in bytes.
[out]countActual number of bytes read.
Return values
OTE_SUCCESSIndicates the operation was successful and count contains a non-zero value.
te_error_t te_seek_storage_object ( te_storage_object_t  obj,
int32_t  offset,
te_storage_whence_t  whence 
)

Seeks to the specified offset in the persistent object.

Parameters
[in]objHandle returned by te_open_storage_object().
[in]offsetNumber of bytes by which to adjust the data position. A positive value specifies to adjust the data position forward while a negative value specifies to adjust it backward.
[in]whenceThe position in the data from which to calculate the new position.
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_trunc_storage_object ( te_storage_object_t  obj,
uint32_t  size 
)

Truncates the data stored in the persistent object to the specified size.

If the specified size is less than the current size then any residual data are lost.

Parameters
[in]objHandle to writable persistent storage object returned by te_open_storage_object().
[in]sizeThe new size of the object's data in bytes.
Return values
OTE_SUCCESSIndicates the operation was successful.
te_error_t te_write_storage_object ( te_storage_object_t  obj,
const void *  buffer,
uint32_t  size 
)

Writes data to the persistent object.

Parameters
[in]objHandle returned by te_open_storage_object().
[in]bufferData buffer.
[in]sizeSize of the data buffer in bytes.
Return values
OTE_SUCCESSIndicates the operation was successful.