cpu_intr.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/processor.h>
#include <sys/pool_pset.h>
/*
* cpu_intr_on - determine whether the CPU is participating
* in I/O interrupts.
*/
int
{
}
/*
* Return the next on-line CPU handling interrupts.
*/
cpu_t *
{
cpu_t *c;
c = cp->cpu_next_onln;
while (c != cp) {
if (cpu_intr_on(c)) {
return (c);
}
c = c->cpu_next_onln;
}
return (NULL);
}
/*
* cpu_intr_count - count how many CPUs are handling I/O interrupts.
*/
int
{
cpu_t *c;
int count = 0;
c = cp;
do {
if (cpu_intr_on(c)) {
++count;
}
return (count);
}
/*
* Enable I/O interrupts on this CPU, if they are disabled.
*/
void
{
if (!cpu_intr_on(cp)) {
}
}
/*
* cpu_intr_disable - redirect I/O interrupts targetted at this CPU.
*
* semantics: We check the count of CPUs that are accepting
* interrupts, because it's stupid to take the last CPU out
* of I/O interrupt participation. This also permits the
* p_online syscall to fail gracefully in uniprocessor configurations
* without having to perform any special platform-specific operations.
*/
int
{
int e = EBUSY;
if (cpu_intr_on(cp)) {
/*
* Juggle away cyclics, but don't fail if we don't
* manage to juggle all of them away; we want to allow
* CPU-bound cyclics to continue to fire on the
* sheltered CPU.
*/
(void) cyclic_juggle(cp);
e = cpu_disable_intr(cp);
}
}
if (e == 0)
return (e);
}