deviceapi.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __DEVICEAPI_H__
  2. #define __DEVICEAPI_H__
  3. #include <stdbool.h>
  4. #include <stdint.h>
  5. #include <sys/time.h>
  6. #include "miner.h"
  7. extern void request_work(struct thr_info *);
  8. extern struct work *get_work(struct thr_info *);
  9. extern bool hashes_done(struct thr_info *, int64_t hashes, struct timeval *tvp_hashes, uint32_t *max_nonce);
  10. extern void mt_disable_start(struct thr_info *);
  11. extern void mt_disable_finish(struct thr_info *);
  12. extern void mt_disable(struct thr_info *); // blocks until reenabled
  13. extern int restart_wait(struct thr_info *, unsigned int ms);
  14. extern void minerloop_scanhash(struct thr_info *);
  15. extern bool do_job_prepare(struct thr_info *, struct timeval *tvp_now);
  16. extern void job_prepare_complete(struct thr_info *);
  17. extern void do_get_results(struct thr_info *, bool proceed_with_new_job);
  18. extern void job_results_fetched(struct thr_info *);
  19. extern void do_job_start(struct thr_info *);
  20. extern void mt_job_transition(struct thr_info *);
  21. extern void job_start_complete(struct thr_info *);
  22. extern void job_start_abort(struct thr_info *, bool failure);
  23. extern bool do_process_results(struct thr_info *, struct timeval *tvp_now, struct work *, bool stopping);
  24. extern void minerloop_async(struct thr_info *);
  25. extern void minerloop_queue(struct thr_info *);
  26. extern void *miner_thread(void *);
  27. #endif