• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rman_get_flags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rman_get_flags函数的典型用法代码示例。如果您正苦于以下问题:C++ rman_get_flags函数的具体用法?C++ rman_get_flags怎么用?C++ rman_get_flags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rman_get_flags函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ofw_pci_adjust_resource

static int
ofw_pci_adjust_resource(device_t bus, device_t child, int type,
    struct resource *res, u_long start, u_long end)
{
	struct rman *rm = NULL;
	struct ofw_pci_softc *sc = device_get_softc(bus);

	KASSERT(!(rman_get_flags(res) & RF_ACTIVE),
	    ("active resources cannot be adjusted"));
	if (rman_get_flags(res) & RF_ACTIVE)
		return (EINVAL);

	switch (type) {
	case SYS_RES_MEMORY:
		rm = &sc->sc_mem_rman;
		break;
	case SYS_RES_IOPORT:
		rm = &sc->sc_io_rman;
		break;
	default:
		return (ENXIO);
	}

	if (!rman_is_region_manager(res, rm))
		return (EINVAL);

	return (rman_adjust_resource(res, start, end));
}
开发者ID:ngkaho1234,项目名称:freebsd,代码行数:28,代码来源:ofw_pci.c


示例2: pci_vf_release_mem_resource

int
pci_vf_release_mem_resource(device_t dev, device_t child, int rid,
    struct resource *r)
{
	struct pci_devinfo *dinfo;
	struct resource_list_entry *rle;
	int error;

	dinfo = device_get_ivars(child);

	if (rman_get_flags(r) & RF_ACTIVE) {
		error = bus_deactivate_resource(child, SYS_RES_MEMORY, rid, r);
		if (error != 0)
			return (error);
	}

	rle = resource_list_find(&dinfo->resources, SYS_RES_MEMORY, rid);
	if (rle != NULL) {
		rle->res = NULL;
		resource_list_delete(&dinfo->resources, SYS_RES_MEMORY,
		    rid);
	}

	return (rman_release_resource(r));
}
开发者ID:hmatyschok,项目名称:MeshBSD,代码行数:25,代码来源:pci_iov.c


示例3: nexus_setup_intr

static int
nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r,
                 int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
                 void **cookiep)
{
    int error;

    if (r == NULL)
        panic("%s: NULL interrupt resource!", __func__);

    if ((rman_get_flags(r) & RF_SHAREABLE) == 0)
        flags |= INTR_EXCL;

    /* We depend here on rman_activate_resource() being idempotent. */
    error = rman_activate_resource(r);
    if (error)
        return (error);

    error = inthand_add(device_get_nameunit(child), rman_get_start(r),
                        filt, intr, arg, flags, cookiep);

    /*
     * XXX in case of the AFB/FFB interrupt and a Psycho, Sabre or U2S
     * bridge enable the interrupt in the respective bridge.
     */

    return (error);
}
开发者ID:outbackdingo,项目名称:uBSD,代码行数:28,代码来源:nexus.c


示例4: ocpbus_setup_intr

static int
ocpbus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
    driver_filter_t *filter, driver_intr_t *ihand, void *arg, void **cookiep)
{
	int error;

	if (res == NULL)
		panic("ocpbus_setup_intr: NULL irq resource!");

	*cookiep = 0;
	if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
		flags |= INTR_EXCL;

	/*
	 * We depend here on rman_activate_resource() being idempotent.
	 */
	error = rman_activate_resource(res);
	if (error)
		return (error);

	error = powerpc_setup_intr(device_get_nameunit(child),
	    rman_get_start(res), filter, ihand, arg, flags, cookiep);

	return (error);
}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:25,代码来源:ocpbus.c


示例5: nexus_setup_intr

static int
nexus_setup_intr(device_t bus __unused, device_t child, struct resource *r,
    int flags, driver_filter_t *filt, driver_intr_t *intr, void *arg,
    void **cookiep)
{
	int error, domain;

	if (r == NULL)
		panic("%s: NULL interrupt resource!", __func__);

	if (cookiep != NULL)
		*cookiep = NULL;
	if ((rman_get_flags(r) & RF_SHAREABLE) == 0)
		flags |= INTR_EXCL;

	/* We depend here on rman_activate_resource() being idempotent. */
	error = rman_activate_resource(r);
	if (error)
		return (error);

	if (bus_get_domain(child, &domain) != 0) {
		if(bootverbose)
			device_printf(child, "no domain found\n");
		domain = 0;
	}
	error = powerpc_setup_intr(device_get_nameunit(child),
	    rman_get_start(r), filt, intr, arg, flags, cookiep, domain);

	return (error);
}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:30,代码来源:nexus.c


示例6: chipc_activate_bhnd_resource

static int
chipc_activate_bhnd_resource(device_t dev, device_t child, int type,
    int rid, struct bhnd_resource *r)
{
	struct chipc_softc	*sc;
	struct rman		*rm;
	int			 error;

	sc = device_get_softc(dev);
	
	/* Delegate non-locally managed resources to parent */
	rm = chipc_get_rman(sc, type);
	if (rm == NULL || !rman_is_region_manager(r->res, rm)) {
		return (bhnd_bus_generic_activate_resource(dev, child, type,
		    rid, r));
	}

	/* Try activating the chipc region resource */
	error = chipc_try_activate_resource(sc, child, type, rid, r->res,
	    false);
	if (error)
		return (error);

	/* Mark the child resource as direct according to the returned resource
	 * state */
	if (rman_get_flags(r->res) & RF_ACTIVE)
		r->direct = true;

	return (0);
}
开发者ID:wulf7,项目名称:freebsd,代码行数:30,代码来源:chipc.c


示例7: nexus_setup_intr

/*
 * Currently this uses the really grody interface from kern/kern_intr.c
 * (which really doesn't belong in kern/anything.c).  Eventually, all of
 * the code in kern_intr.c and machdep_intr.c should get moved here, since
 * this is going to be the official interface.
 */
static int
nexus_setup_intr(device_t bus, device_t child, struct resource *irq,
		 int flags, driver_filter_t filter, void (*ihand)(void *),
		 void *arg, void **cookiep)
{
	int		error;

	/* somebody tried to setup an irq that failed to allocate! */
	if (irq == NULL)
		panic("nexus_setup_intr: NULL irq resource!");

	*cookiep = 0;
	if ((rman_get_flags(irq) & RF_SHAREABLE) == 0)
		flags |= INTR_EXCL;

	/*
	 * We depend here on rman_activate_resource() being idempotent.
	 */
	error = rman_activate_resource(irq);
	if (error)
		return (error);

	error = intr_add_handler(device_get_nameunit(child),
	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);

	return (error);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:33,代码来源:nexus.c


示例8: nexus_release_resource

static int
nexus_release_resource(device_t bus, device_t child, int type, int rid,
		       struct resource *r)
{
	if (rman_get_flags(r) & RF_ACTIVE) {
		int error = bus_deactivate_resource(child, type, rid, r);
		if (error)
			return error;
	}
	return (rman_release_resource(r));
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:11,代码来源:nexus.c


示例9: nexus_setup_intr

static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
    driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{

	if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
		flags |= INTR_EXCL;

	arm_setup_irqhandler(device_get_nameunit(child), 
	    filt, intr, arg, rman_get_start(res), flags, cookiep);
	return (0);
}
开发者ID:edgar-pek,项目名称:PerspicuOS,代码行数:12,代码来源:nexus.c


示例10: ofwbus_release_resource

static int
ofwbus_release_resource(device_t bus __unused, device_t child, int type,
    int rid, struct resource *r)
{
	int error;

	if ((rman_get_flags(r) & RF_ACTIVE) != 0) {
		error = bus_deactivate_resource(child, type, rid, r);
		if (error)
			return (error);
	}
	return (rman_release_resource(r));
}
开发者ID:ChristosKa,项目名称:freebsd,代码行数:13,代码来源:ofwbus.c


示例11: lbc_release_resource

static int
lbc_release_resource(device_t dev, device_t child, int type, int rid,
    struct resource *res)
{
	int err;

	if (rman_get_flags(res) & RF_ACTIVE) {
		err = bus_deactivate_resource(child, type, rid, res);
		if (err)
			return (err);
	}

	return (rman_release_resource(res));
}
开发者ID:ChaosJohn,项目名称:freebsd,代码行数:14,代码来源:lbc.c


示例12: ofw_pci_release_resource

static int
ofw_pci_release_resource(device_t bus, device_t child, int type, int rid,
    struct resource *res)
{

	if (rman_get_flags(res) & RF_ACTIVE) {
		int error;

		error = bus_deactivate_resource(child, type, rid, res);
		if (error != 0)
			return (error);
	}

	return (rman_release_resource(res));
}
开发者ID:2asoft,项目名称:freebsd,代码行数:15,代码来源:ofwpci.c


示例13: nexus_setup_intr

static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
    driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
	int irq;

	if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
		flags |= INTR_EXCL;

	for (irq = rman_get_start(res); irq <= rman_get_end(res); irq++) {
		arm_setup_irqhandler(device_get_nameunit(child),
		    filt, intr, arg, irq, flags, cookiep);
		arm_unmask_irq(irq);
	}
	return (0);
}
开发者ID:amir-partovi,项目名称:Taha,代码行数:16,代码来源:nexus.c


示例14: nexus_release_resource

static int
nexus_release_resource(device_t bus, device_t child, int type, int rid,
		       struct resource *r)
{
	if (rman_get_flags(r) & RF_ACTIVE) {
		int error = bus_deactivate_resource(child, type, rid, r);
		if (error)
			return error;
	}
#ifdef PC98
	if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {
		i386_bus_space_handle_free(r->r_bustag, r->r_bushandle,
					   r->r_bushandle->bsh_sz);
	}
#endif
	return (rman_release_resource(r));
}
开发者ID:MarginC,项目名称:kame,代码行数:17,代码来源:nexus.c


示例15: zbpci_release_resource

static int
zbpci_release_resource(device_t bus, device_t child, int type, int rid,
		       struct resource *r)
{
	int error;

	if (type != SYS_RES_IOPORT)
		return (bus_generic_release_resource(bus, child, type, rid, r));

	if (rman_get_flags(r) & RF_ACTIVE) {
		error = bus_deactivate_resource(child, type, rid, r);
		if (error)
			return (error);
	}

	return (rman_release_resource(r));
}
开发者ID:2asoft,项目名称:freebsd,代码行数:17,代码来源:sb_zbpci.c


示例16: nexus_setup_intr

static int
nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
    driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
	int error;

	if ((rman_get_flags(res) & RF_SHAREABLE) == 0)
		flags |= INTR_EXCL;

	/* We depend here on rman_activate_resource() being idempotent. */
	error = rman_activate_resource(res);
	if (error)
		return (error);

	error = intr_setup_irq(child, res, filt, intr, arg, flags, cookiep);

	return (error);
}
开发者ID:nomadlogic,项目名称:freebsd-base-graphics,代码行数:18,代码来源:nexus.c


示例17: chipc_release_resource

static int
chipc_release_resource(device_t dev, device_t child, int type, int rid,
    struct resource *r)
{
	struct chipc_softc		*sc;
	struct chipc_region		*cr;
	struct rman			*rm;
	struct resource_list_entry	*rle;
	int			 	 error;

	sc = device_get_softc(dev);

	/* Handled by parent bus? */
	rm = chipc_get_rman(sc, type);
	if (rm == NULL || !rman_is_region_manager(r, rm)) {
		return (bus_generic_rl_release_resource(dev, child, type, rid,
		    r));
	}

	/* Locate the mapping region */
	cr = chipc_find_region(sc, rman_get_start(r), rman_get_end(r));
	if (cr == NULL)
		return (EINVAL);

	/* Deactivate resources */
	if (rman_get_flags(r) & RF_ACTIVE) {
		error = BUS_DEACTIVATE_RESOURCE(dev, child, type, rid, r);
		if (error)
			return (error);
	}

	if ((error = rman_release_resource(r)))
		return (error);

	/* Drop allocation reference */
	chipc_release_region(sc, cr, RF_ALLOCATED);

	/* Clear reference from the resource list entry if exists */
	rle = resource_list_find(BUS_GET_RESOURCE_LIST(dev, child), type, rid);
	if (rle != NULL)
		rle->res = NULL;

	return (0);
}
开发者ID:wulf7,项目名称:freebsd,代码行数:44,代码来源:chipc.c


示例18: ofwbus_release_resource

static int
ofwbus_release_resource(device_t bus, device_t child, int type,
    int rid, struct resource *r)
{
	struct resource_list_entry *rle;
	int error;

	/* Clean resource list entry */
	rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid);
	if (rle != NULL)
		rle->res = NULL;

	if ((rman_get_flags(r) & RF_ACTIVE) != 0) {
		error = bus_deactivate_resource(child, type, rid, r);
		if (error)
			return (error);
	}
	return (rman_release_resource(r));
}
开发者ID:embedclub,项目名称:freebsd,代码行数:19,代码来源:ofwbus.c


示例19: cbb_pci_release_resource

static int
cbb_pci_release_resource(device_t bus, device_t child, int type, int rid,
    struct resource *r)
{
	struct cbb_softc *sc;
	int error;

	sc = device_get_softc(bus);
	if (type == PCI_RES_BUS) {
		if (!rman_is_region_manager(r, &sc->bus.rman))
			return (EINVAL);
		if (rman_get_flags(r) & RF_ACTIVE) {
			error = bus_deactivate_resource(child, type, rid, r);
			if (error)
				return (error);
		}
		return (rman_release_resource(r));
	}
	return (cbb_release_resource(bus, child, type, rid, r));
}
开发者ID:embedclub,项目名称:freebsd,代码行数:20,代码来源:pccbb_pci.c


示例20: puc_bus_release_resource

int
puc_bus_release_resource(device_t dev, device_t child, int type, int rid,
    struct resource *res)
{
	struct puc_port *port;
	device_t originator;

	/* Get our immediate child. */
	originator = child;
	while (child != NULL && device_get_parent(child) != dev)
		child = device_get_parent(child);
	if (child == NULL)
		return (EINVAL);

	port = device_get_ivars(child);
	KASSERT(port != NULL, ("%s %d", __func__, __LINE__));

	if (rid != 0 || res == NULL)
		return (EINVAL);

	if (type == port->p_bar->b_type) {
		if (res != port->p_rres)
			return (EINVAL);
	} else if (type == SYS_RES_IRQ) {
		if (res != port->p_ires)
			return (EINVAL);
		if (port->p_hasintr)
			return (EBUSY);
	} else
		return (EINVAL);

	if (rman_get_device(res) != originator)
		return (ENXIO);
	if (rman_get_flags(res) & RF_ACTIVE)
		rman_deactivate_resource(res);
	rman_set_device(res, NULL);
	return (0);
}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:38,代码来源:puc.c



注:本文中的rman_get_flags函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rman_get_rid函数代码示例发布时间:2022-05-30
下一篇:
C++ rman_get_bustag函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap