8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / fm / modules / sun4v / cpumem-retire / cma_page_sun4v.c
blob867f528119111e18de3e02970215b351288c60d7
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #include <sys/fm/ldom.h>
27 #include <errno.h>
28 #include <fm/fmd_api.h>
29 #include <fm/fmd_agent.h>
30 #include <fm/fmd_fmri.h>
32 extern ldom_hdl_t *cma_lhp;
34 /* ARGSUSED */
35 int
36 cma_fmri_page_service_state(fmd_hdl_t *hdl, nvlist_t *nvl)
38 errno = ldom_fmri_status(cma_lhp, nvl);
40 if (errno == 0 || errno == EINVAL)
41 return (FMD_SERVICE_STATE_UNUSABLE);
42 if (errno == EAGAIN)
43 return (FMD_SERVICE_STATE_ISOLATE_PENDING);
45 return (FMD_SERVICE_STATE_OK);
48 /* ARGSUSED */
49 int
50 cma_fmri_page_retire(fmd_hdl_t *hdl, nvlist_t *nvl)
52 errno = ldom_fmri_retire(cma_lhp, nvl);
54 if (errno == 0 || errno == EIO || errno == EINVAL)
55 return (FMD_AGENT_RETIRE_DONE);
56 if (errno == EAGAIN)
57 return (FMD_AGENT_RETIRE_ASYNC);
59 return (FMD_AGENT_RETIRE_FAIL);
62 /* ARGSUSED */
63 int
64 cma_fmri_page_unretire(fmd_hdl_t *hdl, nvlist_t *nvl)
66 errno = ldom_fmri_unretire(cma_lhp, nvl);
68 if (errno == 0 || errno == EIO)
69 return (FMD_AGENT_RETIRE_DONE);
71 return (FMD_AGENT_RETIRE_FAIL);