Browse Source

Merge commit 'fd83783' into bfgminer-4.10.x

Conflicts:
	AUTHORS
Luke Dashjr 11 years ago
parent
commit
92e8f936a1
2 changed files with 6 additions and 3 deletions
  1. 2 0
      AUTHORS
  2. 4 3
      driver-cpu.c

+ 2 - 0
AUTHORS

@@ -53,6 +53,8 @@ Jason Snell <abysss@gmail.com>
 Jean-Luc Cooke <jlcooke@certainkey.com>
 Jean-Luc Cooke <jlcooke@certainkey.com>
 Jonathan Lynch <jonathan.lynch@intel.com>
 Jonathan Lynch <jonathan.lynch@intel.com>
 Josh Lehan <krellan@krellan.net>
 Josh Lehan <krellan@krellan.net>
+Kiyoaki Matsugae <matsugae.kiyoaki@gmail.com>
+Lauri Kasanen <curaga@operamail.com>
 Lingchao Xu <lingchao.xu@bitmaintech.com>
 Lingchao Xu <lingchao.xu@bitmaintech.com>
 Mark Crichton <crichton@gmail.com>
 Mark Crichton <crichton@gmail.com>
 Martin Danielsen <kalroth@gmail.com>
 Martin Danielsen <kalroth@gmail.com>

+ 4 - 3
driver-cpu.c

@@ -48,6 +48,7 @@ BFG_REGISTER_DRIVER(cpu_drv)
 static inline void drop_policy(void)
 static inline void drop_policy(void)
 {
 {
 	struct sched_param param;
 	struct sched_param param;
+	param.sched_priority = 0;
 
 
 #ifdef SCHED_BATCH
 #ifdef SCHED_BATCH
 #ifdef SCHED_IDLE
 #ifdef SCHED_IDLE
@@ -63,7 +64,7 @@ static inline void affine_to_cpu(int id, int cpu)
 
 
 	CPU_ZERO(&set);
 	CPU_ZERO(&set);
 	CPU_SET(cpu, &set);
 	CPU_SET(cpu, &set);
-	sched_setaffinity(0, sizeof(&set), &set);
+	sched_setaffinity(0, sizeof(set), &set);
 	applog(LOG_INFO, "Binding cpu mining thread %d to cpu %d", id, cpu);
 	applog(LOG_INFO, "Binding cpu mining thread %d to cpu %d", id, cpu);
 }
 }
 #else
 #else
@@ -733,10 +734,10 @@ static int cpu_autodetect()
 	}
 	}
 	#elif defined(_SC_NPROCESSORS_ONLN)
 	#elif defined(_SC_NPROCESSORS_ONLN)
 		num_processors = sysconf(_SC_NPROCESSORS_ONLN);
 		num_processors = sysconf(_SC_NPROCESSORS_ONLN);
-	#elif defined(HW_NCPU)
+	#elif defined(CTL_HW) && defined(HW_NCPU)
 		int req[] = { CTL_HW, HW_NCPU };
 		int req[] = { CTL_HW, HW_NCPU };
 		size_t len = sizeof(num_processors);
 		size_t len = sizeof(num_processors);
-		v = sysctl(req, 2, &num_processors, &len, NULL, 0);
+		sysctl(req, 2, &num_processors, &len, NULL, 0);
 	#else
 	#else
 		num_processors = 1;
 		num_processors = 1;
 	#endif /* !WIN32 */
 	#endif /* !WIN32 */