summaryrefslogtreecommitdiffstats
path: root/include/asm-sparc/smp.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
committer <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
commit19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch)
tree40b1cb534496a7f1ca0f5c314a523c69f1fee464 /include/asm-sparc/smp.h
parent7206675c40394c78a90e74812bbdbf8cf3cca1be (diff)
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'include/asm-sparc/smp.h')
-rw-r--r--include/asm-sparc/smp.h74
1 files changed, 13 insertions, 61 deletions
diff --git a/include/asm-sparc/smp.h b/include/asm-sparc/smp.h
index 0d1cab1eb..7d4106b03 100644
--- a/include/asm-sparc/smp.h
+++ b/include/asm-sparc/smp.h
@@ -15,6 +15,8 @@ struct prom_cpuinfo {
int prom_node;
int mid;
};
+extern int linux_num_cpus; /* number of CPUs probed */
+
#endif /* !(__ASSEMBLY__) */
#ifdef __SMP__
@@ -27,12 +29,18 @@ extern struct prom_cpuinfo linux_cpus[NCPUS];
struct cpuinfo_sparc {
unsigned long udelay_val; /* that's it */
+ unsigned short next;
+ unsigned short mid;
};
extern struct cpuinfo_sparc cpu_data[NR_CPUS];
-typedef __volatile__ unsigned char klock_t;
-extern klock_t kernel_flag;
+struct klock_info {
+ unsigned char kernel_flag;
+ unsigned char akp;
+};
+
+extern struct klock_info klock_info;
#define KLOCK_HELD 0xff
#define KLOCK_CLEAR 0x00
@@ -44,15 +52,6 @@ extern klock_t kernel_flag;
extern int smp_found_cpus;
extern unsigned char boot_cpu_id;
extern unsigned long cpu_present_map;
-extern __volatile__ unsigned long smp_invalidate_needed[NR_CPUS];
-extern __volatile__ unsigned long kernel_counter;
-extern __volatile__ unsigned char active_kernel_processor;
-extern void smp_message_irq(void);
-extern unsigned long ipi_count;
-extern __volatile__ unsigned long kernel_counter;
-extern __volatile__ unsigned long syscall_count;
-
-extern void print_lock_state(void);
typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long,
unsigned long, unsigned long);
@@ -66,8 +65,6 @@ extern void smp_boot_cpus(void);
extern void smp_store_cpu_info(int id);
extern void smp_cross_call(smpfunc_t func, unsigned long arg1, unsigned long arg2,
unsigned long arg3, unsigned long arg4, unsigned long arg5);
-extern void smp_capture(void);
-extern void smp_release(void);
extern __inline__ void xc0(smpfunc_t func) { smp_cross_call(func, 0, 0, 0, 0, 0); }
extern __inline__ void xc1(smpfunc_t func, unsigned long arg1)
@@ -86,6 +83,7 @@ extern __inline__ void xc5(smpfunc_t func, unsigned long arg1, unsigned long arg
extern __volatile__ int cpu_number_map[NR_CPUS];
extern __volatile__ int cpu_logical_map[NR_CPUS];
+extern unsigned long smp_proc_in_lock[NR_CPUS];
extern __inline__ int smp_processor_id(void)
{
@@ -98,54 +96,9 @@ extern __inline__ int smp_processor_id(void)
return cpuid;
}
-
-extern __volatile__ unsigned long smp_proc_in_lock[NR_CPUS]; /* for computing process time */
-extern __volatile__ int smp_process_available;
-
-extern __inline__ int smp_swap(volatile int *addr, int value)
-{
- __asm__ __volatile__("swap [%2], %0\n\t" :
- "=&r" (value) :
- "0" (value), "r" (addr));
- return value;
-}
-
-extern __inline__ __volatile__ void inc_smp_counter(volatile int *ctr)
-{
- int tmp;
-
- while((tmp = smp_swap(ctr, -1)) == -1)
- while(*ctr == -1)
- ;
-
- *ctr = (tmp + 1);
-}
-
-extern __inline__ __volatile__ void dec_smp_counter(volatile int *ctr)
-{
- int tmp;
-
- while((tmp = smp_swap(ctr, -1)) == -1)
- while(*ctr == -1)
- ;
-
- *ctr = (tmp - 1);
-}
-
-extern __inline__ __volatile__ int read_smp_counter(volatile int *ctr)
-{
- int value;
-
- while((value = *ctr) == -1)
- ;
-
- return value;
-}
-
#endif /* !(__ASSEMBLY__) */
/* Sparc specific messages. */
-#define MSG_CAPTURE 0x0004 /* Park a processor. */
#define MSG_CROSS_CALL 0x0005 /* run func on cpus */
/* Empirical PROM processor mailbox constants. If the per-cpu mailbox
@@ -159,9 +112,6 @@ extern __inline__ __volatile__ int read_smp_counter(volatile int *ctr)
#define MBOX_IDLECPU2 0xFD
#define MBOX_STOPCPU2 0xFE
-
-#define NO_PROC_ID 0xFF
-
#define PROC_CHANGE_PENALTY 20
#define SMP_FROM_INT 1
@@ -169,4 +119,6 @@ extern __inline__ __volatile__ int read_smp_counter(volatile int *ctr)
#endif /* !(__SMP__) */
+#define NO_PROC_ID 0xFF
+
#endif /* !(_SPARC_SMP_H) */