Preparation for easier integration of:
* https://github.com/hashcat/hashcat/pull/485 * https://github.com/hashcat/hashcat/pull/486
This commit is contained in:
+12
-17
@@ -5,12 +5,7 @@
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef EXT_NVAPI_H
|
||||
#define EXT_NVAPI_H
|
||||
|
||||
#if defined(HAVE_HWMON)
|
||||
|
||||
#include <common.h>
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* Declarations from nvapi.h and subheaders
|
||||
@@ -205,7 +200,7 @@ typedef struct
|
||||
|
||||
} NV_GPU_COOLER_LEVELS;
|
||||
|
||||
NVAPI_INTERFACE NvAPI_QueryInterface (uint offset);
|
||||
NVAPI_INTERFACE NvAPI_QueryInterface (unsigned int offset);
|
||||
NVAPI_INTERFACE NvAPI_Initialize ();
|
||||
NVAPI_INTERFACE NvAPI_Unload ();
|
||||
NVAPI_INTERFACE NvAPI_GetErrorMessage (NvAPI_Status nr,NvAPI_ShortString szDesc);
|
||||
@@ -221,15 +216,13 @@ NVAPI_INTERFACE NvAPI_GPU_RestoreCoolerSettings (NvPhysicalGpuHandle hPhysicalGp
|
||||
|
||||
typedef NvPhysicalGpuHandle HM_ADAPTER_NVAPI;
|
||||
|
||||
#include <shared.h>
|
||||
|
||||
#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
|
||||
#define NVAPI_API_CALL __stdcall
|
||||
#else
|
||||
#define NVAPI_API_CALL
|
||||
#endif
|
||||
|
||||
typedef int *(*NVAPI_API_CALL NVAPI_QUERYINTERFACE) (uint);
|
||||
typedef int *(*NVAPI_API_CALL NVAPI_QUERYINTERFACE) (unsigned int);
|
||||
typedef int (*NVAPI_API_CALL NVAPI_INITIALIZE) (void);
|
||||
typedef int (*NVAPI_API_CALL NVAPI_UNLOAD) (void);
|
||||
typedef int (*NVAPI_API_CALL NVAPI_GETERRORMESSAGE) (NvAPI_Status, NvAPI_ShortString);
|
||||
@@ -239,6 +232,12 @@ typedef int (*NVAPI_API_CALL NVAPI_GPU_GETPERFPOLICIESSTATUS) (NvPhysicalGpuHand
|
||||
typedef int (*NVAPI_API_CALL NVAPI_GPU_SETCOOLERLEVELS) (NvPhysicalGpuHandle, NvU32, NV_GPU_COOLER_LEVELS *);
|
||||
typedef int (*NVAPI_API_CALL NVAPI_GPU_RESTORECOOLERSETTINGS) (NvPhysicalGpuHandle, NvU32);
|
||||
|
||||
#ifdef _POSIX
|
||||
typedef void *NVAPI_LIB;
|
||||
#else
|
||||
typedef HINSTANCE NVAPI_LIB;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
NVAPI_LIB lib;
|
||||
@@ -255,12 +254,12 @@ typedef struct
|
||||
|
||||
} hm_nvapi_lib_t;
|
||||
|
||||
#define NVAPI_PTR hm_nvapi_lib_t
|
||||
typedef hm_nvapi_lib_t NVAPI_PTR;
|
||||
|
||||
int nvapi_init (NVAPI_PTR *nvapi);
|
||||
int nvapi_init (NVAPI_PTR *nvapi);
|
||||
void nvapi_close (NVAPI_PTR *nvapi);
|
||||
|
||||
int hm_NvAPI_QueryInterface (NVAPI_PTR *nvapi, uint offset);
|
||||
int hm_NvAPI_QueryInterface (NVAPI_PTR *nvapi, unsigned int offset);
|
||||
int hm_NvAPI_Initialize (NVAPI_PTR *nvapi);
|
||||
int hm_NvAPI_Unload (NVAPI_PTR *nvapi);
|
||||
int hm_NvAPI_GetErrorMessage (NVAPI_PTR *nvapi, NvAPI_Status nr, NvAPI_ShortString szDesc);
|
||||
@@ -269,7 +268,3 @@ int hm_NvAPI_GPU_GetPerfPoliciesInfo (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhy
|
||||
int hm_NvAPI_GPU_GetPerfPoliciesStatus (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NV_GPU_PERF_POLICIES_STATUS_PARAMS_V1 *perfPolicies_status);
|
||||
int hm_NvAPI_GPU_SetCoolerLevels (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex, NV_GPU_COOLER_LEVELS *pCoolerLevels);
|
||||
int hm_NvAPI_GPU_RestoreCoolerSettings (NVAPI_PTR *nvapi, NvPhysicalGpuHandle hPhysicalGpu, NvU32 coolerIndex);
|
||||
|
||||
#endif // HAVE_HWMON
|
||||
|
||||
#endif // EXT_NVAPI_H
|
||||
|
||||
Reference in New Issue
Block a user