xref: /onnv-gate/usr/src/cmd/drd/drd.h (revision 10106:b235491976d3)
12309Srsmaeda /*
22309Srsmaeda  * CDDL HEADER START
32309Srsmaeda  *
42309Srsmaeda  * The contents of this file are subject to the terms of the
52309Srsmaeda  * Common Development and Distribution License (the "License").
62309Srsmaeda  * You may not use this file except in compliance with the License.
72309Srsmaeda  *
82309Srsmaeda  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92309Srsmaeda  * or http://www.opensolaris.org/os/licensing.
102309Srsmaeda  * See the License for the specific language governing permissions
112309Srsmaeda  * and limitations under the License.
122309Srsmaeda  *
132309Srsmaeda  * When distributing Covered Code, include this CDDL HEADER in each
142309Srsmaeda  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152309Srsmaeda  * If applicable, add the following below this CDDL HEADER, with the
162309Srsmaeda  * fields enclosed by brackets "[]" replaced with your own identifying
172309Srsmaeda  * information: Portions Copyright [yyyy] [name of copyright owner]
182309Srsmaeda  *
192309Srsmaeda  * CDDL HEADER END
202309Srsmaeda  */
212309Srsmaeda 
222309Srsmaeda /*
23*10106SJason.Beloro@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
242309Srsmaeda  * Use is subject to license terms.
252309Srsmaeda  */
262309Srsmaeda 
272309Srsmaeda #ifndef _DRD_H
282309Srsmaeda #define	_DRD_H
292309Srsmaeda 
302309Srsmaeda #ifdef __cplusplus
312309Srsmaeda extern "C" {
322309Srsmaeda #endif
332309Srsmaeda 
342309Srsmaeda #include <sys/types.h>
352309Srsmaeda #include <sys/drctl.h>
362309Srsmaeda 
372309Srsmaeda typedef int32_t cpuid_t;
382309Srsmaeda 
392309Srsmaeda /*
402309Srsmaeda  * Logging support
412309Srsmaeda  */
422309Srsmaeda extern void drd_err(char *fmt, ...);
432309Srsmaeda extern void drd_info(char *fmt, ...);
442309Srsmaeda extern void drd_dbg(char *fmt, ...);
452309Srsmaeda 
462309Srsmaeda extern boolean_t drd_daemonized;
472309Srsmaeda extern boolean_t drd_debug;
482309Srsmaeda 
492309Srsmaeda #define	s_free(x)	(((x) != NULL) ? (free(x), (x) = NULL) : (void *)0)
502309Srsmaeda #define	s_nvfree(x)	(((x) != NULL) ? (nvlist_free(x)) : (void)0)
512309Srsmaeda 
522309Srsmaeda /*
532309Srsmaeda  * Backend support
542309Srsmaeda  */
552309Srsmaeda typedef struct {
562309Srsmaeda 	int (*init)(void);
572309Srsmaeda 	int (*fini)(void);
582309Srsmaeda 	int (*cpu_config_request)(drctl_rsrc_t *rsrcs, int nrsrc);
592309Srsmaeda 	int (*cpu_config_notify)(drctl_rsrc_t *rsrcs, int nrsrc);
602309Srsmaeda 	int (*cpu_unconfig_request)(drctl_rsrc_t *rsrcs, int nrsrc);
612309Srsmaeda 	int (*cpu_unconfig_notify)(drctl_rsrc_t *rsrcs, int nrsrc);
626441Sjm22469 	int (*io_config_request)(drctl_rsrc_t *rsrc, int nrsrc);
636441Sjm22469 	int (*io_config_notify)(drctl_rsrc_t *rsrc, int nrsrc);
646441Sjm22469 	int (*io_unconfig_request)(drctl_rsrc_t *rsrc, int nrsrc);
656441Sjm22469 	int (*io_unconfig_notify)(drctl_rsrc_t *rsrc, int nrsrc);
66*10106SJason.Beloro@Sun.COM 	int (*mem_config_request)(drctl_rsrc_t *rsrcs, int nrsrc);
67*10106SJason.Beloro@Sun.COM 	int (*mem_config_notify)(drctl_rsrc_t *rsrcs, int nrsrc);
68*10106SJason.Beloro@Sun.COM 	int (*mem_unconfig_request)(drctl_rsrc_t *rsrcs, int nrsrc);
69*10106SJason.Beloro@Sun.COM 	int (*mem_unconfig_notify)(drctl_rsrc_t *rsrcs, int nrsrc);
702309Srsmaeda } drd_backend_t;
712309Srsmaeda 
722309Srsmaeda extern drd_backend_t drd_rcm_backend;
732309Srsmaeda 
742309Srsmaeda #ifdef __cplusplus
752309Srsmaeda }
762309Srsmaeda #endif
772309Srsmaeda 
782309Srsmaeda #endif /* _DRD_H */
79