linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH][2.6-mm] cpumask_t - ioapic set_ioapic_affinity
@ 2003-08-12  5:43 Zwane Mwaikambo
  2003-08-12 14:52 ` Andi Kleen
  0 siblings, 1 reply; 2+ messages in thread
From: Zwane Mwaikambo @ 2003-08-12  5:43 UTC (permalink / raw)
  To: Linux Kernel; +Cc: William Lee Irwin III, Andi Kleen

Hi Andi,
	Would this be an ok way to program the destination? I noticed that 
your default target is 1 (TARGET_CPUS)

arch/x86_64/kernel/io_apic.c:1311: warning: initialization from 
incompatible pointer type
arch/x86_64/kernel/io_apic.c:1322: warning: initialization from 
incompatible pointer type

Index: linux-2.6.0-test3-x86_64/include/asm-x86_64/smp.h
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test3/include/asm-x86_64/smp.h,v
retrieving revision 1.2
diff -u -p -B -r1.2 smp.h
--- linux-2.6.0-test3-x86_64/include/asm-x86_64/smp.h	12 Aug 2003 05:35:44 -0000	1.2
+++ linux-2.6.0-test3-x86_64/include/asm-x86_64/smp.h	12 Aug 2003 05:36:15 -0000
@@ -67,8 +67,6 @@ static inline int num_booting_cpus(void)
 	return cpus_weight(cpu_callout_map);
 }
 
-extern cpumask_t cpu_callout_map;
-
 #define smp_processor_id() read_pda(cpunumber)
 
 extern __inline int hard_smp_processor_id(void)
@@ -96,6 +94,12 @@ extern inline int safe_smp_processor_id(
 #define INT_DELIVERY_MODE 1     /* logical delivery */
 #define TARGET_CPUS 1
 
+#ifndef ASSEMBLY
+static inline unsigned int cpu_mask_to_apicid(cpumask_const_t cpumask)
+{
+	return cpus_coerce_const(cpumask);
+}
+#endif
 
 #ifndef CONFIG_SMP
 #define stack_smp_processor_id() 0
Index: linux-2.6.0-test3-x86_64/arch/x86_64/kernel/io_apic.c
===================================================================
RCS file: /build/cvsroot/linux-2.6.0-test3/arch/x86_64/kernel/io_apic.c,v
retrieving revision 1.2
diff -u -p -B -r1.2 io_apic.c
--- linux-2.6.0-test3-x86_64/arch/x86_64/kernel/io_apic.c	12 Aug 2003 04:56:16 -0000	1.2
+++ linux-2.6.0-test3-x86_64/arch/x86_64/kernel/io_apic.c	12 Aug 2003 05:11:50 -0000
@@ -1278,16 +1278,20 @@ static void end_level_ioapic_irq (unsign
 
 static void mask_and_ack_level_ioapic_irq (unsigned int irq) { /* nothing */ }
 
-static void set_ioapic_affinity (unsigned int irq, unsigned long mask)
+static void set_ioapic_affinity (unsigned int irq, cpumask_t mask)
 {
 	unsigned long flags;
+	unsigned int dest;
+
+	dest = cpu_mask_to_apicid(mk_cpumask_const(mask));
+
 	/*
 	 * Only the first 8 bits are valid.
 	 */
-	mask = mask << 24;
+	dest = dest << 24;
 
 	spin_lock_irqsave(&ioapic_lock, flags);
-	__DO_ACTION(1, = mask, )
+	__DO_ACTION(1, = dest, )
 	spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][2.6-mm] cpumask_t - ioapic set_ioapic_affinity
  2003-08-12  5:43 [PATCH][2.6-mm] cpumask_t - ioapic set_ioapic_affinity Zwane Mwaikambo
@ 2003-08-12 14:52 ` Andi Kleen
  0 siblings, 0 replies; 2+ messages in thread
From: Andi Kleen @ 2003-08-12 14:52 UTC (permalink / raw)
  To: Zwane Mwaikambo; +Cc: Linux Kernel, William Lee Irwin III, Andi Kleen

> -static void set_ioapic_affinity (unsigned int irq, unsigned long mask)
> +static void set_ioapic_affinity (unsigned int irq, cpumask_t mask)
>  {
>  	unsigned long flags;
> +	unsigned int dest;
> +
> +	dest = cpu_mask_to_apicid(mk_cpumask_const(mask));
> +
>  	/*
>  	 * Only the first 8 bits are valid.
>  	 */
> -	mask = mask << 24;
> +	dest = dest << 24;
>  
>  	spin_lock_irqsave(&ioapic_lock, flags);
> -	__DO_ACTION(1, = mask, )
> +	__DO_ACTION(1, = dest, )
>  	spin_unlock_irqrestore(&ioapic_lock, flags);

Looks ok.

-Andi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-08-12 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-12  5:43 [PATCH][2.6-mm] cpumask_t - ioapic set_ioapic_affinity Zwane Mwaikambo
2003-08-12 14:52 ` Andi Kleen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).