|
|
|
@ -410,17 +410,10 @@ static void biforce_thread_enable(struct thr_info *thr)
@@ -410,17 +410,10 @@ static void biforce_thread_enable(struct thr_info *thr)
|
|
|
|
|
bitforce_init(bitforce); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void ms_to_timeval(unsigned int mstime, struct timeval *ttime) |
|
|
|
|
{ |
|
|
|
|
ttime->tv_sec = mstime / 1000; |
|
|
|
|
ttime->tv_usec = mstime * 1000 - (ttime->tv_sec * 1000000); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t __maybe_unused max_nonce) |
|
|
|
|
{ |
|
|
|
|
struct cgpu_info *bitforce = thr->cgpu; |
|
|
|
|
unsigned int sleep_time; |
|
|
|
|
struct timeval tdiff; |
|
|
|
|
uint64_t ret; |
|
|
|
|
|
|
|
|
|
bitforce->wait_ms = 0; |
|
|
|
@ -430,8 +423,7 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
@@ -430,8 +423,7 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
|
|
|
|
|
/* Initially wait 2/3 of the average cycle time so we can request more
|
|
|
|
|
work before full scan is up */ |
|
|
|
|
sleep_time = (2 * bitforce->sleep_ms) / 3; |
|
|
|
|
ms_to_timeval(sleep_time, &tdiff); |
|
|
|
|
if (!restart_wait(&tdiff)) |
|
|
|
|
if (!restart_wait(sleep_time)) |
|
|
|
|
return 1; |
|
|
|
|
|
|
|
|
|
bitforce->wait_ms += sleep_time; |
|
|
|
@ -439,15 +431,13 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
@@ -439,15 +431,13 @@ static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint6
|
|
|
|
|
|
|
|
|
|
/* Now wait athe final 1/3rd; no bitforce should be finished by now */ |
|
|
|
|
sleep_time = bitforce->sleep_ms - sleep_time; |
|
|
|
|
ms_to_timeval(sleep_time, &tdiff); |
|
|
|
|
if (!restart_wait(&tdiff)) |
|
|
|
|
if (!restart_wait(sleep_time)) |
|
|
|
|
return 1; |
|
|
|
|
|
|
|
|
|
bitforce->wait_ms += sleep_time; |
|
|
|
|
} else { |
|
|
|
|
sleep_time = bitforce->sleep_ms; |
|
|
|
|
ms_to_timeval(sleep_time, &tdiff); |
|
|
|
|
if (!restart_wait(&tdiff)) |
|
|
|
|
if (!restart_wait(sleep_time)) |
|
|
|
|
return 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|