xref: /illumos-gate/usr/src/lib/fm/libfmd_agent/common/fmd_agent.h (revision 5422785d352a2bb398daceab3d1898a8aa64d006)
1 /*
2  * CDDL HEADER START
3  *
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.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_FMD_AGENT_H
28 #define	_FMD_AGENT_H
29 
30 #include <inttypes.h>
31 #include <libnvpair.h>
32 #include <umem.h>
33 #include <sys/types.h>
34 #include <sys/processor.h>
35 
36 
37 #ifdef	__cplusplus
38 extern "C" {
39 #endif
40 
41 /*
42  * libfmd_agent Interfaces
43  *
44  * Note: The contents of this file are private to the implementation of the
45  * Solaris system and FMD subsystem and are subject to change at any time
46  * without notice.  Applications and drivers using these interfaces will fail
47  * to run on future releases.  These interfaces should not be used for any
48  * purpose until they are publicly documented for use outside of Sun.
49  */
50 
51 #define	FMD_AGENT_VERSION		1
52 
53 #define	FMD_AGENT_RETIRE_DONE		0	/* synchronous success */
54 #define	FMD_AGENT_RETIRE_ASYNC		1	/* asynchronous complete */
55 #define	FMD_AGENT_RETIRE_FAIL		2	/* failure */
56 
57 typedef struct fmd_agent_hdl fmd_agent_hdl_t;
58 
59 extern fmd_agent_hdl_t *fmd_agent_open(int);
60 extern void fmd_agent_close(fmd_agent_hdl_t *);
61 extern int fmd_agent_errno(fmd_agent_hdl_t *);
62 extern const char *fmd_agent_errmsg(fmd_agent_hdl_t *);
63 extern const char *fmd_agent_strerr(int);
64 
65 extern int fmd_agent_page_retire(fmd_agent_hdl_t *, nvlist_t *);
66 extern int fmd_agent_page_unretire(fmd_agent_hdl_t *, nvlist_t *);
67 extern int fmd_agent_page_isretired(fmd_agent_hdl_t *, nvlist_t *);
68 
69 #ifdef __x86
70 extern int fmd_agent_physcpu_info(fmd_agent_hdl_t *, nvlist_t ***cpusp,
71     uint_t *ncpu);
72 extern int fmd_agent_cpu_retire(fmd_agent_hdl_t *, int, int, int);
73 extern int fmd_agent_cpu_unretire(fmd_agent_hdl_t *, int, int, int);
74 extern int fmd_agent_cpu_isretired(fmd_agent_hdl_t *, int, int, int);
75 #endif /* __x86 */
76 
77 #ifdef	__cplusplus
78 }
79 #endif
80 
81 #endif	/* _FMD_AGENT_H */
82