Browse Source

work_{get,set}_ntime inline functions

Luke Dashjr 11 years ago
parent
commit
8b884cf829
1 changed files with 16 additions and 0 deletions
  1. 16 0
      miner.h

+ 16 - 0
miner.h

@@ -1528,6 +1528,22 @@ extern const char *bfg_workpadding_bin;
 extern void set_simple_ntime_roll_limit(struct ntime_roll_limits *, uint32_t ntime_base, int ntime_roll, const struct timeval *tvp_ref);
 extern void work_set_simple_ntime_roll_limit(struct work *, int ntime_roll, const struct timeval *tvp_ref);
 extern void work_hash(struct work *);
+
+#define NTIME_DATA_OFFSET  0x44
+
+static inline
+uint32_t work_get_ntime(const struct work * const work)
+{
+	return upk_u32be(work->data, 0x44);
+}
+
+static inline
+void work_set_ntime(struct work * const work, const uint32_t ntime)
+{
+	pk_u32be(work->data, 0x44, ntime);
+}
+
+
 extern char *devpath_to_devid(const char *);
 extern struct thr_info *get_thread(int thr_id);
 extern struct cgpu_info *get_devices(int id);