Deleted Added
sdiff udiff text old ( 91617 ) new ( 91783 )
full compact
1/*-
2 * Copyright (c) 2001 Jake Burkholder.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/sparc64/include/smp.h 91617 2002-03-04 07:12:36Z jake $
27 */
28
29#ifndef _MACHINE_SMP_H_
30#define _MACHINE_SMP_H_
31
32#define CPU_CLKSYNC 1
33#define CPU_INIT 2
34#define CPU_BOOTSTRAP 3

--- 8 unchanged lines hidden (view full) ---

43
44#define IPI_AST PIL_AST
45#define IPI_RENDEZVOUS PIL_RENDEZVOUS
46#define IPI_STOP PIL_STOP
47
48#define IPI_RETRIES 100
49
50struct cpu_start_args {
51 u_int csa_mid;
52 u_int csa_state;
53 u_long csa_tick;
54 u_long csa_ver;
55 struct tte csa_ttes[PCPU_PAGES];
56};
57
58struct ipi_level_args {
59 u_int ila_count;
60 u_int ila_level;
61};
62
63struct ipi_tlb_args {
64 u_int ita_count;
65 u_long ita_tlb;
66 u_long ita_ctx;
67 u_long ita_start;
68 u_long ita_end;
69};
70#define ita_va ita_start
71
72struct pcpu;
73
74void cpu_mp_bootstrap(struct pcpu *pc);

--- 5 unchanged lines hidden (view full) ---

80void ipi_all(u_int ipi);
81void ipi_all_but_self(u_int ipi);
82
83vm_offset_t mp_tramp_alloc(void);
84
85extern struct ipi_level_args ipi_level_args;
86extern struct ipi_tlb_args ipi_tlb_args;
87
88extern int mp_ncpus;
89
90extern vm_offset_t mp_tramp;
91extern char *mp_tramp_code;
92extern u_long mp_tramp_code_len;
93extern u_long mp_tramp_tlb_slots;
94extern u_long mp_tramp_func;
95
96extern void mp_startup(void);
97
98extern char tl_ipi_level[];
99extern char tl_ipi_test[];
100extern char tl_ipi_tlb_context_demap[];
101extern char tl_ipi_tlb_page_demap[];
102extern char tl_ipi_tlb_range_demap[];
103
104#ifdef SMP
105
106static __inline void *
107ipi_tlb_context_demap(u_int ctx)
108{
109 struct ipi_tlb_args *ita;
110
111 if (mp_ncpus == 1)
112 return (NULL);
113 ita = &ipi_tlb_args;
114 ita->ita_count = mp_ncpus;
115 ita->ita_ctx = ctx;
116 cpu_ipi_selected(PCPU_GET(other_cpus), 0,
117 (u_long)tl_ipi_tlb_context_demap, (u_long)ita);
118 return (&ita->ita_count);
119}
120
121static __inline void *
122ipi_tlb_page_demap(u_int tlb, u_int ctx, vm_offset_t va)
123{
124 struct ipi_tlb_args *ita;
125
126 if (mp_ncpus == 1)
127 return (NULL);
128 ita = &ipi_tlb_args;
129 ita->ita_count = mp_ncpus;
130 ita->ita_tlb = tlb;
131 ita->ita_ctx = ctx;
132 ita->ita_va = va;
133 cpu_ipi_selected(PCPU_GET(other_cpus), 0,
134 (u_long)tl_ipi_tlb_page_demap, (u_long)ita);
135 return (&ita->ita_count);
136}
137
138static __inline void *
139ipi_tlb_range_demap(u_int ctx, vm_offset_t start, vm_offset_t end)
140{
141 struct ipi_tlb_args *ita;
142
143 if (mp_ncpus == 1)
144 return (NULL);
145 ita = &ipi_tlb_args;
146 ita->ita_count = mp_ncpus;
147 ita->ita_ctx = ctx;
148 ita->ita_start = start;
149 ita->ita_end = end;
150 cpu_ipi_selected(PCPU_GET(other_cpus), 0,
151 (u_long)tl_ipi_tlb_range_demap, (u_long)ita);
152 return (&ita->ita_count);
153}
154
155static __inline void
156ipi_wait(void *cookie)
157{
158 u_int *count;
159
160 if ((count = cookie) != NULL) {
161 atomic_subtract_int(count, 1);
162 while (*count != 0)
163 ;
164 }
165}
166
167#else
168
169static __inline void *
170ipi_tlb_context_demap(u_int ctx)
171{
172 return (NULL);
173}
174
175static __inline void *
176ipi_tlb_page_demap(u_int tlb, u_int ctx, vm_offset_t va)
177{
178 return (NULL);
179}
180
181static __inline void *
182ipi_tlb_range_demap(u_int ctx, vm_offset_t start, vm_offset_t end)
183{
184 return (NULL);
185}
186
187static __inline void
188ipi_wait(void *cookie)
189{
190}
191
192#endif /* SMP */
193
194#endif /* !LOCORE */
195
196#endif /* !_MACHINE_SMP_H_ */