b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * CDDL HEADER START
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * The contents of this file are subject to the terms of the
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * Common Development and Distribution License, Version 1.0 only
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * (the "License"). You may not use this file except in compliance
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * with the License.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * or http://www.opensolaris.org/os/licensing.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * See the License for the specific language governing permissions
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * and limitations under the License.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * When distributing Covered Code, include this CDDL HEADER in each
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * If applicable, add the following below this CDDL HEADER, with the
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * fields enclosed by brackets "[]" replaced with your own identifying
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * information: Portions Copyright [yyyy] [name of copyright owner]
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * CDDL HEADER END
11c3a36649e5e5e77db499c92f3cdcbd619efd3aThomas Hindoe Paaboel Andersen * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * Use is subject to license terms.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering#pragma ident "%Z%%M% %I% %E% SMI"
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * PCI Control Block object
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering#endif /* _STARFIRE */
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering/*LINTLIBRARY*/
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering cb_t *cb_p = (cb_t *)kmem_zalloc(sizeof (cb_t), KM_SLEEP);
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering mutex_init(&cb_p->cb_intr_lock, NULL, MUTEX_DRIVER, NULL);
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering cb_p->cb_pci_cmn_p = pci_p->pci_common_p;
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poetteringcb_set_nintr_reg(cb_t *cb_p, ib_ino_t ino, uint64_t value)
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering uint64_t pa = cb_ino_to_clr_pa(cb_p, ino);
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering "pci-%x cb_set_nintr_reg: ino=%x PA=%016llx\n",
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering cb_p->cb_pci_cmn_p->pci_common_id, ino, pa);
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering (void) lddphysio(pa); /* flush the previous write */
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * enable an internal interrupt source:
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * if an interrupt is shared by both sides, record it in cb_inos[] and
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering * cb will own its distribution.
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poetteringcb_enable_nintr(pci_t *pci_p, enum cb_nintr_index idx)
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering ib_ino_t ino = IB_MONDO_TO_INO(pci_p->pci_inos[idx]);
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering ib_mondo_t mondo = CB_INO_TO_MONDO(cb_p, ino);
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering cpu_id = pc_translate_tgtid(cb_p->cb_ittrans_cookie, cpu_id,
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ceLennart Poettering#endif /* _STARFIRE */
if (wait) {
#ifdef _STARFIRE
#ifdef _STARFIRE
* different per side and is handled by pbm_suspend/resume.
for (i = 0; i < inos; i++) {
if (!ino)
if (!ino)