11d4b38e0Srsmaeda /* 21d4b38e0Srsmaeda * CDDL HEADER START 31d4b38e0Srsmaeda * 41d4b38e0Srsmaeda * The contents of this file are subject to the terms of the 51d4b38e0Srsmaeda * Common Development and Distribution License (the "License"). 61d4b38e0Srsmaeda * You may not use this file except in compliance with the License. 71d4b38e0Srsmaeda * 81d4b38e0Srsmaeda * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 91d4b38e0Srsmaeda * or http://www.opensolaris.org/os/licensing. 101d4b38e0Srsmaeda * See the License for the specific language governing permissions 111d4b38e0Srsmaeda * and limitations under the License. 121d4b38e0Srsmaeda * 131d4b38e0Srsmaeda * When distributing Covered Code, include this CDDL HEADER in each 141d4b38e0Srsmaeda * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 151d4b38e0Srsmaeda * If applicable, add the following below this CDDL HEADER, with the 161d4b38e0Srsmaeda * fields enclosed by brackets "[]" replaced with your own identifying 171d4b38e0Srsmaeda * information: Portions Copyright [yyyy] [name of copyright owner] 181d4b38e0Srsmaeda * 191d4b38e0Srsmaeda * CDDL HEADER END 201d4b38e0Srsmaeda */ 211d4b38e0Srsmaeda 221d4b38e0Srsmaeda /* 23*9853d9e8SJason Beloro * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 241d4b38e0Srsmaeda * Use is subject to license terms. 251d4b38e0Srsmaeda */ 261d4b38e0Srsmaeda 271d4b38e0Srsmaeda #ifndef _DRD_H 281d4b38e0Srsmaeda #define _DRD_H 291d4b38e0Srsmaeda 301d4b38e0Srsmaeda #ifdef __cplusplus 311d4b38e0Srsmaeda extern "C" { 321d4b38e0Srsmaeda #endif 331d4b38e0Srsmaeda 341d4b38e0Srsmaeda #include <sys/types.h> 351d4b38e0Srsmaeda #include <sys/drctl.h> 361d4b38e0Srsmaeda 371d4b38e0Srsmaeda typedef int32_t cpuid_t; 381d4b38e0Srsmaeda 391d4b38e0Srsmaeda /* 401d4b38e0Srsmaeda * Logging support 411d4b38e0Srsmaeda */ 421d4b38e0Srsmaeda extern void drd_err(char *fmt, ...); 431d4b38e0Srsmaeda extern void drd_info(char *fmt, ...); 441d4b38e0Srsmaeda extern void drd_dbg(char *fmt, ...); 451d4b38e0Srsmaeda 461d4b38e0Srsmaeda extern boolean_t drd_daemonized; 471d4b38e0Srsmaeda extern boolean_t drd_debug; 481d4b38e0Srsmaeda 491d4b38e0Srsmaeda #define s_free(x) (((x) != NULL) ? (free(x), (x) = NULL) : (void *)0) 501d4b38e0Srsmaeda #define s_nvfree(x) (((x) != NULL) ? (nvlist_free(x)) : (void)0) 511d4b38e0Srsmaeda 521d4b38e0Srsmaeda /* 531d4b38e0Srsmaeda * Backend support 541d4b38e0Srsmaeda */ 551d4b38e0Srsmaeda typedef struct { 561d4b38e0Srsmaeda int (*init)(void); 571d4b38e0Srsmaeda int (*fini)(void); 581d4b38e0Srsmaeda int (*cpu_config_request)(drctl_rsrc_t *rsrcs, int nrsrc); 591d4b38e0Srsmaeda int (*cpu_config_notify)(drctl_rsrc_t *rsrcs, int nrsrc); 601d4b38e0Srsmaeda int (*cpu_unconfig_request)(drctl_rsrc_t *rsrcs, int nrsrc); 611d4b38e0Srsmaeda int (*cpu_unconfig_notify)(drctl_rsrc_t *rsrcs, int nrsrc); 628fea755aSjm22469 int (*io_config_request)(drctl_rsrc_t *rsrc, int nrsrc); 638fea755aSjm22469 int (*io_config_notify)(drctl_rsrc_t *rsrc, int nrsrc); 648fea755aSjm22469 int (*io_unconfig_request)(drctl_rsrc_t *rsrc, int nrsrc); 658fea755aSjm22469 int (*io_unconfig_notify)(drctl_rsrc_t *rsrc, int nrsrc); 66*9853d9e8SJason Beloro int (*mem_config_request)(drctl_rsrc_t *rsrcs, int nrsrc); 67*9853d9e8SJason Beloro int (*mem_config_notify)(drctl_rsrc_t *rsrcs, int nrsrc); 68*9853d9e8SJason Beloro int (*mem_unconfig_request)(drctl_rsrc_t *rsrcs, int nrsrc); 69*9853d9e8SJason Beloro int (*mem_unconfig_notify)(drctl_rsrc_t *rsrcs, int nrsrc); 701d4b38e0Srsmaeda } drd_backend_t; 711d4b38e0Srsmaeda 721d4b38e0Srsmaeda extern drd_backend_t drd_rcm_backend; 731d4b38e0Srsmaeda 741d4b38e0Srsmaeda #ifdef __cplusplus 751d4b38e0Srsmaeda } 761d4b38e0Srsmaeda #endif 771d4b38e0Srsmaeda 781d4b38e0Srsmaeda #endif /* _DRD_H */ 79