dr_io.c revision 07d06da50d310a325b457d6330165aebab1e0064
/*
* 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.
*/
/*
* I/O support routines for DR
*/
#include <sys/dditypes.h>
#include <sys/ndi_impldefs.h>
#include <sys/processor.h>
#include <sys/mem_config.h>
#include <sys/cpu_sgnblk_defs.h>
#include <sys/sysmacros.h>
#include <sys/machsystm.h>
#include <sys/spitregs.h>
#include <sys/archsystm.h>
#include <vm/hat_sfmmu.h>
#include <sys/cpu_module.h>
void
{
} else {
}
}
/*ARGSUSED*/
void
{
if (!err)
if (err)
}
/*
* remove device nodes for the branch indicated by cp
*/
/*ARGSUSED*/
void
{
if (!err)
if (!err)
if (err) {
}
}
/*ARGSUSED*/
int
{
return (0);
}
/*ARGSUSED*/
int
{
int d;
for (d = 0; d < devnum; d++) {
}
return (0);
}
/*ARGSUSED*/
int
{
return (0);
}
static int
{
register int i, reftotal = 0;
static fn_t f = "dr_check_io_refs";
for (i = 0; i < devnum; i++) {
int ref;
if (err)
ref = 0;
if (ref) {
}
PR_IO("%s: dip(%s) ref = %d\n",
} else {
PR_IO("%s: NO dip for id (0x%x)\n",
}
}
return (reftotal);
}
int
{
static fn_t f = "dr_pre_release_io";
int d;
/* fail if any I/O device pre-release fails */
for (d = 0; d < devnum; d++) {
return (-1);
}
}
for (d = 0; d < devnum; d++) {
if (err) {
&err);
return (-1);
}
}
/* fail if any I/O devices are still referenced */
PR_IO("%s: failed - I/O devices ref'd\n", f);
/* recover before return error */
for (d = 0; d < devnum; d++) {
if (err) {
return (-1);
}
}
return (-1);
}
return (0);
}
/*ARGSUSED*/
int
{
int d;
for (d = 0; d < devnum; d++) {
}
return (0);
}
/*ARGSUSED*/
int
{
register int i;
int rv = 0;
static fn_t f = "dr_post_detach_io";
for (i = 0; i < devnum; i++) {
PR_IO("%s: Failed\n", f);
rv = -1;
break;
}
}
return (rv);
}
static void
{
return;
}
return;
}
}
}
int
{
int i, ix;
dr_board_t *bp;
/*
* Only look for requested devices that are actually present.
*/
for (i = ix = 0; i < MAX_IO_UNITS_PER_BOARD; i++) {
continue;
/* present, but not fully initialized */
continue;
}
if (id == (drmachid_t)0)
continue;
if (err) {
return (-1);
}
if (err) {
/* catch this in debug kernels */
ASSERT(0);
sbd_err_clear(&err);
continue;
}
isp->is_referenced = 0;
isp->is_unsafe_count = 0;
} else {
/* check reference and unsafe counts on devices */
isp->is_unsafe_count = 0;
&idx, SBD_MAX_UNSAFE);
while (idx > 0) {
--idx;
}
}
ix++;
dsp++;
}
return (ix);
}