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_storage.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files
6  * (the "Software"), to deal in the Software without restriction,
7  * including without limitation the rights to use, copy, modify, merge,
8  * publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22  */
23 
44 #ifndef __OTE_STORAGE_H
45 #define __OTE_STORAGE_H
46 
47 #include <common/ote_common.h>
48 
50 #define TE_STORAGE_OBJID_MAX_LEN 64
51 
53 struct __te_storage_object;
54 typedef struct __te_storage_object *te_storage_object_t;
55 
57 typedef enum {
65 
77  te_storage_object_t *obj);
78 
90  te_storage_object_t *obj);
91 
106  uint32_t size, uint32_t *count);
107 
117  uint32_t size);
118 
127 
129 typedef enum {
137 
151  te_storage_whence_t whence);
152 
164 
172 
180 
192 
194 #endif
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.
te_storage_whence_t
Defines seek whence options.
Definition: ote_storage.h:129
Specifies write access.
Definition: ote_storage.h:61
Apply specified offset to current end of file.
Definition: ote_storage.h:135
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.
te_error_t te_delete_named_storage_object(const char *name)
Deletes a persistent object by name.
Apply specified offset to start of file.
Definition: ote_storage.h:131
Specifies delete access.
Definition: ote_storage.h:63
te_error_t te_open_storage_object(char *name, te_storage_flags_t flags, te_storage_object_t *obj)
Opens a persistent storage object.
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.
te_error_t te_write_storage_object(te_storage_object_t obj, const void *buffer, uint32_t size)
Writes data to the persistent object.
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.
NVIDIA Trusted Little Kernel Interface: Common Declarations
Apply specified offset to current position in file.
Definition: ote_storage.h:133
int uint32_t uint32_t uint32_t const uint32_t const uint32_t const uint32_t const uint64_t uint32_t uint32_t flags
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.
te_storage_flags_t
Defines file access flags.
Definition: ote_storage.h:57
te_error_t te_delete_storage_object(te_storage_object_t obj)
Deletes a persistent object.
te_error_t te_close_storage_object(te_storage_object_t obj)
Closes the persistent object handle.
struct __te_storage_object * te_storage_object_t
Definition: ote_storage.h:54
Specifies read access.
Definition: ote_storage.h:59
te_error_t
Defines Open Trusted Environment (OTE) error codes.
Definition: ote_error.h:45