patch-2.3.99-pre6 linux/include/asm-ia64/smp.h

Next file: linux/include/asm-ia64/spinlock.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.3.99-pre5/linux/include/asm-ia64/smp.h linux/include/asm-ia64/smp.h
@@ -18,10 +18,17 @@
 #include <asm/ptrace.h>
 #include <asm/io.h>
 
-#define IPI_DEFAULT_BASE_ADDR	0xfee00000
 #define XTP_OFFSET		0x1e0008
 
-#define smp_processor_id() (current->processor)
+#define SMP_IRQ_REDIRECTION     (1 << 0)
+#define SMP_IPI_REDIRECTION     (1 << 1)
+
+#define smp_processor_id()	(current->processor)
+
+struct smp_boot_data {
+	int cpu_count;
+	int cpu_map[NR_CPUS];
+};
 
 extern unsigned long cpu_present_map;
 extern unsigned long cpu_online_map;
@@ -29,52 +36,43 @@
 extern int bootstrap_processor;
 extern volatile int __cpu_number_map[NR_CPUS];
 extern volatile int __cpu_logical_map[NR_CPUS];
+extern unsigned char smp_int_redirect;
+extern char no_int_routing;
 
 #define cpu_number_map(i)	__cpu_number_map[i]
 #define cpu_logical_map(i)	__cpu_logical_map[i]
 
-#if defined(CONFIG_KDB)
-extern volatile unsigned long smp_kdb_wait;
-#endif  /* CONFIG_KDB */
-
 extern unsigned long ap_wakeup_vector;
 
 /*
  * XTP control functions:
  *    min_xtp   :  route all interrupts to this CPU
  *    normal_xtp:  nominal XTP value
- *    raise_xtp :  Route all interrupts away from this CPU
  *    max_xtp   :  never deliver interrupts to this CPU.
  */
 
-/* 
- * This turns off XTP based interrupt routing.  There is a bug in the handling of 
- * IRQ_INPROGRESS when the same vector appears on more than one CPU. 
- */
-extern int use_xtp;
-
 extern __inline void 
 min_xtp(void)
 {
-	if (use_xtp)
-		writeb(0x80, ipi_base_addr | XTP_OFFSET); /* XTP to min */
+	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+		writeb(0x00, ipi_base_addr | XTP_OFFSET); /* XTP to min */
 }
 
 extern __inline void
 normal_xtp(void)
 {
-	if (use_xtp)
-		writeb(0x8e, ipi_base_addr | XTP_OFFSET); /* XTP normal */
+	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+		writeb(0x08, ipi_base_addr | XTP_OFFSET); /* XTP normal */
 }
 
 extern __inline void
 max_xtp(void) 
 {
-	if (use_xtp)
-		writeb(0x8f, ipi_base_addr | XTP_OFFSET); /* Set XTP to max... */
+	if (smp_int_redirect & SMP_IRQ_REDIRECTION)
+		writeb(0x0f, ipi_base_addr | XTP_OFFSET); /* Set XTP to max */
 }
 
-extern __inline unsigned int 
+extern __inline__ unsigned int 
 hard_smp_processor_id(void)
 {
 	struct {
@@ -84,18 +82,19 @@
 		unsigned long ignored : 32;
 	} lid;
 
-	__asm__ __volatile__ ("mov %0=cr.lid" : "=r" (lid));
+	__asm__ ("mov %0=cr.lid" : "=r" (lid));
 
-	/*
-	 * Damn.  IA64 CPU ID's are 16 bits long, Linux expect the hard id to be 
-	 * in the range 0..31.  So, return the low-order bits of the bus-local ID 
-	 * only and hope it's less than 32. This needs to be fixed...
-	 */
-	return (lid.id & 0x0f);
+#ifdef LARGE_CPU_ID_OK
+	return lid.eid << 8 | lid.id;
+#else
+	if (((lid.id << 8) | lid.eid) > NR_CPUS)
+		printk("WARNING: SMP ID %d > NR_CPUS\n", (lid.id << 8) | lid.eid);
+	return lid.id;
+#endif
 }
 
-#define NO_PROC_ID 0xffffffff
-#define PROC_CHANGE_PENALTY 20
+#define NO_PROC_ID		(-1)
+#define PROC_CHANGE_PENALTY	20
 
 extern void __init init_smp_config (void);
 extern void smp_do_timer (struct pt_regs *regs);

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