Browse Source

DevAPI: for_each_{managed,logical}_proc helper macros

Luke Dashjr 11 years ago
parent
commit
14ffc94cc7
1 changed files with 5 additions and 0 deletions
  1. 5 0
      deviceapi.h

+ 5 - 0
deviceapi.h

@@ -123,4 +123,9 @@ extern FILE *open_bitstream(const char *dname, const char *filename);
 
 
 extern void close_device_fd(struct thr_info *);
 extern void close_device_fd(struct thr_info *);
 
 
+#define for_each_managed_proc(procvar, dev)  \
+	for (struct cgpu_info *procvar = dev; procvar; procvar = procvar->next_proc)
+#define for_each_logical_proc(procvar, dev)  \
+	for (struct cgpu_info *procvar = dev; procvar->proc_id < dev->procs; procvar = procvar->next_proc)
+
 #endif
 #endif