This source file includes following definitions.
- smp_processor_id
1
2
3
4
5
6 #ifndef _SPARC_SMP_H
7 #define _SPARC_SMP_H
8
9 #include <asm/bitops.h>
10 #include <asm/ptrace.h>
11
12
13
14 struct cpuinfo_sparc {
15 unsigned char impl;
16 unsigned char vers;
17 unsigned long udelay_val;
18 };
19
20 extern struct cpuinfo_sparc cpu_data[NR_CPUS];
21
22 typedef klock_t volatile unsigned char;
23 extern klock_t kernel_lock;
24
25 #define KLOCK_HELD 0xff
26 #define KLOCK_CLEAR 0x00
27
28 struct sparc_ipi_invalidate {
29 struct mm_struct *mm;
30 unsigned long addr;
31 unsigned long end;
32 };
33
34 struct sparc_ipimsg {
35 union {
36
37 struct sparc_ipi_invalidate invmsg;
38 };
39 };
40
41 extern void smp_scan_prom_for_cpus(unsigned long, unsigned long);
42 extern unsigned long smp_alloc_memory(unsigned long mem_base);
43 extern unsigned long *kernel_stacks[NR_CPUS];
44 extern unsigned char boot_cpu_id;
45 extern unsigned long cpu_present_map;
46 extern volatile unsigned long smp_invalidate_needed;
47 extern unsigned long kernel_counter;
48 extern volatile unsigned char active_kernel_processor;
49 extern void smp_message_irq(int cpl, struct pt_regs *regs);
50 extern void smp_reschedule_irq(int cpl, struct pt_regs *regs);
51 extern void smp_invalidate_rcv(void);
52 extern volatils unsigned long syscall_count;
53
54 extern void (*smp_invalidate_all)(void);
55 extern void (*smp_invalidate_mm)(struct mm_struct *);
56 extern void (*smp_invalidate_range)(struct mm_struct *, unsigned long, unsigned long);
57 extern void (*smp_invalidate_page)(struct vm_area_struct *, unsigned long);
58
59 extern void smp_callin(void);
60 extern void smp_boot_cpus(void);
61 extern void smp_store_cpu_info(int id);
62
63 extern _inline_ int smp_processor_id(void)
64 {
65 int cpuid;
66
67 __asm__ __volatile__("rd %%tbr, %0\n\t"
68 "srl %0, 24, %0\n\t"
69 "and %0, 3, %0\n\t" :
70 "=&r" (cpuid) :
71 "0" (cpuid));
72 return cpuid;
73 }
74
75
76
77
78
79
80
81 #define MBOX_STOPCPU 0xFB
82 #define MBOX_IDLECPU 0xFC
83 #define MBOX_IDLECPU2 0xFD
84 #define MBOX_STOPCPU2 0xFE
85
86
87 #define NO_PROC_ID 0xFF
88
89 #define PROC_CHANGE_PENALTY 0x23
90
91 #endif