本文整理汇总了C++中DEVI函数的典型用法代码示例。如果您正苦于以下问题:C++ DEVI函数的具体用法?C++ DEVI怎么用?C++ DEVI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DEVI函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dr_is_real_device
static int
dr_is_real_device(dev_info_t *dip)
{
struct regspec *regbuf = NULL;
int length = 0;
int rc;
if (ddi_get_driver(dip) == NULL)
return (0);
if (DEVI(dip)->devi_pm_flags & (PMC_NEEDS_SR|PMC_PARENTAL_SR))
return (1);
if (DEVI(dip)->devi_pm_flags & PMC_NO_SR)
return (0);
/*
* now the general case
*/
rc = ddi_getlongprop(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS, "reg",
(caddr_t)®buf, &length);
ASSERT(rc != DDI_PROP_NO_MEMORY);
if (rc != DDI_PROP_SUCCESS) {
return (0);
} else {
if ((length > 0) && (regbuf != NULL))
kmem_free(regbuf, length);
return (1);
}
}
示例2: i_ddi_intr_devi_fini
void
i_ddi_intr_devi_fini(dev_info_t *dip)
{
devinfo_intr_t *intr_p = DEVI(dip)->devi_intr_p;
DDI_INTR_APIDBG((CE_CONT, "i_ddi_intr_devi_fini: dip %p\n",
(void *)dip));
if ((intr_p == NULL) || i_ddi_intr_get_current_nintrs(dip))
return;
/*
* devi_intr_handle_p will only be used for devices
* which are using the legacy DDI Interrupt interfaces.
*/
if (intr_p->devi_intr_handle_p) {
/* nintrs could be zero; so check for it first */
if (intr_p->devi_intr_sup_nintrs) {
kmem_free(intr_p->devi_intr_handle_p,
intr_p->devi_intr_sup_nintrs *
sizeof (ddi_intr_handle_t));
}
}
/*
* devi_irm_req_p will only be used for devices which
* are mapped to an Interrupt Resource Management pool.
*/
if (intr_p->devi_irm_req_p)
(void) i_ddi_irm_remove(dip);
kmem_free(DEVI(dip)->devi_intr_p, sizeof (devinfo_intr_t));
DEVI(dip)->devi_intr_p = NULL;
}
示例3: di_dfs
static void
di_dfs(dev_info_t *devi, int (*f)(dev_info_t *, int), caddr_t arg)
{
(void) (*f)(devi, 0);
if (devi) {
di_dfs((dev_info_t *)DEVI(devi)->devi_child, f, arg);
di_dfs((dev_info_t *)DEVI(devi)->devi_sibling, f, arg);
}
}
示例4: in_set_instance
static void
in_set_instance(dev_info_t *dip, in_drv_t *dp, major_t major)
{
/* use preassigned instance if available */
if (DEVI(dip)->devi_instance != -1)
dp->ind_instance = DEVI(dip)->devi_instance;
else
dp->ind_instance = in_next_instance(major);
}
示例5: ppb_bus_map
/*ARGSUSED*/
static int
ppb_bus_map(dev_info_t *dip, dev_info_t *rdip, ddi_map_req_t *mp,
off_t offset, off_t len, caddr_t *vaddrp)
{
register dev_info_t *pdip;
pdip = (dev_info_t *)DEVI(dip)->devi_parent;
return ((DEVI(pdip)->devi_ops->devo_bus_ops->bus_map)
(pdip, rdip, mp, offset, len, vaddrp));
}
示例6: i_ndi_busop_access_exit
void
i_ndi_busop_access_exit(dev_info_t *dip, ddi_acc_handle_t handle)
{
dev_info_t *pdip = (dev_info_t *)DEVI(dip)->devi_parent;
/* Valid operation for BUSO_REV_6 and above */
if (DEVI(pdip)->devi_ops->devo_bus_ops->busops_rev < BUSO_REV_6)
return;
if (DEVI(pdip)->devi_ops->devo_bus_ops->bus_fm_access_exit == NULL)
return;
(*DEVI(pdip)->devi_ops->devo_bus_ops->bus_fm_access_exit)(pdip, handle);
}
示例7: i_ddi_intr_get_current_nenables
uint_t
i_ddi_intr_get_current_nenables(dev_info_t *dip)
{
devinfo_intr_t *intr_p = DEVI(dip)->devi_intr_p;
return (intr_p ? intr_p->devi_intr_curr_nenables : 0);
}
示例8: i_ddi_get_msi_msix_cap_ptr
int
i_ddi_get_msi_msix_cap_ptr(dev_info_t *dip)
{
devinfo_intr_t *intr_p = DEVI(dip)->devi_intr_p;
return (intr_p ? intr_p->devi_cap_ptr : 0);
}
示例9: i_ddi_intr_get_current_navail
/*
* i_ddi_intr_get_current_navail:
*
* Return the number of interrupts currently available.
* If a precise number set by IRM is not available, then
* return the limit determined by i_ddi_intr_get_limit().
*/
uint_t
i_ddi_intr_get_current_navail(dev_info_t *dip, int type)
{
devinfo_intr_t *intr_p;
ddi_irm_pool_t *pool_p;
ddi_irm_req_t *req_p;
uint_t navail;
/* Check for a precise number from IRM */
if (((intr_p = DEVI(dip)->devi_intr_p) != NULL) &&
((req_p = intr_p->devi_irm_req_p) != NULL) &&
(type == req_p->ireq_type) &&
((pool_p = req_p->ireq_pool_p) != NULL)) {
/*
* Lock to be sure a rebalance is not in progress.
* (Should be changed to a rwlock.)
*/
mutex_enter(&pool_p->ipool_navail_lock);
navail = req_p->ireq_navail;
mutex_exit(&pool_p->ipool_navail_lock);
return (navail);
}
/* Otherwise, return the limit */
return (i_ddi_intr_get_limit(dip, type, NULL));
}
示例10: i_ddi_intr_get_pool
/*
* i_ddi_intr_get_pool()
*
* Get an IRM pool that supplies interrupts of a specified type.
* Invokes a DDI_INTROP_GETPOOL to the bus nexus driver. Fails
* if no pool exists.
*/
ddi_irm_pool_t *
i_ddi_intr_get_pool(dev_info_t *dip, int type)
{
devinfo_intr_t *intr_p;
ddi_irm_pool_t *pool_p;
ddi_irm_req_t *req_p;
ddi_intr_handle_impl_t hdl;
ASSERT(dip != NULL);
ASSERT(DDI_INTR_TYPE_FLAG_VALID(type));
if (((intr_p = DEVI(dip)->devi_intr_p) != NULL) &&
((req_p = intr_p->devi_irm_req_p) != NULL) &&
((pool_p = req_p->ireq_pool_p) != NULL) &&
(pool_p->ipool_types & type)) {
return (pool_p);
}
bzero(&hdl, sizeof (ddi_intr_handle_impl_t));
hdl.ih_dip = dip;
hdl.ih_type = type;
if (i_ddi_intr_ops(dip, dip, DDI_INTROP_GETPOOL,
&hdl, (void *)&pool_p) == DDI_SUCCESS)
return (pool_p);
return (NULL);
}
示例11: i_ddi_get_pci_config_handle
ddi_acc_handle_t
i_ddi_get_pci_config_handle(dev_info_t *dip)
{
devinfo_intr_t *intr_p = DEVI(dip)->devi_intr_p;
return (intr_p ? intr_p->devi_cfg_handle : NULL);
}
示例12: sbdp_suspend_devices_exit
/*ARGSUSED*/
static int
sbdp_suspend_devices_exit(dev_info_t *dip, void *arg)
{
struct dev_info *devi = DEVI(dip);
ndi_devi_exit(dip, devi->devi_circular);
return (DDI_WALK_CONTINUE);
}
示例13: i_ddi_set_intr_handle
void
i_ddi_set_intr_handle(dev_info_t *dip, int inum, ddi_intr_handle_t intr_hdl)
{
devinfo_intr_t *intr_p = DEVI(dip)->devi_intr_p;
if (intr_p == NULL)
return;
/*
* Changed this to a check and return if an invalid inum
* is passed to set a handle
*/
if ((inum < 0) || (inum >= intr_p->devi_intr_sup_nintrs))
return;
if (intr_hdl && (intr_p->devi_intr_handle_p == NULL)) {
/* nintrs could be zero; so check for it first */
if (intr_p->devi_intr_sup_nintrs)
intr_p->devi_intr_handle_p = kmem_zalloc(
sizeof (ddi_intr_handle_t) *
intr_p->devi_intr_sup_nintrs, KM_SLEEP);
}
if (intr_p->devi_intr_handle_p)
intr_p->devi_intr_handle_p[inum] = intr_hdl;
}
示例14: i_ddi_get_msix
ddi_intr_msix_t *
i_ddi_get_msix(dev_info_t *dip)
{
devinfo_intr_t *intr_p = DEVI(dip)->devi_intr_p;
return (intr_p ? intr_p->devi_msix_p : NULL);
}
示例15: e_devid_minor_to_devlist
/*
* Build a list of dev_t's for a device/devid
*
* The effect of this function is cumulative, adding dev_t's
* for the device to the list of all dev_t's for a given
* devid.
*/
static void
e_devid_minor_to_devlist(
dev_info_t *dip,
char *minor_name,
int ndevts_alloced,
int *devtcntp,
dev_t *devtsp)
{
struct ddi_minor_data *dmdp;
int minor_all = 0;
int ndevts = *devtcntp;
ASSERT(i_ddi_devi_attached(dip));
/* are we looking for a set of minor nodes? */
if ((minor_name == DEVID_MINOR_NAME_ALL) ||
(minor_name == DEVID_MINOR_NAME_ALL_CHR) ||
(minor_name == DEVID_MINOR_NAME_ALL_BLK))
minor_all = 1;
mutex_enter(&(DEVI(dip)->devi_lock));
/* Find matching minor names */
for (dmdp = DEVI(dip)->devi_minor; dmdp; dmdp = dmdp->next) {
/* Skip non-minors, and non matching minor names */
if ((dmdp->type != DDM_MINOR) || ((minor_all == 0) &&
strcmp(dmdp->ddm_name, minor_name)))
continue;
/* filter out minor_all mismatches */
if (minor_all &&
(((minor_name == DEVID_MINOR_NAME_ALL_CHR) &&
(dmdp->ddm_spec_type != S_IFCHR)) ||
((minor_name == DEVID_MINOR_NAME_ALL_BLK) &&
(dmdp->ddm_spec_type != S_IFBLK))))
continue;
if (ndevts < ndevts_alloced)
devtsp[ndevts] = dmdp->ddm_dev;
ndevts++;
}
mutex_exit(&(DEVI(dip)->devi_lock));
*devtcntp = ndevts;
}