dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / cmd / fm / modules / common / cpumem-retire / cma_page_arch.c
blobc28fd7ff1564535a538197da3de7d239d941e2b2
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
23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #include <fm/fmd_api.h>
28 #include <fm/fmd_agent.h>
29 #include <fm/fmd_fmri.h>
31 /* ARGSUSED */
32 int
33 cma_fmri_page_service_state(fmd_hdl_t *hdl, nvlist_t *nvl)
35 fmd_agent_hdl_t *fa_hdl;
36 int rc;
38 if ((fa_hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
39 rc = fmd_agent_page_isretired(fa_hdl, nvl);
40 if (rc == FMD_AGENT_RETIRE_DONE)
41 rc = FMD_SERVICE_STATE_UNUSABLE;
42 else if (rc == FMD_AGENT_RETIRE_FAIL)
43 rc = FMD_SERVICE_STATE_OK;
44 else if (rc == FMD_AGENT_RETIRE_ASYNC)
45 rc = FMD_SERVICE_STATE_ISOLATE_PENDING;
46 fmd_agent_close(fa_hdl);
47 return (rc);
50 return (FMD_SERVICE_STATE_UNKNOWN);
53 /* ARGSUSED */
54 int
55 cma_fmri_page_retire(fmd_hdl_t *hdl, nvlist_t *nvl)
57 fmd_agent_hdl_t *fa_hdl;
58 int rc;
60 if ((fa_hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
61 rc = fmd_agent_page_retire(fa_hdl, nvl);
62 fmd_agent_close(fa_hdl);
63 return (rc);
66 return (FMD_AGENT_RETIRE_FAIL);
69 /* ARGSUSED */
70 int
71 cma_fmri_page_unretire(fmd_hdl_t *hdl, nvlist_t *nvl)
73 fmd_agent_hdl_t *fa_hdl;
74 int rc;
76 if ((fa_hdl = fmd_agent_open(FMD_AGENT_VERSION)) != NULL) {
77 rc = fmd_agent_page_unretire(fa_hdl, nvl);
78 fmd_agent_close(fa_hdl);
79 return (rc);
82 return (FMD_AGENT_RETIRE_FAIL);