/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* PCI PBM implementation:
* initialization
* Bus error interrupt handler
*/
#include <sys/sysmacros.h>
#include <sys/ddi_impldefs.h>
/*LINTLIBRARY*/
/* The nexus interrupt priority values */
void
{
int i, len;
#ifdef lint
#endif
/*
* Allocate a state structure for the PBM and cross-link it
* to its per pci node state structure.
*/
sizeof (pbm_p->pbm_nameinst_str),
/*
* Get this pbm's mem32 and mem64 segments to determine whether
* a dma object originates from ths pbm. i.e. dev to dev dma
*/
/* Init all of our boundaries */
base_addr = -1ull;
}
}
"pbm_create: ctrl=%x, afsr=%x, afar=%x, diag=%x\n",
/*
* Register a function to disable pbm error interrupts during a panic.
*/
/*
* create the interrupt-priorities property if it doesn't
* already exist to provide a hint as to the PIL level for
* our interrupt.
*/
DDI_PROP_DONTPASS, "interrupt-priorities",
&len) != DDI_PROP_SUCCESS) {
/* Create the interrupt-priorities property. */
DDI_PROP_CANSLEEP, "interrupt-priorities",
}
/*
* workaround.
*/
}
int
{
int r = DDI_SUCCESS;
/*
* Install the PCI error interrupt handler.
*/
/*
* Create the pokefault mutex at the PIL below the error interrupt.
*/
if (!r)
r = pci_pbm_add_intr(pci_p);
}
void
{
/*
* Free the pokefault mutex.
*/
/*
* Remove the error interrupt and consistent dma sync handler.
*/
/*
* Remove the error disable function.
*/
/*
* Free the pbm state structure.
*/
}
static uint_t
{
/*
* cautious write protection, protected from all errors.
*/
/*
* ddi_poke protection, check nexus and children for
* expected errors.
*/
membar_sync();
} else if (pci_check_error(pci_p) != 0) {
/*
* unprotected error, check for all errors.
*/
if (pci_errtrig_pa)
(void) ldphysio(pci_errtrig_pa);
}
if (err == DDI_FM_FATAL) {
if (pci_panic_on_fatal_errors) {
fm_panic("%s-%d: Fatal PCI bus error(s)\n",
}
}
return (DDI_INTR_CLAIMED);
}
void
{
}
void
{
}
void
{
}
/*
* Function used to log PBM AFSR register bits and to lookup and fault
* handle associated with PBM AFAR register. Called by pci_pbm_err_handler with
* pci_fm_mutex held.
*/
int
{
int fatal = 0;
int ret = 0;
(void) pci_pbm_classify(pbm_err_p);
/*
* Lookup and fault errant handle
*/
(ret == DDI_FM_UNKNOWN))
fatal++;
/*
* queue target ereport if appropriate
*/
if (pbm_err_p->pbm_terr_class)
/*
* We are currently not dealing with the multiple error
* case, for any secondary errors we will panic.
*/
if (pci_pbm_classify(pbm_err_p)) {
fatal++;
}
if (fatal)
return (DDI_FM_FATAL);
return (DDI_FM_NONFATAL);
}