Description: NvTegraHv Userspace library provides interfaces to request virtualization system for various services.
◆ DISPLAY_VM
| #define DISPLAY_VM "DISPLAY_VM" |
◆ NvOsType
enum for OS type
| Enumerator |
|---|
| Os_Non_Native | OS is running as non native.
|
| Os_Native | OS is running as Native.
|
| Os_Detection_Failed | OS detection failed.
|
Definition at line 166 of file nvtegrahv.h.
◆ NvHvCheckOsNative()
| int32_t NvHvCheckOsNative |
( |
void |
| ) |
|
Userspace API to check whether running on Virtualized System or Native.
- QNX: This API internally checks if "/dev/nvhv" node is present or not. This devnode is present only on virtualized system.
- Linux: This API internally checks if "/sys/class/tegra_hv/vmid" node is present or not. This sysfs node is present only on virtualized system.
- Parameters
-
- Returns
- 0 Running on Virtualized System
1 Native
-1 Failed
- Precondition
- QNX:
- To be able to call this API, GID of nvhv should be in Supplementary Group IDs list of client process.
- Linux:
- To be able to call this API, GID "vmid" should be in Supplementary Group IDs list of client process.
- Tegra hv driver in linux kernel should have been initialized successfully in kernel to expose sysfs node.
- Postcondition
- Client is provided with information on the environment it is running(Native or Virtualized System).
Usage considerations
- Allowed context for the API call
- Interrupt handler: Yes(QNX), NA(Linux)
- Signal handler: Yes(QNX), No(Linux)
- Thread safe: Yes(QNX), No(Linux)
- Re-entrant: Yes
- Async/Sync: Sync
- Required Privileges(QNX):
- Allowed execution state
- Initialization: Yes(QNX), No(Linux)
- Operational: Yes
- Reinit/Deinit Preparation: Yes(QNX), No(Linux)
- Maturity: GA
◆ NvHvGetOsVmId()
| int32_t NvHvGetOsVmId |
( |
uint32_t * |
vmid | ) |
|
API to get Vitual Machine ID.
This API requests virtualization system to get current VM ID.
- Parameters
-
| [out] | vmid | Guest VM ID. Memory for this shall be allocated by calling function/process. |
- Returns
- EOK Success
- ENODEV Failed to open NvHv device node(QNX)
- ENODEV Failed to open NvHv sysfs node(Linux)
- EINVAL Invalid argument
- EACCES Client doesn't have privilege to call this API(QNX)
- EFAULT devctl call to NvHv device node returned failure(QNX)
- EFAULT read call to NvHv sysfs node returned failure(Linux)
- Precondition
- QNX:
- To be able to call this API, GID of nvhv should be in Supplementary Group IDs list of client process.
- Linux:
- To be able to call this API, GID "vmid" should be in Supplementary Group IDs list of client process.
- Tegra hv driver in linux kernel should have been initialized successfully in kernel to expose sysfs node.
- Postcondition
- Client is provided with Vitual Machine ID
Usage considerations
- Allowed context for the API call
- Interrupt handler: No(QNX), NA(Linux)
- Signal handler: No
- Thread safe: Yes(QNX), No(Linux)
- Re-entrant: Yes
- Async/Sync: Sync
- Required Privileges(QNX):
- Custom abilities: nvhv/get_gid
- Allowed execution state
- Initialization: Yes(QNX), No(Linux)
- Operational: Yes
- Reinit/Deinit Preparation: Yes(QNX), No(Linux)
- Maturity: GA