cmd_hc_sun4v.c revision e97130129ddee9f8432c6fff2dac3c6765280066
e97130129ddee9f8432c6fff2dac3c6765280066tsien/*
e97130129ddee9f8432c6fff2dac3c6765280066tsien * CDDL HEADER START
e97130129ddee9f8432c6fff2dac3c6765280066tsien *
e97130129ddee9f8432c6fff2dac3c6765280066tsien * The contents of this file are subject to the terms of the
e97130129ddee9f8432c6fff2dac3c6765280066tsien * Common Development and Distribution License (the "License").
e97130129ddee9f8432c6fff2dac3c6765280066tsien * You may not use this file except in compliance with the License.
e97130129ddee9f8432c6fff2dac3c6765280066tsien *
e97130129ddee9f8432c6fff2dac3c6765280066tsien * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
e97130129ddee9f8432c6fff2dac3c6765280066tsien * or http://www.opensolaris.org/os/licensing.
e97130129ddee9f8432c6fff2dac3c6765280066tsien * See the License for the specific language governing permissions
e97130129ddee9f8432c6fff2dac3c6765280066tsien * and limitations under the License.
e97130129ddee9f8432c6fff2dac3c6765280066tsien *
e97130129ddee9f8432c6fff2dac3c6765280066tsien * When distributing Covered Code, include this CDDL HEADER in each
e97130129ddee9f8432c6fff2dac3c6765280066tsien * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
e97130129ddee9f8432c6fff2dac3c6765280066tsien * If applicable, add the following below this CDDL HEADER, with the
e97130129ddee9f8432c6fff2dac3c6765280066tsien * fields enclosed by brackets "[]" replaced with your own identifying
e97130129ddee9f8432c6fff2dac3c6765280066tsien * information: Portions Copyright [yyyy] [name of copyright owner]
e97130129ddee9f8432c6fff2dac3c6765280066tsien *
e97130129ddee9f8432c6fff2dac3c6765280066tsien * CDDL HEADER END
e97130129ddee9f8432c6fff2dac3c6765280066tsien */
e97130129ddee9f8432c6fff2dac3c6765280066tsien/*
e97130129ddee9f8432c6fff2dac3c6765280066tsien * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
e97130129ddee9f8432c6fff2dac3c6765280066tsien * Use is subject to license terms.
e97130129ddee9f8432c6fff2dac3c6765280066tsien */
e97130129ddee9f8432c6fff2dac3c6765280066tsien
e97130129ddee9f8432c6fff2dac3c6765280066tsien#pragma ident "%Z%%M% %I% %E% SMI"
e97130129ddee9f8432c6fff2dac3c6765280066tsien
e97130129ddee9f8432c6fff2dac3c6765280066tsien#include <fm/fmd_api.h>
e97130129ddee9f8432c6fff2dac3c6765280066tsien#include <sys/fm/protocol.h>
e97130129ddee9f8432c6fff2dac3c6765280066tsien
e97130129ddee9f8432c6fff2dac3c6765280066tsiennvlist_t *
e97130129ddee9f8432c6fff2dac3c6765280066tsiencmd_fault_add_location(fmd_hdl_t *hdl, nvlist_t *flt, const char *locstr) {
e97130129ddee9f8432c6fff2dac3c6765280066tsien
e97130129ddee9f8432c6fff2dac3c6765280066tsien char *t;
e97130129ddee9f8432c6fff2dac3c6765280066tsien
e97130129ddee9f8432c6fff2dac3c6765280066tsien if (nvlist_lookup_string(flt, FM_FAULT_LOCATION, &t) == 0)
e97130129ddee9f8432c6fff2dac3c6765280066tsien return (flt); /* already has location value */
e97130129ddee9f8432c6fff2dac3c6765280066tsien if (nvlist_add_string(flt, FM_FAULT_LOCATION, locstr) != 0)
e97130129ddee9f8432c6fff2dac3c6765280066tsien fmd_hdl_error(hdl, "unable to alloc location for fault\n");
e97130129ddee9f8432c6fff2dac3c6765280066tsien return (flt);
e97130129ddee9f8432c6fff2dac3c6765280066tsien}