mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* perfctr-2.6.1 build fix for amd64 in 2.6 SMP kernels
@ 2003-10-07 21:23 Mikael Pettersson
  0 siblings, 0 replies; only message in thread
From: Mikael Pettersson @ 2003-10-07 21:23 UTC (permalink / raw)
  To: perfctr-devel; +Cc: linux-kernel

This patch for perfctr-2.6.1 fixes a problem which causes a
compilation error for amd64 (aka x86-64) in 2.6 SMP kernels.

The problem is that cpu_isset(cpu,mask) requires that mask
is an lvalue (it uses test_bit()), but on amd64 I want to
pass in a constant (the mask is always empty). Oops.

Thanks to Bryan O'Sullivan for reporting the build error.

/Mikael

--- perfctr-2.6.1/linux/drivers/perfctr/cpumask.h.~1~	2003-09-07 22:15:38.000000000 +0200
+++ perfctr-2.6.1/linux/drivers/perfctr/cpumask.h	2003-10-07 20:19:52.000000000 +0200
@@ -38,6 +38,8 @@
    but cpumask_t compatibility issues forced it to be moved here. */
 #if PERFCTR_CPUS_FORBIDDEN_MASK_NEEDED
 extern cpumask_t perfctr_cpus_forbidden_mask;
+#define perfctr_cpu_is_forbidden(cpu)	cpu_isset((cpu), perfctr_cpus_forbidden_mask)
 #else
 #define perfctr_cpus_forbidden_mask	CPU_MASK_NONE
+#define perfctr_cpu_is_forbidden(cpu)	0 /* cpu_isset() needs an lvalue :-( */
 #endif
--- perfctr-2.6.1/linux/drivers/perfctr/global.c.~1~	2003-10-02 22:04:35.000000000 +0200
+++ perfctr-2.6.1/linux/drivers/perfctr/global.c	2003-10-07 20:19:52.000000000 +0200
@@ -138,7 +138,7 @@
 		return ret;
 	if( cpu_control.cpu >= NR_CPUS ||
 	    !cpu_online(cpu_control.cpu) ||
-	    cpu_isset(cpu_control.cpu, perfctr_cpus_forbidden_mask) )
+	    perfctr_cpu_is_forbidden(cpu_control.cpu) )
 		return -EINVAL;
 	/* we don't permit i-mode counters */
 	if( cpu_control.cpu_control.nrictrs != 0 )

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-10-07 21:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-07 21:23 perfctr-2.6.1 build fix for amd64 in 2.6 SMP kernels Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®