NVIDIA DRIVE OS Linux API Reference5.1.0.2 Release |
Declares the APIs and data structures required for accessing information about guest bootloader and related info.
Data Structures | |
struct | NvGPHObjectSignatureRec |
struct | NvGPHBLInfoRec |
Stores information needed to locate and verify a boot loader. More... | |
struct | NvGPHRec |
Generic Partition Header. More... | |
Macros | |
#define | CMAC_AES_HASH_LENGTH 4 |
#define | NVGPH_MAX_COPIES 64 |
#define | NVGPH_COPIES_OFFSET 2048 |
#define | MAX_BOOTLOADERS 2 |
#define | GPH_CUSTOMER_DATA_SIZE 424 |
Typedefs | |
typedef struct NvGPHObjectSignatureRec | NvGPHObjectSignature |
typedef struct NvGPHBLInfoRec | NvGuestBLInfo |
Stores information needed to locate and verify a boot loader. More... | |
typedef struct NvGPHRec | NvGPH |
Generic Partition Header. More... | |
Enumerations | |
enum | NvGPH_ValidationEnum { NvGPH_Validation_AES_CMAC = 1, NvGPH_EncryptionAndValidation_AES_CMAC, NvGPH_Validation_RSA, NvGPH_Validation_SHA256, NvGPH_Force = 0xFFFFFFFF } |
Specifies the type of Validataion to be used. More... | |
enum | NvGPHDataType { NvGPHDataType_ValidationType, NvGPHDataType_Signature, NvGPHDataType_NumValidBL, NvGPHDataType_BLInfo, NvGPHDataType_PTStart, NvGPHDataType_CustData } |
Data elements of the NvGPH which can be queried and set via the NvGPH set/get API. More... | |
Functions | |
NvError | NvGphInit (QbDriver DeviceId, NvU32 DevInstance, NvU64 Offset, NvU32 PartId) |
Initializes GPH. More... | |
void | NvGphDeinit (void) |
Deinitializes GPH. More... | |
NvError | NvGPHGetDataSize (NvGPHDataType DataType, NvU32 *Size, NvU32 *NumInstances) |
Gets data size of GPH element. More... | |
NvError | NvGPHGetData (NvGPHDataType DataType, NvU32 Size, NvU32 Instance, void *Data) |
Gets the contents of the GPH element. More... | |
NvError | NvGPHSetData (NvGPHDataType DataType, NvU32 Size, NvU32 Instance, void *Data) |
Sets the contents of the GPH element. More... | |
NvError | NvGphWriteGphApp (NvS8 *FileName, NvU32 Size) |
Writes the GPH to a file. More... | |
void | NvPrintGPH (void) |
Prints GPH information to console. More... | |
Generic Partition Header.
This stores information about guest bootloaders, Guest Partition table offset and Customer Data.
typedef struct NvGPHObjectSignatureRec NvGPHObjectSignature |
typedef struct NvGPHBLInfoRec NvGuestBLInfo |
Stores information needed to locate and verify a boot loader.
There is one NvGuestBLInfo
structure for each copy of a BL stored on the device.
enum NvGPH_ValidationEnum |
enum NvGPHDataType |
Data elements of the NvGPH which can be queried and set via the NvGPH set/get API.
void NvGphDeinit | ( | void | ) |
Deinitializes GPH.
Free allocated memory for GPH and set the pointer to NULL.
NvError NvGPHGetData | ( | NvGPHDataType | DataType, |
NvU32 | Size, | ||
NvU32 | Instance, | ||
void * | Data | ||
) |
Gets the contents of the GPH element.
DataType | type of data to obtain from GPH. |
Size | Size of the datatype. |
Instance | Needed Instance of the datatype. |
Data | Address of the location where needed element of GPH should be copied. |
NvSuccess | Getting the contents is successful. |
NvError_BadParameter | Queried Size/Instance is not valid for the data type. |
NvError NvGPHGetDataSize | ( | NvGPHDataType | DataType, |
NvU32 * | Size, | ||
NvU32 * | NumInstances | ||
) |
Gets data size of GPH element.
DataType | type of data to obtain from GPH. |
Size | Pointer to NvU32 to be populated with size of the datatype. |
NumInstances | Pointer to NvU32 to be populated with instances of the datatype. |
NvSuccess | Querying the size is successful. |
NvError_BadParameter | Queried Datatype not valid. |
NvError NvGphInit | ( | QbDriver | DeviceId, |
NvU32 | DevInstance, | ||
NvU64 | Offset, | ||
NvU32 | PartId | ||
) |
Initializes GPH.
DeviceId | Device ID of the device on which the BR BCT resides. |
DevInstance | Device instance of the device on which the BR BCT resides. |
Offset | Offset of the partition to read the GPH. |
PartId | partition id of the guest container partition. |
NvSuccess | GPH initializtion successful. |
NvError_InvalidState | Hash mismatch. |
NvError_InsufficientMemory | Not enough memory to allocate handle. |
NvError NvGPHSetData | ( | NvGPHDataType | DataType, |
NvU32 | Size, | ||
NvU32 | Instance, | ||
void * | Data | ||
) |
Sets the contents of the GPH element.
DataType | type of data to be modified in GPH. |
Size | Size of the datatype. |
Instance | Needed Instance of the datatype. |
Data | Address of the location from where new contents are to be copied to the GPH element. |
NvSuccess | Setting the contents is successful. |
NvError_BadParameter | Queried Size/Instance is not valid for the data type. |
NvError_NotSupport | Modifying GPH is not allowed. |
NvError NvGphWriteGphApp | ( | NvS8 * | FileName, |
NvU32 | Size | ||
) |
Writes the GPH to a file.
FileName | Location for the file to be created. |
Size | Size to be copied to the file. |
NvSuccess | Writing GPH to the file is successful. |
NvError_BadParameter | Bad file path or invalid size specified for the data type. |
NvError_NotSupported | Writing GPH to a file is not supported. |
void NvPrintGPH | ( | void | ) |
Prints GPH information to console.
To print the GPH information properly, NvGphInit call should be made before this function.