1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-05 08:20:24 +08:00
Files
gozel/sysm_temperature.go
2026-03-24 00:49:26 +08:00

250 lines
14 KiB
Go

// Code generated by cmd/gen. DO NOT EDIT.
/*
*
* Copyright (C) 2019-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
* @file zes_api.h
* @version v1.15-r1.15.31
*
*/
package gozel
import (
"unsafe"
"github.com/fumiama/gozel/internal/zecall"
)
// ZesTempSensors (zes_temp_sensors_t) Temperature sensors
type ZesTempSensors uintptr
const (
ZES_TEMP_SENSORS_GLOBAL ZesTempSensors = 0 // ZES_TEMP_SENSORS_GLOBAL The maximum temperature across all device sensors
ZES_TEMP_SENSORS_GPU ZesTempSensors = 1 // ZES_TEMP_SENSORS_GPU The maximum temperature across all sensors in the GPU
ZES_TEMP_SENSORS_MEMORY ZesTempSensors = 2 // ZES_TEMP_SENSORS_MEMORY The maximum temperature across all sensors in the local memory
ZES_TEMP_SENSORS_GLOBAL_MIN ZesTempSensors = 3 // ZES_TEMP_SENSORS_GLOBAL_MIN The minimum temperature across all device sensors
ZES_TEMP_SENSORS_GPU_MIN ZesTempSensors = 4 // ZES_TEMP_SENSORS_GPU_MIN The minimum temperature across all sensors in the GPU
ZES_TEMP_SENSORS_MEMORY_MIN ZesTempSensors = 5 // ZES_TEMP_SENSORS_MEMORY_MIN The minimum temperature across all sensors in the local device memory
ZES_TEMP_SENSORS_GPU_BOARD ZesTempSensors = 6 // ZES_TEMP_SENSORS_GPU_BOARD The maximum temperature across all sensors in the GPU Board
ZES_TEMP_SENSORS_GPU_BOARD_MIN ZesTempSensors = 7 // ZES_TEMP_SENSORS_GPU_BOARD_MIN The minimum temperature across all sensors in the GPU Board
ZES_TEMP_SENSORS_VOLTAGE_REGULATOR ZesTempSensors = 8 // ZES_TEMP_SENSORS_VOLTAGE_REGULATOR The maximum temperature across all sensors in the Voltage Regulator
ZES_TEMP_SENSORS_FORCE_UINT32 ZesTempSensors = 0x7fffffff // ZES_TEMP_SENSORS_FORCE_UINT32 Value marking end of ZES_TEMP_SENSORS_* ENUMs
)
// ZesTempProperties (zes_temp_properties_t) Temperature sensor properties
type ZesTempProperties struct {
Stype ZesStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in,out][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Type ZesTempSensors // Type [out] Which part of the device the temperature sensor measures
Onsubdevice ZeBool // Onsubdevice [out] True if the resource is located on a sub-device; false means that the resource is on the device of the calling Sysman handle
Subdeviceid uint32 // Subdeviceid [out] If onSubdevice is true, this gives the ID of the sub-device
Maxtemperature float64 // Maxtemperature [out] Will contain the maximum temperature for the specific device in degrees Celsius.
Iscriticaltempsupported ZeBool // Iscriticaltempsupported [out] Indicates if the critical temperature event ::ZES_EVENT_TYPE_FLAG_TEMP_CRITICAL is supported
Isthreshold1supported ZeBool // Isthreshold1supported [out] Indicates if the temperature threshold 1 event ::ZES_EVENT_TYPE_FLAG_TEMP_THRESHOLD1 is supported
Isthreshold2supported ZeBool // Isthreshold2supported [out] Indicates if the temperature threshold 2 event ::ZES_EVENT_TYPE_FLAG_TEMP_THRESHOLD2 is supported
}
// ZesTempThreshold (zes_temp_threshold_t) Temperature sensor threshold
type ZesTempThreshold struct {
Enablelowtohigh ZeBool // Enablelowtohigh [in,out] Trigger an event when the temperature crosses from below the threshold to above.
Enablehightolow ZeBool // Enablehightolow [in,out] Trigger an event when the temperature crosses from above the threshold to below.
Threshold float64 // Threshold [in,out] The threshold in degrees Celsius.
}
// ZesTempConfig (zes_temp_config_t) Temperature configuration - which events should be triggered and the
/// trigger conditions.
type ZesTempConfig struct {
Stype ZesStructureType // Stype [in] type of this structure
Pnext unsafe.Pointer // Pnext [in][optional] must be null or a pointer to an extension-specific structure (i.e. contains stype and pNext).
Enablecritical ZeBool // Enablecritical [in,out] Indicates if event ::ZES_EVENT_TYPE_FLAG_TEMP_CRITICAL should be triggered by the driver.
Threshold1 ZesTempThreshold // Threshold1 [in,out] Configuration controlling if and when event ::ZES_EVENT_TYPE_FLAG_TEMP_THRESHOLD1 should be triggered by the driver.
Threshold2 ZesTempThreshold // Threshold2 [in,out] Configuration controlling if and when event ::ZES_EVENT_TYPE_FLAG_TEMP_THRESHOLD2 should be triggered by the driver.
}
// ZesDeviceEnumTemperatureSensors Get handle of temperature sensors
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function should be lock-free.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hDevice`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pCount`
func ZesDeviceEnumTemperatureSensors(
hDevice ZesDeviceHandle, // hDevice [in] Sysman handle of the device.
pCount *uint32, // pCount [in,out] pointer to the number of components of this type. if count is zero, then the driver shall update the value with the total number of components of this type that are available. if count is greater than the number of components of this type that are available, then the driver shall update the value with the correct number of components.
phTemperature *ZesTempHandle, // phTemperature [in,out][optional][range(0, *pCount)] array of handle of components of this type. if count is less than the number of components of this type that are available, then the driver shall only retrieve that number of component handles.
) (ZeResult, error) {
return zecall.Call[ZeResult]("zesDeviceEnumTemperatureSensors", uintptr(hDevice), uintptr(unsafe.Pointer(pCount)), uintptr(unsafe.Pointer(phTemperature)))
}
// ZesTemperatureGetProperties Get temperature sensor properties
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function should be lock-free.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hTemperature`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pProperties`
func ZesTemperatureGetProperties(
hTemperature ZesTempHandle, // hTemperature [in] Handle for the component.
pProperties *ZesTempProperties, // pProperties [in,out] Will contain the temperature sensor properties.
) (ZeResult, error) {
return zecall.Call[ZeResult]("zesTemperatureGetProperties", uintptr(hTemperature), uintptr(unsafe.Pointer(pProperties)))
}
// ZesTemperatureGetConfig Get temperature configuration for this sensor - which events are
/// triggered and the trigger conditions
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function should be lock-free.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hTemperature`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pConfig`
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// + Temperature thresholds are not supported on this temperature sensor. Generally this is only supported for temperature sensor ::ZES_TEMP_SENSORS_GLOBAL.
/// + One or both of the thresholds is not supported. Check the `isThreshold1Supported` and `isThreshold2Supported` members of ::zes_temp_properties_t.
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// + User does not have permissions to request this feature.
func ZesTemperatureGetConfig(
hTemperature ZesTempHandle, // hTemperature [in] Handle for the component.
pConfig *ZesTempConfig, // pConfig [in,out] Returns current configuration.
) (ZeResult, error) {
return zecall.Call[ZeResult]("zesTemperatureGetConfig", uintptr(hTemperature), uintptr(unsafe.Pointer(pConfig)))
}
// ZesTemperatureSetConfig Set temperature configuration for this sensor - indicates which events
/// are triggered and the trigger conditions
///
/// @details
/// - Events ::ZES_EVENT_TYPE_FLAG_TEMP_CRITICAL will be triggered when
/// temperature reaches the critical range. Use the function
/// ::zesDeviceEventRegister() to start receiving this event.
/// - Events ::ZES_EVENT_TYPE_FLAG_TEMP_THRESHOLD1 and
/// ::ZES_EVENT_TYPE_FLAG_TEMP_THRESHOLD2 will be generated when
/// temperature cross the thresholds set using this function. Use the
/// function ::zesDeviceEventRegister() to start receiving these events.
/// - Only one running process can set the temperature configuration at a
/// time. If another process attempts to change the configuration, the
/// error ::ZE_RESULT_ERROR_NOT_AVAILABLE will be returned. The function
/// ::zesTemperatureGetConfig() will return the process ID currently
/// controlling these settings.
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function should be lock-free.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hTemperature`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pConfig`
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// + Temperature thresholds are not supported on this temperature sensor. Generally they are only supported for temperature sensor ::ZES_TEMP_SENSORS_GLOBAL.
/// + Enabling the critical temperature event is not supported. Check the `isCriticalTempSupported` member of ::zes_temp_properties_t.
/// + One or both of the thresholds is not supported. Check the `isThreshold1Supported` and `isThreshold2Supported` members of ::zes_temp_properties_t.
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// + User does not have permissions to request this feature.
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// + Another running process is controlling these settings.
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// + One or both the thresholds is above TjMax (see ::zesFrequencyOcGetTjMax()). Temperature thresholds must be below this value.
func ZesTemperatureSetConfig(
hTemperature ZesTempHandle, // hTemperature [in] Handle for the component.
pConfig *ZesTempConfig, // pConfig [in] New configuration.
) (ZeResult, error) {
return zecall.Call[ZeResult]("zesTemperatureSetConfig", uintptr(hTemperature), uintptr(unsafe.Pointer(pConfig)))
}
// ZesTemperatureGetState Get the temperature from a specified sensor
///
/// @details
/// - The application may call this function from simultaneous threads.
/// - The implementation of this function should be lock-free.
///
/// @returns
/// - ::ZE_RESULT_SUCCESS
/// - ::ZE_RESULT_ERROR_UNINITIALIZED
/// - ::ZE_RESULT_ERROR_DEVICE_LOST
/// - ::ZE_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
/// - ::ZE_RESULT_ERROR_INVALID_ARGUMENT
/// - ::ZE_RESULT_ERROR_UNSUPPORTED_FEATURE
/// - ::ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
/// - ::ZE_RESULT_ERROR_INSUFFICIENT_PERMISSIONS
/// - ::ZE_RESULT_ERROR_NOT_AVAILABLE
/// - ::ZE_RESULT_ERROR_DEVICE_REQUIRES_RESET
/// - ::ZE_RESULT_ERROR_DEVICE_IN_LOW_POWER_STATE
/// - ::ZE_RESULT_ERROR_UNKNOWN
/// - ::ZE_RESULT_ERROR_INVALID_NULL_HANDLE
/// + `nullptr == hTemperature`
/// - ::ZE_RESULT_ERROR_INVALID_NULL_POINTER
/// + `nullptr == pTemperature`
func ZesTemperatureGetState(
hTemperature ZesTempHandle, // hTemperature [in] Handle for the component.
pTemperature *float64, // pTemperature [in,out] Will contain the temperature read from the specified sensor in degrees Celsius.
) (ZeResult, error) {
return zecall.Call[ZeResult]("zesTemperatureGetState", uintptr(hTemperature), uintptr(unsafe.Pointer(pTemperature)))
}