ivintr.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"
/*
* Interrupt Vector Table Configuration
*/
#include <sys/privregs.h>
/*
* fill in an interrupt vector entry
*/
#define fill_intr(a, b, c, d, e) \
a->iv_pil = b; a->iv_pending = 0; \
/*
* create a null interrupt handler entry used for returned values
* only - never on intr_vector[]
*/
/*
* replace an intr_vector[] entry with a default set of values
* this is done instead of nulling the entry, so the handler and
* pil are always valid for the assembler code
*/
(void *)(v), NULL)
/*
* test whether an intr_vector[] entry points to our default handler
*/
extern uint_t swinum_base;
extern kmutex_t soft_iv_lock;
int ignore_invalid_vecintr = 0;
/*
* default (non-)handler for otherwise unhandled interrupts
*/
{
if (!ignore_invalid_vecintr) {
return (DDI_INTR_UNCLAIMED);
} else {
return (DDI_INTR_CLAIMED);
}
}
/*
* initialization - fill the entire table with default values
*/
void
init_ivintr(void)
{
struct intr_vector *inump;
int i;
}
}
/*
* add_ivintr() - add an interrupt handler to the system
* This routine is not protected by the lock; it's the caller's
* responsibility to make sure <source>_INR.INT_EN = 0
* and <source>_ISM != PENDING before the routine is called.
*/
int
{
struct intr_vector *inump;
return (EINVAL);
/* Make sure the payload buffer address is 64 bit aligned */
return (EINVAL);
return (0);
}
/*
* rem_ivintr() - remove an interrupt handler from intr_vector[]
* This routine is not protected by the lock; it's the caller's
* responsibility to make sure <source>_INR.INT_EN = 0
* and <source>_ISM != PENDING before the routine is called.
*/
void
{
struct intr_vector *inump;
if (iv_return) {
if (intr_is_empty(inump)) {
} else {
/*
* the caller requires the current entry to be
* returned
*/
}
}
/*
* empty the current entry
*/
}
/*
* add_softintr() - add a software interrupt handler to the system
*/
{
struct intr_vector *inump;
register uint_t i;
for (i = swinum_base; i < maxswinum; i++) {
inump = &intr_vector[i];
if (intr_is_empty(inump))
break;
}
if (!intr_is_empty(inump)) {
maxswinum - swinum_base);
}
return (i);
}
/*
* rem_softintr() - remove a software interrupt handler from the system
*/
void
{
}
int
{
if (inump->iv_pending)
return (DDI_EPENDING);
return (DDI_SUCCESS);
}
int
{
return (DDI_SUCCESS);
}