您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DEVTONX函数代码示例

51自学网 2021-06-01 20:21:17
  C++
这篇教程C++ DEVTONX函数代码示例写得很实用,希望能帮到您。

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

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

示例1: nexus_get_reslist

static struct resource_list *nexus_get_reslist(device_t dev, device_t child){	struct nexus_device *ndev = DEVTONX(child);	return (&ndev->nx_resources);}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:7,


示例2: nexus_delete_resource

static voidnexus_delete_resource(device_t dev, device_t child, int type, int rid){	struct nexus_device	*ndev = DEVTONX(child);	struct resource_list	*rl = &ndev->nx_resources;	resource_list_delete(rl, type, rid);}
开发者ID:MarginC,项目名称:kame,代码行数:8,


示例3: nexus_alloc_resource

/* * Allocate a resource on behalf of child.  NB: child is usually going to be a * child of one of our descendants, not a direct child of nexus0. * (Exceptions include footbridge.) */static struct resource *nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,    rman_res_t start, rman_res_t end, rman_res_t count, u_int flags){	struct nexus_device *ndev = DEVTONX(child);	struct resource *rv;	struct resource_list_entry *rle;	struct rman *rm;	int needactivate = flags & RF_ACTIVE;	/*	 * If this is an allocation of the "default" range for a given	 * RID, and we know what the resources for this device are	 * (ie. they aren't maintained by a child bus), then work out	 * the start/end values.	 */	if (RMAN_IS_DEFAULT_RANGE(start, end) && (count == 1)) {		if (device_get_parent(child) != bus || ndev == NULL)			return(NULL);		rle = resource_list_find(&ndev->nx_resources, type, *rid);		if (rle == NULL)			return(NULL);		start = rle->start;		end = rle->end;		count = rle->count;	}	switch (type) {	case SYS_RES_IRQ:		rm = &irq_rman;		break;	case SYS_RES_MEMORY:	case SYS_RES_IOPORT:		rm = &mem_rman;		break;	default:		return (NULL);	}	rv = rman_reserve_resource(rm, start, end, count, flags, child);	if (rv == NULL)		return (NULL);	rman_set_rid(rv, *rid);	rman_set_bushandle(rv, rman_get_start(rv));	if (needactivate) {		if (bus_activate_resource(child, type, *rid, rv)) {			rman_release_resource(rv);			return (NULL);		}	}	return (rv);}
开发者ID:nomadlogic,项目名称:freebsd-base-graphics,代码行数:62,


示例4: nexus_set_resource

static intnexus_set_resource(device_t dev, device_t child, int type, int rid, u_long start, u_long count){	struct nexus_device	*ndev = DEVTONX(child);	struct resource_list	*rl = &ndev->nx_resources;	/* XXX this should return a success/failure indicator */	resource_list_add(rl, type, rid, start, start + count - 1, count);	return(0);}
开发者ID:MarginC,项目名称:kame,代码行数:10,


示例5: nexus_write_ivar

static intnexus_write_ivar(device_t dev, device_t child, int which, uintptr_t value){	struct nexus_device *ndev = DEVTONX(child);		switch (which) {	case NEXUS_IVAR_PCIBUS:		ndev->nx_pcibus = value;		break;	default:		return ENOENT;	}	return 0;}
开发者ID:madhavsuresh,项目名称:DragonFlyBSD,代码行数:14,


示例6: nexus_read_ivar

static intnexus_read_ivar(device_t dev, device_t child, int which, uintptr_t *result){	struct nexus_device *ndev = DEVTONX(child);		switch (which) {	case NEXUS_IVAR_PCIBUS:		*result = ndev->nx_pcibus;		break;	default:		return ENOENT;	}	return 0;}
开发者ID:madhavsuresh,项目名称:DragonFlyBSD,代码行数:14,


示例7: nexus_print_child

static intnexus_print_child(device_t bus, device_t child){	struct	nexus_device *ndev = DEVTONX(child);	int retval = 0;	retval += bus_print_child_header(bus, child);	retval += nexus_print_all_resources(child);	if (ndev->nx_pcibus != -1)		retval += kprintf(" pcibus %d", ndev->nx_pcibus);	retval += kprintf(" on motherboard/n");	return (retval);}
开发者ID:madhavsuresh,项目名称:DragonFlyBSD,代码行数:14,


示例8: nexus_print_all_resources

static intnexus_print_all_resources(device_t dev){	struct	nexus_device *ndev = DEVTONX(dev);	struct resource_list *rl = &ndev->nx_resources;	int retval = 0;	if (SLIST_FIRST(rl) || ndev->nx_pcibus != -1)		retval += kprintf(" at");		retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");	retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");	retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");	return retval;}
开发者ID:madhavsuresh,项目名称:DragonFlyBSD,代码行数:16,


示例9: nexus_get_resource

static intnexus_get_resource(device_t dev, device_t child, int type, int rid, u_long *startp, u_long *countp){	struct nexus_device	*ndev = DEVTONX(child);	struct resource_list	*rl = &ndev->nx_resources;	struct resource_list_entry *rle;	rle = resource_list_find(rl, type, rid);	if (!rle)		return(ENOENT);	if (startp)		*startp = rle->start;	if (countp)		*countp = rle->count;	return(0);}
开发者ID:dcui,项目名称:FreeBSD-9.3_kernel,代码行数:16,


示例10: nexus_alloc_resource

/* * Allocate a resource on behalf of child.  NB: child is usually going to be a * child of one of our descendants, not a direct child of nexus0. * (Exceptions include npx.) */static struct resource *nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,		     rman_res_t start, rman_res_t end, rman_res_t count,		     u_int flags){	struct nexus_device *ndev = DEVTONX(child);	struct	resource *rv;	struct resource_list_entry *rle;	struct	rman *rm;	int needactivate = flags & RF_ACTIVE;	/*	 * If this is an allocation of the "default" range for a given	 * RID, and we know what the resources for this device are	 * (ie. they aren't maintained by a child bus), then work out	 * the start/end values.	 */	if ((start == 0UL) && (end == ~0UL) && (count == 1)) {		if (device_get_parent(child) != bus || ndev == NULL)			return(NULL);		rle = resource_list_find(&ndev->nx_resources, type, *rid);		if (rle == NULL)			return(NULL);		start = rle->start;		end = rle->end;		count = rle->count;	}	flags &= ~RF_ACTIVE;	rm = nexus_rman(type);	if (rm == NULL)		return (NULL);	rv = rman_reserve_resource(rm, start, end, count, flags, child);	if (rv == 0)		return 0;	rman_set_rid(rv, *rid);	if (needactivate) {		if (bus_activate_resource(child, type, *rid, rv)) {			rman_release_resource(rv);			return 0;		}	}	return rv;}
开发者ID:outbackdingo,项目名称:uBSD,代码行数:52,


示例11: nexus_print_child

static intnexus_print_child(device_t bus, device_t child){	struct nexus_device *ndev = DEVTONX(child);	struct resource_list *rl = &ndev->nx_resources;	int retval = 0;	retval += bus_print_child_header(bus, child);	retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx");	retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx");	retval += resource_list_print_type(rl, "irq", SYS_RES_IRQ, "%ld");	if (ndev->nx_pcibus != -1)		retval += printf(" pcibus %d", ndev->nx_pcibus);	if (device_get_flags(child))		retval += printf(" flags %#x", device_get_flags(child));	retval += printf(" on motherboard/n");	/* XXX "motherboard", ick */	return (retval);}
开发者ID:DangerDexter,项目名称:FreeBSD-8.0-dyntick,代码行数:19,


示例12: nexus_alloc_resource

/* * Allocate a resource on behalf of child.  NB: child is usually going to be a * child of one of our descendants, not a direct child of nexus0. * (Exceptions include npx.) */static struct resource *nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,    u_long start, u_long end, u_long count, u_int flags, int cpuid){	struct nexus_device *ndev = DEVTONX(child);	struct	resource *rv;	struct resource_list_entry *rle;	struct	rman *rm;	int needactivate = flags & RF_ACTIVE;	/*	 * If this is an allocation of the "default" range for a given RID, and	 * we know what the resources for this device are (ie. they aren't maintained	 * by a child bus), then work out the start/end values.	 */	if ((start == 0UL) && (end == ~0UL) && (count == 1)) {		if (ndev == NULL)			return(NULL);		rle = resource_list_find(&ndev->nx_resources, type, *rid);		if (rle == NULL)			return(NULL);		start = rle->start;		end = rle->end;		count = rle->count;		cpuid = rle->cpuid;	}	flags &= ~RF_ACTIVE;	switch (type) {	case SYS_RES_IRQ:		KASSERT(cpuid >= 0 && cpuid < ncpus,		    ("nexus invalid cpuid %d:/n", cpuid));		rm = &irq_rman[cpuid];		break;	case SYS_RES_DRQ:		rm = &drq_rman;		break;	case SYS_RES_IOPORT:		rm = &port_rman;		break;	case SYS_RES_MEMORY:		rm = &mem_rman;		break;	default:		return 0;	}	rv = rman_reserve_resource(rm, start, end, count, flags, child);	if (rv == 0)		return 0;	rman_set_rid(rv, *rid);	if (type == SYS_RES_MEMORY) {		rman_set_bustag(rv, I386_BUS_SPACE_MEM);	} else if (type == SYS_RES_IOPORT) {		rman_set_bustag(rv, I386_BUS_SPACE_IO);		rman_set_bushandle(rv, rv->r_start);	}	if (needactivate) {		if (bus_activate_resource(child, type, *rid, rv)) {			rman_release_resource(rv);			return 0;		}	}		return rv;}
开发者ID:madhavsuresh,项目名称:DragonFlyBSD,代码行数:78,


示例13: nexus_alloc_resource

/* * Allocate a resource on behalf of child.  NB: child is usually going to be a * child of one of our descendants, not a direct child of nexus0. * (Exceptions include npx.) */static struct resource *nexus_alloc_resource(device_t bus, device_t child, int type, int *rid,		     u_long start, u_long end, u_long count, u_int flags){	struct nexus_device *ndev = DEVTONX(child);	struct	resource *rv;	struct resource_list_entry *rle;	struct	rman *rm;	int needactivate = flags & RF_ACTIVE;	/*	 * If this is an allocation of the "default" range for a given RID, and	 * we know what the resources for this device are (ie. they aren't maintained	 * by a child bus), then work out the start/end values.	 */	if ((start == 0UL) && (end == ~0UL) && (count == 1)) {		if (ndev == NULL)			return(NULL);		rle = resource_list_find(&ndev->nx_resources, type, *rid);		if (rle == NULL)			return(NULL);		start = rle->start;		end = rle->end;		count = rle->count;	}	flags &= ~RF_ACTIVE;	switch (type) {	case SYS_RES_IRQ:		rm = &irq_rman;		break;	case SYS_RES_DRQ:		rm = &drq_rman;		break;	case SYS_RES_IOPORT:		rm = &port_rman;		break;	case SYS_RES_MEMORY:		rm = &mem_rman;		break;	default:		return 0;	}	rv = rman_reserve_resource(rm, start, end, count, flags, child);	if (rv == 0)		return 0;	if (type == SYS_RES_MEMORY) {		rman_set_bustag(rv, I386_BUS_SPACE_MEM);	} else if (type == SYS_RES_IOPORT) {		rman_set_bustag(rv, I386_BUS_SPACE_IO);#ifndef PC98		rman_set_bushandle(rv, rv->r_start);#endif	}#ifdef PC98	if ((type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) &&	    i386_bus_space_handle_alloc(rv->r_bustag, rv->r_start, count,					&rv->r_bushandle) != 0) {		rman_release_resource(rv);		return 0;	}#endif	if (needactivate) {		if (bus_activate_resource(child, type, *rid, rv)) {#ifdef PC98			if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) {				i386_bus_space_handle_free(rv->r_bustag,				    rv->r_bushandle, rv->r_bushandle->bsh_sz);			}#endif			rman_release_resource(rv);			return 0;		}	}		return rv;}
开发者ID:MarginC,项目名称:kame,代码行数:91,



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


C++ DEVWRITE8函数代码示例
C++ DEVPTS_SB函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。