xref: /freebsd/sys/powerpc/include/smp.h (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
19d5a22b9SMarcel Moolenaar /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
371e3c308SPedro F. Giffuni  *
49d5a22b9SMarcel Moolenaar  * Copyright (c) 2008 Marcel Moolenaar
59d5a22b9SMarcel Moolenaar  * All rights reserved.
69d5a22b9SMarcel Moolenaar  *
79d5a22b9SMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
89d5a22b9SMarcel Moolenaar  * modification, are permitted provided that the following conditions
99d5a22b9SMarcel Moolenaar  * are met:
109d5a22b9SMarcel Moolenaar  *
119d5a22b9SMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
129d5a22b9SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer.
139d5a22b9SMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
149d5a22b9SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
159d5a22b9SMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
169d5a22b9SMarcel Moolenaar  *
179d5a22b9SMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
189d5a22b9SMarcel Moolenaar  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
199d5a22b9SMarcel Moolenaar  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
209d5a22b9SMarcel Moolenaar  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
219d5a22b9SMarcel Moolenaar  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
229d5a22b9SMarcel Moolenaar  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
239d5a22b9SMarcel Moolenaar  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
249d5a22b9SMarcel Moolenaar  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
259d5a22b9SMarcel Moolenaar  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
269d5a22b9SMarcel Moolenaar  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
279d5a22b9SMarcel Moolenaar  *
289d5a22b9SMarcel Moolenaar  * $FreeBSD$
29d27f1d4cSBenno Rice  */
309d5a22b9SMarcel Moolenaar 
319d5a22b9SMarcel Moolenaar #ifndef _MACHINE_SMP_H_
329d5a22b9SMarcel Moolenaar #define _MACHINE_SMP_H_
339d5a22b9SMarcel Moolenaar 
349d5a22b9SMarcel Moolenaar #ifdef _KERNEL
359d5a22b9SMarcel Moolenaar 
369d5a22b9SMarcel Moolenaar #define	IPI_AST			0
379d5a22b9SMarcel Moolenaar #define	IPI_PREEMPT		1
389d5a22b9SMarcel Moolenaar #define	IPI_RENDEZVOUS		2
399d5a22b9SMarcel Moolenaar #define	IPI_STOP		3
40dc6fbf65SAttilio Rao #define	IPI_STOP_HARD		3
41707c2fb9SAlexander Motin #define	IPI_HARDCLOCK		4
429d5a22b9SMarcel Moolenaar 
439d5a22b9SMarcel Moolenaar #ifndef LOCORE
449d5a22b9SMarcel Moolenaar 
454a28eaadSJustin Hibbits #include <machine/pcb.h>
46c47dd3dbSAttilio Rao #include <sys/_cpuset.h>
47c47dd3dbSAttilio Rao 
489d5a22b9SMarcel Moolenaar void	ipi_all_but_self(int ipi);
49d9d8d144SJohn Baldwin void	ipi_cpu(int cpu, u_int ipi);
50c47dd3dbSAttilio Rao void	ipi_selected(cpuset_t cpus, int ipi);
519d5a22b9SMarcel Moolenaar 
529d5a22b9SMarcel Moolenaar struct cpuref {
539d5a22b9SMarcel Moolenaar 	uintptr_t	cr_hwref;
549d5a22b9SMarcel Moolenaar 	u_int		cr_cpuid;
5549d9a597SJustin Hibbits 	u_int		cr_domain;
569d5a22b9SMarcel Moolenaar };
579d5a22b9SMarcel Moolenaar 
58c139f23dSMarcel Moolenaar void	pmap_cpu_bootstrap(int);
59c3e289e1SNathan Whitehorn void	cpudep_ap_early_bootstrap(void);
60999987e5SNathan Whitehorn uintptr_t cpudep_ap_bootstrap(void);
61999987e5SNathan Whitehorn void	cpudep_ap_setup(void);
62c139f23dSMarcel Moolenaar void	machdep_ap_bootstrap(void);
639d5a22b9SMarcel Moolenaar 
644a28eaadSJustin Hibbits extern struct pcb stoppcbs[];
654a28eaadSJustin Hibbits 
669d5a22b9SMarcel Moolenaar #endif /* !LOCORE */
679d5a22b9SMarcel Moolenaar #endif /* _KERNEL */
689d5a22b9SMarcel Moolenaar #endif /* !_MACHINE_SMP_H */
69