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. 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 434a28eaadSJustin Hibbits #include <machine/pcb.h> 44c47dd3dbSAttilio Rao #include <sys/_cpuset.h> 45c47dd3dbSAttilio Rao 469d5a22b9SMarcel Moolenaar void ipi_all_but_self(int ipi); 47d9d8d144SJohn Baldwin void ipi_cpu(int cpu, u_int ipi); 48c47dd3dbSAttilio Rao void ipi_selected(cpuset_t cpus, int ipi); 499d5a22b9SMarcel Moolenaar 509d5a22b9SMarcel Moolenaar struct cpuref { 519d5a22b9SMarcel Moolenaar uintptr_t cr_hwref; 529d5a22b9SMarcel Moolenaar u_int cr_cpuid; 5349d9a597SJustin Hibbits u_int cr_domain; 549d5a22b9SMarcel Moolenaar }; 559d5a22b9SMarcel Moolenaar 56c139f23dSMarcel Moolenaar void pmap_cpu_bootstrap(int); 57c3e289e1SNathan Whitehorn void cpudep_ap_early_bootstrap(void); 58999987e5SNathan Whitehorn uintptr_t cpudep_ap_bootstrap(void); 59999987e5SNathan Whitehorn void cpudep_ap_setup(void); 60c139f23dSMarcel Moolenaar void machdep_ap_bootstrap(void); 619d5a22b9SMarcel Moolenaar 629d5a22b9SMarcel Moolenaar #endif /* !LOCORE */ 639d5a22b9SMarcel Moolenaar #endif /* _KERNEL */ 649d5a22b9SMarcel Moolenaar #endif /* !_MACHINE_SMP_H */ 65