/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Interrupt Vector Table Configuration
*/
#include <sys/privregs.h>
/*
* Allocate an Interrupt Vector Table and some interrupt vector data structures
* for the reserved pool as part of the startup code. First try to allocate an
* interrupt vector data structure from the reserved pool, otherwise allocate it
* using kmem cache method.
*/
/*
* Global softint linked list - used by softint mdb dcmd.
*/
/* Reserved pool for interrupt allocation */
/* Kmem cache handle for interrupt allocation */
/*
* init_ivintr() - Initialize an Interrupt Vector Table.
*/
void
{
/*
* Initialize the reserved interrupt vector data structure pools
* used for hardware and software interrupts.
*/
(MAXIVNUM * sizeof (intr_vec_t *)));
(MAX_RSVD_IV * sizeof (intr_vec_t)));
}
/*
* fini_ivintr() - Uninitialize an Interrupt Vector Table.
*/
void
{
if (intr_vec_cache) {
}
}
/*
* iv_alloc() - Allocate an interrupt vector data structure.
*
* This function allocates an interrupt vector data structure for hardware
* and single or multi target software interrupts either from the reserved
* pool or using kmem cache method.
*/
static intr_vec_t *
{
int i, count;
/*
* First try to allocate an interrupt vector data structure from the
* reserved pool, otherwise allocate it using kmem_cache_alloc().
*/
for (i = 0; i < count; i++) {
break;
}
}
if (i < count)
return (iv_p);
if (type == SOFTINT_MT)
"target software interrupts, %d", MAX_RSVD_IVX);
/*
* If the interrupt vector data structure reserved pool is already
* exhausted, then allocate an interrupt vector data structure using
* kmem_cache_alloc(), but only for the hardware and single software
* interrupts. Create a kmem cache for the interrupt allocation,
* if it is not already available.
*/
if (intr_vec_cache == NULL)
return (iv_p);
}
/*
* iv_free() - Free an interrupt vector data structure.
*/
static void
{
} else {
sizeof (intr_vecx_t) : sizeof (intr_vec_t));
}
}
/*
* add_ivintr() - Add an interrupt handler to the system
*/
int
{
return (EINVAL);
/* Make sure the payload buffer address is 64 bit aligned */
return (EINVAL);
}
}
return (0);
}
/*
* rem_ivintr() - Remove an interrupt handler from the system
*/
int
{
return (EINVAL);
break;
return (EIO);
}
else
return (0);
}
/*
* add_softintr() - add a software interrupt handler to the system
*/
{
return (NULL);
if (type == SOFTINT_MT)
if (softint_list)
softint_list = iv_p;
}
/*
* rem_softintr() - remove a software interrupt handler from the system
*/
int
{
return (EIO);
if (softint_list == iv_p) {
} else {
}
return (0);
}
/*
* update_softint_arg2() - Update softint arg2.
*
* NOTE: Do not grab any mutex in this function since it may get called
* from the high-level interrupt context.
*/
int
{
return (EIO);
return (0);
}
/*
* update_softint_pri() - Update softint priority.
*/
int
{
return (EINVAL);
return (0);
}