patch-2.4.4 linux/include/asm-ia64/smp.h

Next file: linux/include/asm-ia64/smplock.h
Previous file: linux/include/asm-ia64/siginfo.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.3/linux/include/asm-ia64/smp.h linux/include/asm-ia64/smp.h
@@ -3,6 +3,8 @@
  *
  * Copyright (C) 1999 VA Linux Systems 
  * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ * Copyright (C) 2001 Hewlett-Packard Co
+ * Copyright (C) 2001 David Mosberger-Tang <davidm@hpl.hp.com>
  */
 #ifndef _ASM_IA64_SMP_H
 #define _ASM_IA64_SMP_H
@@ -15,13 +17,14 @@
 #include <linux/threads.h>
 #include <linux/kernel.h>
 
-#include <asm/ptrace.h>
 #include <asm/io.h>
+#include <asm/processor.h>
+#include <asm/ptrace.h>
 
 #define XTP_OFFSET		0x1e0008
 
-#define SMP_IRQ_REDIRECTION     (1 << 0)
-#define SMP_IPI_REDIRECTION     (1 << 1)
+#define SMP_IRQ_REDIRECTION	(1 << 0)
+#define SMP_IPI_REDIRECTION	(1 << 1)
 
 #define smp_processor_id()	(current->processor)
 
@@ -30,15 +33,15 @@
 	int cpu_phys_id[NR_CPUS];
 } smp_boot_data __initdata;
 
+extern char no_int_routing __initdata;
+
 extern unsigned long cpu_present_map;
 extern unsigned long cpu_online_map;
 extern unsigned long ipi_base_addr;
-extern int bootstrap_processor;
-extern volatile int __cpu_physical_id[NR_CPUS];
+extern int __cpu_physical_id[NR_CPUS];
 extern unsigned char smp_int_redirect;
-extern char no_int_routing;
 extern int smp_num_cpus;
-  
+
 #define cpu_physical_id(i)	__cpu_physical_id[i]
 #define cpu_number_map(i)	(i)
 #define cpu_logical_map(i)	(i)
@@ -54,54 +57,55 @@
 {
 	int i;
 
-	for (i=0; i<smp_num_cpus; i++) {
-		if (cpu_physical_id(i) == cpuid)
+	for (i = 0; i < smp_num_cpus; ++i)
+		if (cpu_physical_id(i) == (__u32) cpuid)
 			break;
-	}
 	return i;
 }
 
 /*
  * XTP control functions:
- *    min_xtp   :  route all interrupts to this CPU
- *    normal_xtp:  nominal XTP value
- *    max_xtp   :  never deliver interrupts to this CPU.
+ *	min_xtp   : route all interrupts to this CPU
+ *	normal_xtp: nominal XTP value
+ *	max_xtp   : never deliver interrupts to this CPU.
  */
 
 static inline void 
-min_xtp(void)
+min_xtp (void)
 {
 	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
 		writeb(0x00, ipi_base_addr | XTP_OFFSET); /* XTP to min */
 }
 
 static inline void
-normal_xtp(void)
+normal_xtp (void)
 {
 	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
 		writeb(0x08, ipi_base_addr | XTP_OFFSET); /* XTP normal */
 }
 
 static inline void
-max_xtp(void) 
+max_xtp (void) 
 {
 	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
 		writeb(0x0f, ipi_base_addr | XTP_OFFSET); /* Set XTP to max */
 }
 
 static inline unsigned int 
-hard_smp_processor_id(void)
+hard_smp_processor_id (void)
 {
-	struct {
-		unsigned long reserved : 16;
-		unsigned long eid : 8;
-		unsigned long id  : 8;
-		unsigned long ignored : 32;
+	union {
+		struct {
+			unsigned long reserved : 16;
+			unsigned long eid : 8;
+			unsigned long id : 8;
+			unsigned long ignored : 32;
+		} f;
+		unsigned long bits;
 	} lid;
 
-	__asm__ ("mov %0=cr.lid" : "=r" (lid));
-
-	return lid.id << 8 | lid.eid;
+	lid.bits = ia64_get_lid();
+	return lid.f.id << 8 | lid.f.eid;
 }
 
 #define NO_PROC_ID		(-1)
@@ -111,7 +115,7 @@
 extern void smp_do_timer (struct pt_regs *regs);
 
 extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
-			      int retry, int wait);
+				     int retry, int wait);
 
 
 #endif /* CONFIG_SMP */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)