xref: /freebsd/sys/powerpc/include/smp.h (revision 707c2fb9)
19d5a22b9SMarcel Moolenaar /*-
29d5a22b9SMarcel Moolenaar  * Copyright (c) 2008 Marcel Moolenaar
39d5a22b9SMarcel Moolenaar  * All rights reserved.
49d5a22b9SMarcel Moolenaar  *
59d5a22b9SMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
69d5a22b9SMarcel Moolenaar  * modification, are permitted provided that the following conditions
79d5a22b9SMarcel Moolenaar  * are met:
89d5a22b9SMarcel Moolenaar  *
99d5a22b9SMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
109d5a22b9SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer.
119d5a22b9SMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
129d5a22b9SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
139d5a22b9SMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
149d5a22b9SMarcel Moolenaar  *
159d5a22b9SMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
169d5a22b9SMarcel Moolenaar  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
179d5a22b9SMarcel Moolenaar  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
189d5a22b9SMarcel Moolenaar  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
199d5a22b9SMarcel Moolenaar  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
209d5a22b9SMarcel Moolenaar  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
219d5a22b9SMarcel Moolenaar  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
229d5a22b9SMarcel Moolenaar  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
239d5a22b9SMarcel Moolenaar  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
249d5a22b9SMarcel Moolenaar  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
259d5a22b9SMarcel Moolenaar  *
269d5a22b9SMarcel Moolenaar  * $FreeBSD$
27d27f1d4cSBenno Rice  */
289d5a22b9SMarcel Moolenaar 
299d5a22b9SMarcel Moolenaar #ifndef _MACHINE_SMP_H_
309d5a22b9SMarcel Moolenaar #define _MACHINE_SMP_H_
319d5a22b9SMarcel Moolenaar 
329d5a22b9SMarcel Moolenaar #ifdef _KERNEL
339d5a22b9SMarcel Moolenaar 
349d5a22b9SMarcel Moolenaar #define	IPI_AST			0
359d5a22b9SMarcel Moolenaar #define	IPI_PREEMPT		1
369d5a22b9SMarcel Moolenaar #define	IPI_RENDEZVOUS		2
379d5a22b9SMarcel Moolenaar #define	IPI_STOP		3
38dc6fbf65SAttilio Rao #define	IPI_STOP_HARD		3
39707c2fb9SAlexander Motin #define	IPI_HARDCLOCK		4
409d5a22b9SMarcel Moolenaar 
419d5a22b9SMarcel Moolenaar #ifndef LOCORE
429d5a22b9SMarcel Moolenaar 
439d5a22b9SMarcel Moolenaar void	ipi_all_but_self(int ipi);
44d9d8d144SJohn Baldwin void	ipi_cpu(int cpu, u_int ipi);
459d5a22b9SMarcel Moolenaar void	ipi_selected(cpumask_t cpus, int ipi);
469d5a22b9SMarcel Moolenaar 
479d5a22b9SMarcel Moolenaar struct cpuref {
489d5a22b9SMarcel Moolenaar 	uintptr_t	cr_hwref;
499d5a22b9SMarcel Moolenaar 	u_int		cr_cpuid;
509d5a22b9SMarcel Moolenaar };
519d5a22b9SMarcel Moolenaar 
52c139f23dSMarcel Moolenaar void	pmap_cpu_bootstrap(int);
53c3e289e1SNathan Whitehorn void	cpudep_ap_early_bootstrap(void);
54999987e5SNathan Whitehorn uintptr_t cpudep_ap_bootstrap(void);
55999987e5SNathan Whitehorn void	cpudep_ap_setup(void);
56c139f23dSMarcel Moolenaar void	machdep_ap_bootstrap(void);
579d5a22b9SMarcel Moolenaar 
589d5a22b9SMarcel Moolenaar #endif /* !LOCORE */
599d5a22b9SMarcel Moolenaar #endif /* _KERNEL */
609d5a22b9SMarcel Moolenaar #endif /* !_MACHINE_SMP_H */
61