smp.h revision 178622
1178622Smarcel/*- 2178622Smarcel * Copyright (c) 2008 Marcel Moolenaar 3178622Smarcel * All rights reserved. 4178622Smarcel * 5178622Smarcel * Redistribution and use in source and binary forms, with or without 6178622Smarcel * modification, are permitted provided that the following conditions 7178622Smarcel * are met: 8178622Smarcel * 9178622Smarcel * 1. Redistributions of source code must retain the above copyright 10178622Smarcel * notice, this list of conditions and the following disclaimer. 11178622Smarcel * 2. Redistributions in binary form must reproduce the above copyright 12178622Smarcel * notice, this list of conditions and the following disclaimer in the 13178622Smarcel * documentation and/or other materials provided with the distribution. 14178622Smarcel * 15178622Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16178622Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17178622Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18178622Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19178622Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20178622Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21178622Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22178622Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23178622Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24178622Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25178622Smarcel * 26178622Smarcel * $FreeBSD: head/sys/powerpc/include/smp.h 178622 2008-04-27 19:51:34Z marcel $ 27178622Smarcel */ 2878342Sbenno 29178622Smarcel#ifndef _MACHINE_SMP_H_ 30178622Smarcel#define _MACHINE_SMP_H_ 31178622Smarcel 32178622Smarcel#ifdef _KERNEL 33178622Smarcel 34178622Smarcel#define IPI_AST 0 35178622Smarcel#define IPI_PREEMPT 1 36178622Smarcel#define IPI_RENDEZVOUS 2 37178622Smarcel#define IPI_STOP 3 38178622Smarcel 39178622Smarcel#define IPI_PPC_TEST 4 40178622Smarcel 41178622Smarcel#ifndef LOCORE 42178622Smarcel 43178622Smarcelvoid ipi_all(int ipi); 44178622Smarcelvoid ipi_all_but_self(int ipi); 45178622Smarcelvoid ipi_selected(cpumask_t cpus, int ipi); 46178622Smarcelvoid ipi_self(int ipi); 47178622Smarcel 48178622Smarcelstruct cpuref { 49178622Smarcel uintptr_t cr_hwref; 50178622Smarcel u_int cr_cpuid; 51178622Smarcel}; 52178622Smarcel 53178622Smarcelint powerpc_smp_first_cpu(struct cpuref *); 54178622Smarcelint powerpc_smp_get_bsp(struct cpuref *); 55178622Smarcelint powerpc_smp_next_cpu(struct cpuref *); 56178622Smarcelint powerpc_smp_start_cpu(struct pcpu *); 57178622Smarcel 58178622Smarcelvoid pmap_cpu_bootstrap(volatile uint32_t *, int); 59178622Smarceluint32_t cpudep_ap_bootstrap(volatile uint32_t *); 60178622Smarcelvoid machdep_ap_bootstrap(volatile uint32_t *); 61178622Smarcel 62178622Smarcel#endif /* !LOCORE */ 63178622Smarcel#endif /* _KERNEL */ 64178622Smarcel#endif /* !_MACHINE_SMP_H */ 65