|
@@ -242,7 +242,7 @@ int icarus_gets(unsigned char *buf, int fd, struct timeval *tv_finish, struct th
|
|
|
return ICA_GETS_ERROR;
|
|
return ICA_GETS_ERROR;
|
|
|
|
|
|
|
|
if (first)
|
|
if (first)
|
|
|
- gettimeofday(tv_finish, NULL);
|
|
|
|
|
|
|
+ cgtime(tv_finish);
|
|
|
|
|
|
|
|
if (ret >= read_amount)
|
|
if (ret >= read_amount)
|
|
|
{
|
|
{
|
|
@@ -576,7 +576,7 @@ bool icarus_detect_custom(const char *devpath, struct device_drv *api, struct IC
|
|
|
|
|
|
|
|
hex2bin(ob_bin, golden_ob, sizeof(ob_bin));
|
|
hex2bin(ob_bin, golden_ob, sizeof(ob_bin));
|
|
|
icarus_write(fd, ob_bin, sizeof(ob_bin));
|
|
icarus_write(fd, ob_bin, sizeof(ob_bin));
|
|
|
- gettimeofday(&tv_start, NULL);
|
|
|
|
|
|
|
+ cgtime(&tv_start);
|
|
|
|
|
|
|
|
memset(nonce_bin, 0, sizeof(nonce_bin));
|
|
memset(nonce_bin, 0, sizeof(nonce_bin));
|
|
|
icarus_gets(nonce_bin, fd, &tv_finish, NULL, 1);
|
|
icarus_gets(nonce_bin, fd, &tv_finish, NULL, 1);
|
|
@@ -672,7 +672,7 @@ static bool icarus_prepare(struct thr_info *thr)
|
|
|
icarus->device_fd = fd;
|
|
icarus->device_fd = fd;
|
|
|
|
|
|
|
|
applog(LOG_INFO, "Opened Icarus on %s", icarus->device_path);
|
|
applog(LOG_INFO, "Opened Icarus on %s", icarus->device_path);
|
|
|
- gettimeofday(&now, NULL);
|
|
|
|
|
|
|
+ cgtime(&now);
|
|
|
get_datestamp(icarus->init, &now);
|
|
get_datestamp(icarus->init, &now);
|
|
|
|
|
|
|
|
struct icarus_state *state;
|
|
struct icarus_state *state;
|
|
@@ -766,7 +766,7 @@ static bool icarus_start_work(struct thr_info *thr, const unsigned char *ob_bin)
|
|
|
int ret;
|
|
int ret;
|
|
|
char *ob_hex;
|
|
char *ob_hex;
|
|
|
|
|
|
|
|
- gettimeofday(&state->tv_workstart, NULL);
|
|
|
|
|
|
|
+ cgtime(&state->tv_workstart);
|
|
|
|
|
|
|
|
ret = icarus_write(fd, ob_bin, 64);
|
|
ret = icarus_write(fd, ob_bin, 64);
|
|
|
if (ret) {
|
|
if (ret) {
|
|
@@ -996,7 +996,7 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
&& !was_hw_error
|
|
&& !was_hw_error
|
|
|
&& ((nonce & info->nonce_mask) > END_CONDITION)
|
|
&& ((nonce & info->nonce_mask) > END_CONDITION)
|
|
|
&& ((nonce & info->nonce_mask) < (info->nonce_mask & ~END_CONDITION))) {
|
|
&& ((nonce & info->nonce_mask) < (info->nonce_mask & ~END_CONDITION))) {
|
|
|
- gettimeofday(&tv_history_start, NULL);
|
|
|
|
|
|
|
+ cgtime(&tv_history_start);
|
|
|
|
|
|
|
|
history0 = &(info->history[0]);
|
|
history0 = &(info->history[0]);
|
|
|
|
|
|
|
@@ -1085,7 +1085,7 @@ static int64_t icarus_scanhash(struct thr_info *thr, struct work *work,
|
|
|
Hs, W, read_count, fullnonce);
|
|
Hs, W, read_count, fullnonce);
|
|
|
}
|
|
}
|
|
|
info->history_count++;
|
|
info->history_count++;
|
|
|
- gettimeofday(&tv_history_finish, NULL);
|
|
|
|
|
|
|
+ cgtime(&tv_history_finish);
|
|
|
|
|
|
|
|
timersub(&tv_history_finish, &tv_history_start, &tv_history_finish);
|
|
timersub(&tv_history_finish, &tv_history_start, &tv_history_finish);
|
|
|
timeradd(&tv_history_finish, &(info->history_time), &(info->history_time));
|
|
timeradd(&tv_history_finish, &(info->history_time), &(info->history_time));
|