#define hc_dlsym dlsym
#endif
+#define HC_LOAD_FUNC(ptr,name,type,libname,noerr) \
+ ptr->name = (type) hc_dlsym (ptr->lib, #name); \
+ if (!ptr->name) { \
+ if (noerr == 1) { \
+ log_error ("ERROR: %s is missing from %s shared library.", #name, #libname); \
+ exit (-1); \
+ } else { \
+ log_info ("WARNING: %s is missing from %s shared library.", #name, #libname); \
+ return (-1); \
+ } \
+ }
+
+#define HC_LOAD_ADDR(ptr,name,type,func,addr,libname,noerr) \
+ ptr->name = (type) (*ptr->func) (addr); \
+ if (!ptr->name) { \
+ if (noerr == 1) { \
+ log_error ("ERROR: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
+ exit (-1); \
+ } else { \
+ log_error ("WARNING: %s at address %08x is missing from %s shared library.", #name, addr, #libname); \
+ return (-1); \
+ } \
+ }
+
/**
* system stuff
*/
* temperature management
*/
-#ifdef LINUX
-#include <ext_nvml.h>
+#if _WIN
#include <ext_ADL.h>
-#endif
-
-#ifdef WIN
#include <ext_nvapi.h>
+#else
#include <ext_ADL.h>
-#endif
-
-#ifdef OSX
-#include <ext_smi.h>
-#include <ext_dummy.h>
+#include <ext_nvml.h>
#endif
/**
* password lengths supported
*/
-#define PW_LENGTH_MIN_0 0
-#define PW_LENGTH_MAX_0 55
-#define PW_LENGTH_MIN_400 0
-#define PW_LENGTH_MAX_400 40
-#define PW_LENGTH_MIN_500 0
-#define PW_LENGTH_MAX_500 15
-#define PW_LENGTH_MIN_1600 0
-#define PW_LENGTH_MAX_1600 15
-#define PW_LENGTH_MIN_1800 0
-#define PW_LENGTH_MAX_1800 15
-#define PW_LENGTH_MIN_2500 0
-#define PW_LENGTH_MAX_2500 64
-#define PW_LENGTH_MIN_6300 0
-#define PW_LENGTH_MAX_6300 15
-#define PW_LENGTH_MIN_7400 0
-#define PW_LENGTH_MAX_7400 15
+#define PW_LENGTH_MIN_0 0
+#define PW_LENGTH_MAX_0 55
+#define PW_LENGTH_MIN_400 0
+#define PW_LENGTH_MAX_400 40
+#define PW_LENGTH_MIN_500 0
+#define PW_LENGTH_MAX_500 15
+#define PW_LENGTH_MIN_1600 0
+#define PW_LENGTH_MAX_1600 15
+#define PW_LENGTH_MIN_1800 0
+#define PW_LENGTH_MAX_1800 15
+#define PW_LENGTH_MIN_2500 0
+#define PW_LENGTH_MAX_2500 64
+#define PW_LENGTH_MIN_6300 0
+#define PW_LENGTH_MAX_6300 15
+#define PW_LENGTH_MIN_7400 0
+#define PW_LENGTH_MAX_7400 15
/**
* device accel macro
int hm_get_adapter_index_nv (HM_ADAPTER_NV nvGPUHandle[DEVICES_MAX]);
#endif
-// int hm_get_device_num (HM_LIB hm_dll_amd, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
-
-// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
-
#ifdef HAVE_ADL
-int get_adapters_num_amd (HM_LIB hm_dll_amd, int *iNumberAdapters);
+int get_adapters_num_amd (void *adl, int *iNumberAdapters);
int hm_get_adapter_index_amd (hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
-LPAdapterInfo hm_get_adapter_info_amd (HM_LIB hm_dll_amd, int iNumberAdapters);
+LPAdapterInfo hm_get_adapter_info_amd (void *adl, int iNumberAdapters);
u32 *hm_get_list_valid_adl_adapters (int iNumberAdapters, int *num_adl_adapters, LPAdapterInfo lpAdapterInfo);
-int hm_get_overdrive_version (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
-int hm_check_fanspeed_control (HM_LIB hm_dll_amd, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
-#endif // HAVE_ADL
+int hm_get_overdrive_version (void *adl, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
+int hm_check_fanspeed_control (void *adl, hm_attrs_t *hm_device, u32 *valid_adl_device_list, int num_adl_adapters, LPAdapterInfo lpAdapterInfo);
-#if defined(HAVE_ADL) || defined(HAVE_NVML)
-void hm_close (HM_LIB hm_dll);
-
-HM_LIB hm_init (const cl_uint vendor_id);
-#endif
+// int hm_get_device_num (void *adl, HM_ADAPTER_AMD hm_adapter_index, int *hm_device_num);
+// void hm_get_opencl_busid_devid (hm_attrs_t *hm_device, uint opencl_num_devices, cl_device_id *devices);
+#endif // HAVE_ADL
int hm_get_temperature_with_device_id (const uint device_id);
int hm_get_fanspeed_with_device_id (const uint device_id);