ddi_implfuncs.h revision 83220025eda9c621b0db2d970ab8b3cc5646ec41
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_DDI_IMPLFUNCS_H
#define _SYS_DDI_IMPLFUNCS_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/*
* Declare implementation functions that sunddi functions can
* call in order to perform their required task. Each kernel
* architecture must provide them.
*/
int
int
struct regspec *
int
/*
* Implementation specific memory allocation and de-allocation routines.
*/
int
int
void
int
void
void
void
/*
*/
void
void
void
void
/*
* Event-handling functions for rootnex
* These provide the standard implementation of fault handling
*/
void
int
int
int
int
/*
* Clustering: Return the global devices path base, or
* the entire global devices path prefix.
*/
const char *
const char *
/*
* Search and return properties from the PROM
*/
int
/*
* Copy an integer from PROM to native machine representation
*/
int
extern int impl_ddi_sunbus_initchild(dev_info_t *);
extern void impl_ddi_sunbus_removechild(dev_info_t *);
/*
* Implementation specific access handle allocator and init. routines
*/
/* access error handling support */
extern void impl_acc_err_init(ddi_acc_hdl_t *);
extern int impl_dma_check(dev_info_t *, const void *, const void *,
const void *);
extern int i_ddi_ontrap(ddi_acc_handle_t);
extern void i_ddi_notrap(ddi_acc_handle_t);
extern int i_ddi_prot_trampoline();
extern int i_ddi_caut_trampoline();
/*
* to change.
*/
extern int
extern int
extern char *
i_convert_boot_device_name(char *, char *, size_t *);
/*
* Nodeid management ...
*/
void impl_ddi_init_nodeid(void);
int impl_ddi_alloc_nodeid(int *nodeid);
void impl_ddi_free_nodeid(int nodeid);
/*
* minorname/devtspectype conversions
*/
extern char *
extern int
/*
* Routines in ddi_v9_asm.s
*/
extern void peek_fault(void);
extern void poke_fault(void);
/*
* Helper functions
*/
char *i_ddi_strdup(char *, uint_t);
void i_ddi_prop_list_delete(ddi_prop_t *);
int i_ddi_load_drvconf(major_t);
int i_ddi_unload_drvconf(major_t);
int i_ddi_devi_attached(dev_info_t *);
void i_ddi_parse_name(char *, char **, char **, char **);
int i_ddi_detach_installed_driver(major_t, int);
void i_ddi_set_binding_name(dev_info_t *, char *);
void i_ddi_bind_devs();
void i_ddi_unbind_devs(major_t);
struct devnames;
int i_ddi_prompath_to_devfspath(char *, char *);
dev_info_t *i_ddi_attach_pseudo_node(char *);
int i_ddi_attach_hw_nodes(char *);
int i_ddi_devs_attached(major_t);
/* non-DDI functions: wrapper around mod_hold/rele_dev_by_major() */
void ddi_rele_driver(major_t);
/*
* devid cache
*/
void i_ddi_devices_init(void);
void i_ddi_read_devices_files(void);
void i_ddi_clean_devices_files(void);
void e_devid_cache_unregister(dev_info_t *);
void e_devid_cache_free_devt_list(int, dev_t *);
/*
* Resource control functions to lock down device memory.
*/
zone_t *, rctl_qty_t);
zone_t *, rctl_qty_t);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_DDI_IMPLFUNCS_H */