esunddi.h revision fa9e4066f08beec538e775443c5be79dd423fcab
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_ESUNDDI_H
#define _SYS_ESUNDDI_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 */
#include <sys/autoconf.h>
#include <sys/ddi_impldefs.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* esunddi.h: Function prototypes for kernel ddi functions.
* Note that drivers calling these functions are not
* portable.
*/
int
int
int
int
int
int
int
int
int
int
void
int
int
int
int
int
int
int
int
void
pm_init(void);
void
int
int
/*
* return codes for devi_stillreferenced()
*
* DEVI_REFERENCED - specfs has open minor device(s) for the devinfo
* DEVI_NOT_REFERENCED - specfs has no open minor device for the devinfo
*/
#define DEVI_REFERENCED 1
#define DEVI_NOT_REFERENCED 0
int
extern int (*pm_platform_power)(power_req_t *);
/*
* A consolidation private function which is essentially equivalent to
* ddi_umem_lock but with the addition of arguments ops_vector and procp.
* The procp argument can be eliminated eventually as part of proper
* dynamic reconfiguration callback implementation.
*
* The valid flag values are those used for ddi_umem_lock plus an
* additional flag (DDI_UMEMLOCK_LONGTERM) which must be set when the
* locking will be maintained for an indefinitely long period (essentially
* permanent), rather than for what would be required for a typical I/O
* completion. When DDI_UMEMLOCK_LONGTERM is set, umem_lockmemory will
* return EFAULT if the memory pertains to a regular file which is
* mapped MAP_SHARED. This is to prevent a deadlock in the pvn routines
* if a file truncation is attempted after the locking is done.
*/
int
struct umem_callback_ops *ops_vector,
#define DDI_UMEMLOCK_LONGTERM 0x04
/*
* These are evolving forms of the ddi function ddi_hold_devi_by_instance.
* Like ddi_hold_devi_by_instance, the hold should be released with
* ddi_release_devi.
*/
/* {e_}ddi_hold_devi{_by{instance|dev|path}} flags */
#define E_DDI_HOLD_DEVI_NOATTACH 0x01
void
/*
* Return the reference count on a devinfo node. The caller can determine,
* with knowledge of his own holds, if the devinfo node is still in use.
*/
int
/*
* Perform path reconstruction given a major and instance. Does not
* drive attach of the path.
*/
int
/*
* walk all devinfo nodes linked on the driver list
*/
void
e_ddi_walk_driver(char *, int (*f)(dev_info_t *, void *), void *);
/*
* Given the nodeid for a persistent node, find the corresponding
* devinfo node.
* NOTE: .conf nodeids are not valid arguments to this function.
*/
/*
* Obsolete interfaces, no longer used, to be removed.
* Retained only for driver compatibility.
*/
void
int
void
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_ESUNDDI_H */