10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 53446Smrj * Common Development and Distribution License (the "License"). 63446Smrj * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 213446Smrj 220Sstevel@tonic-gate /* 23*9489SJoe.Bonasera@sun.com * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 243446Smrj * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate #include <sys/types.h> 280Sstevel@tonic-gate #include <sys/param.h> 290Sstevel@tonic-gate #include <sys/thread.h> 300Sstevel@tonic-gate #include <sys/cpuvar.h> 310Sstevel@tonic-gate #include <sys/machsystm.h> 320Sstevel@tonic-gate #include <sys/systm.h> 333446Smrj #include <sys/promif.h> 34*9489SJoe.Bonasera@sun.com #include <sys/xc_levels.h> 350Sstevel@tonic-gate 360Sstevel@tonic-gate /* 370Sstevel@tonic-gate * Interrupt another CPU. 380Sstevel@tonic-gate * This is useful to make the other CPU go through a trap so that 390Sstevel@tonic-gate * it recognizes an address space trap (AST) for preempting a thread. 400Sstevel@tonic-gate * 410Sstevel@tonic-gate * It is possible to be preempted here and be resumed on the CPU 420Sstevel@tonic-gate * being poked, so it isn't an error to poke the current CPU. 430Sstevel@tonic-gate * We could check this and still get preempted after the check, so 440Sstevel@tonic-gate * we don't bother. 450Sstevel@tonic-gate */ 460Sstevel@tonic-gate void 470Sstevel@tonic-gate poke_cpu(int cpun) 480Sstevel@tonic-gate { 493446Smrj if (panicstr) 503446Smrj return; 510Sstevel@tonic-gate /* 520Sstevel@tonic-gate * We don't need to receive an ACK from the CPU being poked, 530Sstevel@tonic-gate * so just send out a directed interrupt. 540Sstevel@tonic-gate */ 553446Smrj send_dirint(cpun, XC_CPUPOKE_PIL); 560Sstevel@tonic-gate } 57