mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 07:17:58 +00:00
Provide a flip128 helper to simplify big endian flipping.
This commit is contained in:
parent
c351f8d8d3
commit
8d81f1d207
@ -2440,9 +2440,7 @@ static bool submit_upstream_work(struct work *work, CURL *curl, bool resubmit)
|
|||||||
cgpu = get_thr_cgpu(thr_id);
|
cgpu = get_thr_cgpu(thr_id);
|
||||||
|
|
||||||
#ifdef __BIG_ENDIAN__
|
#ifdef __BIG_ENDIAN__
|
||||||
int swapcounter = 0;
|
flip128(work->data, work->data);
|
||||||
for (swapcounter = 0; swapcounter < 32; swapcounter++)
|
|
||||||
(((uint32_t*) (work->data))[swapcounter]) = swab32(((uint32_t*) (work->data))[swapcounter]);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* build hex string */
|
/* build hex string */
|
||||||
|
10
miner.h
10
miner.h
@ -660,6 +660,16 @@ static inline void flip80(void *dest_p, const void *src_p)
|
|||||||
dest[i] = swab32(src[i]);
|
dest[i] = swab32(src[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void flip128(void *dest_p, const void *src_p)
|
||||||
|
{
|
||||||
|
uint32_t *dest = dest_p;
|
||||||
|
const uint32_t *src = src_p;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < 32; i++)
|
||||||
|
dest[i] = swab32(src[i]);
|
||||||
|
}
|
||||||
|
|
||||||
extern void quit(int status, const char *format, ...);
|
extern void quit(int status, const char *format, ...);
|
||||||
|
|
||||||
static inline void mutex_lock(pthread_mutex_t *lock)
|
static inline void mutex_lock(pthread_mutex_t *lock)
|
||||||
|
Loading…
Reference in New Issue
Block a user