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

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

51自学网 2021-06-03 10:18:11
  C++
这篇教程C++ xen_pv_domain函数代码示例写得很实用,希望能帮到您。

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

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

示例1: gnttab_setup

static int gnttab_setup(void){	int rc;	unsigned int max_nr_gframes;	max_nr_gframes = gnttab_max_grant_frames();	if (max_nr_gframes < nr_grant_frames)		return -ENOSYS;	if (xen_pv_domain() && xen_feature(XENFEAT_auto_translated_physmap) &&	    !gnttab_shared.addr) {		rc = xlated_setup_gnttab_pages((unsigned long)max_nr_gframes,					       &gnttab_shared.addr);		if (rc != 0)			return rc;	}	if (xen_pv_domain())		return gnttab_map(0, nr_grant_frames - 1);	if (gnttab_shared.addr == NULL) {		gnttab_shared.addr = xen_remap(xen_hvm_resume_frames,						PAGE_SIZE * max_nr_gframes);		if (gnttab_shared.addr == NULL) {			printk(KERN_WARNING					"Failed to ioremap gnttab share frames!");			return -ENOMEM;		}	}	gnttab_map(0, nr_grant_frames - 1);	return 0;}
开发者ID:mbgg,项目名称:linux,代码行数:34,


示例2: xen_hvm_disable_emulated_devices

static voidxen_hvm_disable_emulated_devices(void){	u_short disable_devs = 0;	if (xen_pv_domain()) {		/*		 * No emulated devices in the PV case, so no need to unplug		 * anything.		 */		if (xen_disable_pv_disks != 0 || xen_disable_pv_nics != 0)			printf("PV devices cannot be disabled in PV guests/n");		return;	}	if (inw(XEN_MAGIC_IOPORT) != XMI_MAGIC)		return;	if (xen_disable_pv_disks == 0) {		if (bootverbose)			printf("XEN: disabling emulated disks/n");		disable_devs |= XMI_UNPLUG_IDE_DISKS;	}	if (xen_disable_pv_nics == 0) {		if (bootverbose)			printf("XEN: disabling emulated nics/n");		disable_devs |= XMI_UNPLUG_NICS;	}	if (disable_devs != 0)		outw(XEN_MAGIC_IOPORT, disable_devs);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:32,


示例3: xen_hvm_init_shared_info_page

static voidxen_hvm_init_shared_info_page(void){	struct xen_add_to_physmap xatp;	if (xen_pv_domain()) {		/*		 * Already setup in the PV case, shared_info is passed inside		 * of the start_info struct at start of day.		 */		return;	}	if (HYPERVISOR_shared_info == NULL) {		HYPERVISOR_shared_info = malloc(PAGE_SIZE, M_XENHVM, M_NOWAIT);		if (HYPERVISOR_shared_info == NULL)			panic("Unable to allocate Xen shared info page");	}	xatp.domid = DOMID_SELF;	xatp.idx = 0;	xatp.space = XENMAPSPACE_shared_info;	xatp.gpfn = vtophys(HYPERVISOR_shared_info) >> PAGE_SHIFT;	if (HYPERVISOR_memory_op(XENMEM_add_to_physmap, &xatp))		panic("HYPERVISOR_memory_op failed");}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:26,


示例4: xen_hvm_guest_init

static void __init xen_hvm_guest_init(void){	if (xen_pv_domain())		return;	init_hvm_pv_info();	xen_hvm_init_shared_info();	xen_panic_handler_init();	if (xen_feature(XENFEAT_hvm_callback_vector))		xen_have_vector_callback = 1;	xen_hvm_smp_init();	WARN_ON(xen_cpuhp_setup(xen_cpu_up_prepare_hvm, xen_cpu_dead_hvm));	xen_unplug_emulated_devices();	x86_init.irqs.intr_init = xen_init_IRQ;	xen_hvm_init_time_ops();	xen_hvm_init_mmu_ops();	if (xen_pvh_domain())		machine_ops.emergency_restart = xen_emergency_restart;#ifdef CONFIG_KEXEC_CORE	machine_ops.shutdown = xen_hvm_shutdown;	machine_ops.crash_shutdown = xen_hvm_crash_shutdown;#endif}
开发者ID:asmalldev,项目名称:linux,代码行数:28,


示例5: pci_xen_swiotlb_detect

/* * pci_xen_swiotlb_detect - set xen_swiotlb to 1 if necessary * * This returns non-zero if we are forced to use xen_swiotlb (by the boot * option). */int __init pci_xen_swiotlb_detect(void){	if (!xen_pv_domain())		return 0;	/* If running as PV guest, either iommu=soft, or swiotlb=force will	 * activate this IOMMU. If running as PV privileged, activate it	 * irregardless.	 */	if ((xen_initial_domain() || swiotlb || swiotlb_force))		xen_swiotlb = 1;	/* If we are running under Xen, we MUST disable the native SWIOTLB.	 * Don't worry about swiotlb_force flag activating the native, as	 * the 'swiotlb' flag is the only one turning it on. */	swiotlb = 0;#ifdef CONFIG_X86_64	/* pci_swiotlb_detect_4gb turns on native SWIOTLB if no_iommu == 0	 * (so no iommu=X command line over-writes).	 * Considering that PV guests do not want the *native SWIOTLB* but	 * only Xen SWIOTLB it is not useful to us so set no_iommu=1 here.	 */	if (max_pfn > MAX_DMA32_PFN)		no_iommu = 1;#endif	return xen_swiotlb;}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:35,


示例6: gnttab_resume

int gnttab_resume(void){	unsigned int max_nr_gframes;	max_nr_gframes = gnttab_max_grant_frames();	if (max_nr_gframes < nr_grant_frames)		return -ENOSYS;	if (xen_pv_domain())		return gnttab_map(0, nr_grant_frames - 1);	if (!shared) {		shared = ioremap(xen_hvm_resume_frames, PAGE_SIZE * max_nr_gframes);		if (shared == NULL) {#ifdef CONFIG_DEBUG_PRINTK			printk(KERN_WARNING					"Failed to ioremap gnttab share frames!");#else			;#endif			return -ENOMEM;		}	}	gnttab_map(0, nr_grant_frames - 1);	return 0;}
开发者ID:nos1609,项目名称:Chrono_Kernel-1,代码行数:28,


示例7: xen_has_pv_devices

bool xen_has_pv_devices(void){	if (!xen_domain())		return false;	/* PV domains always have them. */	if (xen_pv_domain())		return true;	/* And user has xen_platform_pci=0 set in guest config as	 * driver did not modify the value. */	if (xen_platform_pci_unplug == 0)		return false;	if (xen_platform_pci_unplug & XEN_UNPLUG_NEVER)		return false;	if (xen_platform_pci_unplug & XEN_UNPLUG_ALL)		return true;	/* This is an odd one - we are going to run legacy	 * and PV drivers at the same time. */	if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY)		return true;	/* And the caller has to follow with xen_pv_{disk,nic}_devices	 * to be certain which driver can load. */	return false;}
开发者ID:AK101111,项目名称:linux,代码行数:29,


示例8: setup_cpu_watcher

static int setup_cpu_watcher(struct notifier_block *notifier,			      unsigned long event, void *data){	int cpu;	static struct xenbus_watch cpu_watch = {		.node = "cpu",		.callback = handle_vcpu_hotplug_event};	(void)register_xenbus_watch(&cpu_watch);	for_each_possible_cpu(cpu) {		if (vcpu_online(cpu) == 0) {			(void)cpu_down(cpu);			set_cpu_present(cpu, false);		}	}	return NOTIFY_DONE;}static int __init setup_vcpu_hotplug_event(void){	static struct notifier_block xsn_cpu = {		.notifier_call = setup_cpu_watcher };	if (!xen_pv_domain())		return -ENODEV;	register_xenstore_notifier(&xsn_cpu);	return 0;}arch_initcall(setup_vcpu_hotplug_event);
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:34,


示例9: gnttab_resume

int gnttab_resume(void){	unsigned int max_nr_gframes;	gnttab_request_version();	max_nr_gframes = gnttab_max_grant_frames();	if (max_nr_gframes < nr_grant_frames)		return -ENOSYS;	if (xen_pv_domain())		return gnttab_map(0, nr_grant_frames - 1);	if (gnttab_shared.addr == NULL) {		gnttab_shared.addr = ioremap(xen_hvm_resume_frames,						PAGE_SIZE * max_nr_gframes);		if (gnttab_shared.addr == NULL) {			printk(KERN_WARNING					"Failed to ioremap gnttab share frames!");			return -ENOMEM;		}	}	gnttab_map(0, nr_grant_frames - 1);	return 0;}
开发者ID:ARMWorks,项目名称:FA_2451_Linux_Kernel,代码行数:26,


示例10: xen_platform_hvm

static uint32_t __init xen_platform_hvm(void){	if (xen_pv_domain() || xen_nopv)		return 0;	return xen_cpuid_base();}
开发者ID:asmalldev,项目名称:linux,代码行数:7,


示例11: xen_register_gsi

static int xen_register_gsi(u32 gsi, int gsi_override, int triggering, int polarity){	int rc, irq;	struct physdev_setup_gsi setup_gsi;	if (!xen_pv_domain())		return -1;	printk(KERN_DEBUG "xen: registering gsi %u triggering %d polarity %d/n",			gsi, triggering, polarity);	irq = xen_register_pirq(gsi, gsi_override, triggering, true);	setup_gsi.gsi = gsi;	setup_gsi.triggering = (triggering == ACPI_EDGE_SENSITIVE ? 0 : 1);	setup_gsi.polarity = (polarity == ACPI_ACTIVE_HIGH ? 0 : 1);	rc = HYPERVISOR_physdev_op(PHYSDEVOP_setup_gsi, &setup_gsi);	if (rc == -EEXIST)		printk(KERN_INFO "Already setup the GSI :%d/n", gsi);	else if (rc) {		printk(KERN_ERR "Failed to setup GSI :%d, err_code:%d/n",				gsi, rc);	}	return irq;}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:27,


示例12: xen_apic_probe_pv

static int xen_apic_probe_pv(void){	if (xen_pv_domain())		return 1;	return 0;}
开发者ID:gvsurenderreddy,项目名称:linux-1,代码行数:7,


示例13: xen_arch_post_suspend

void xen_arch_post_suspend(int cancelled){    if (xen_pv_domain())        xen_pv_post_suspend(cancelled);    else        xen_hvm_post_suspend(cancelled);}
开发者ID:Abhi1919,项目名称:ath,代码行数:7,


示例14: xen_hvc_init

static int __init xen_hvc_init(void){	struct hvc_struct *hp;	struct hv_ops *ops;	if (!xen_pv_domain())		return -ENODEV;	if (xen_initial_domain()) {		ops = &dom0_hvc_ops;		xencons_irq = bind_virq_to_irq(VIRQ_CONSOLE, 0);	} else {		if (!xen_start_info->console.domU.evtchn)			return -ENODEV;		ops = &domU_hvc_ops;		xencons_irq = bind_evtchn_to_irq(xen_start_info->console.domU.evtchn);	}	if (xencons_irq < 0)		xencons_irq = 0; /* NO_IRQ */	else		irq_set_noprobe(xencons_irq);	hp = hvc_alloc(HVC_COOKIE, xencons_irq, ops, 256);	if (IS_ERR(hp))		return PTR_ERR(hp);	hvc = hp;	console_pfn = mfn_to_pfn(xen_start_info->console.domU.mfn);	return 0;}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:33,


示例15: arch_gnttab_init

int arch_gnttab_init(unsigned long nr_shared){	if (!xen_pv_domain())		return 0;	return arch_gnttab_valloc(&gnttab_shared_vm_area, nr_shared);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:7,


示例16: setup_cpu_watcher

static int setup_cpu_watcher(struct notifier_block *notifier,			      unsigned long event, void *data){	static struct xenbus_watch cpu_watch = {		.node = "cpu",		.callback = handle_vcpu_hotplug_event};	(void)register_xenbus_watch(&cpu_watch);	return NOTIFY_DONE;}static int __init setup_vcpu_hotplug_event(void){	static struct notifier_block xsn_cpu = {		.notifier_call = setup_cpu_watcher };	if (!xen_pv_domain())		return -ENODEV;	register_xenstore_notifier(&xsn_cpu);	return 0;}arch_initcall(setup_vcpu_hotplug_event);
开发者ID:mpalmer,项目名称:linux-2.6,代码行数:26,


示例17: xen_cons_init

static int xen_cons_init(void){	if (!xen_pv_domain())		return 0;	hvc_instantiate(HVC_COOKIE, 0, &hvc_ops);	return 0;}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:8,


示例18: xen_cpu_die

static void xen_cpu_die(unsigned int cpu){	while (xen_pv_domain() && HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL)) {		current->state = TASK_UNINTERRUPTIBLE;		schedule_timeout(HZ/10);	}	unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL);	unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);	unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);	unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);	xen_uninit_lock_cpu(cpu);	if (xen_pv_domain())		xen_teardown_timer(cpu);	if (num_online_cpus() == 1)		alternatives_smp_switch(0);}
开发者ID:ziozzang,项目名称:rhel6-kernel-src,代码行数:17,


示例19: acpi_get_sysname

const char __init *acpi_get_sysname(void){	unsigned long rsdp_phys;	struct acpi_table_rsdp *rsdp;	struct acpi_table_xsdt *xsdt;	struct acpi_table_header *hdr;#ifdef CONFIG_INTEL_IOMMU	u64 i, nentries;#endif	rsdp_phys = acpi_find_rsdp();	if (!rsdp_phys) {		printk(KERN_ERR		       "ACPI 2.0 RSDP not found, default to /"dig/"/n");		return "dig";	}	rsdp = (struct acpi_table_rsdp *)__va(rsdp_phys);	if (strncmp(rsdp->signature, ACPI_SIG_RSDP, sizeof(ACPI_SIG_RSDP) - 1)) {		printk(KERN_ERR		       "ACPI 2.0 RSDP signature incorrect, default to /"dig/"/n");		return "dig";	}	xsdt = (struct acpi_table_xsdt *)__va(rsdp->xsdt_physical_address);	hdr = &xsdt->header;	if (strncmp(hdr->signature, ACPI_SIG_XSDT, sizeof(ACPI_SIG_XSDT) - 1)) {		printk(KERN_ERR		       "ACPI 2.0 XSDT signature incorrect, default to /"dig/"/n");		return "dig";	}	if (!strcmp(hdr->oem_id, "HP")) {		return "hpzx1";	} else if (!strcmp(hdr->oem_id, "SGI")) {		if (!strcmp(hdr->oem_table_id + 4, "UV"))			return "uv";		else			return "sn2";	} else if (xen_pv_domain() && !strcmp(hdr->oem_id, "XEN")) {		return "xen";	}#ifdef CONFIG_INTEL_IOMMU	/* Look for Intel IOMMU */	nentries = (hdr->length - sizeof(*hdr)) /			 sizeof(xsdt->table_offset_entry[0]);	for (i = 0; i < nentries; i++) {		hdr = __va(xsdt->table_offset_entry[i]);		if (strncmp(hdr->signature, ACPI_SIG_DMAR,			sizeof(ACPI_SIG_DMAR) - 1) == 0)			return "dig_vtd";	}#endif	return "dig";}
开发者ID:Backspace-Dev,项目名称:Blackout-Monarudo,代码行数:58,


示例20: xc_cnprobe

static voidxc_cnprobe(struct consdev *cp){	if (!xen_pv_domain())		return;	cp->cn_pri = CN_REMOTE;	sprintf(cp->cn_name, "%s0", driver_name);}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:9,


示例21: nexus_xen_probe

/* * Xen nexus(4) driver. */static intnexus_xen_probe(device_t dev){	if (!xen_pv_domain())		return (ENXIO);	return (BUS_PROBE_SPECIFIC);}
开发者ID:FreeBSDFoundation,项目名称:freebsd,代码行数:12,


示例22: pci_xen_swiotlb_detect

/* * pci_xen_swiotlb_detect - set xen_swiotlb to 1 if necessary * * This returns non-zero if we are forced to use xen_swiotlb (by the boot * option). */int __init pci_xen_swiotlb_detect(void){	/* If running as PV guest, either iommu=soft, or swiotlb=force will	 * activate this IOMMU. If running as PV privileged, activate it	 * irregardlesss.	 */	if ((xen_initial_domain() || swiotlb || swiotlb_force) &&	    (xen_pv_domain()))		xen_swiotlb = 1;	/* If we are running under Xen, we MUST disable the native SWIOTLB.	 * Don't worry about swiotlb_force flag activating the native, as	 * the 'swiotlb' flag is the only one turning it on. */	if (xen_pv_domain())		swiotlb = 0;	return xen_swiotlb;}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:25,


示例23: xenkbd_init

static int __init xenkbd_init(void){	if (!xen_pv_domain())		return -ENODEV;	/* Nothing to do if running in dom0. */	if (xen_initial_domain())		return -ENODEV;	return xenbus_register_frontend(&xenkbd_driver);}
开发者ID:1703011,项目名称:asuswrt-merlin,代码行数:11,


示例24: __gnttab_init

static int __gnttab_init(void){	/* Delay grant-table initialization in the PV on HVM case */	if (xen_hvm_domain())		return 0;	if (!xen_pv_domain())		return -ENODEV;	return gnttab_init();}
开发者ID:DenisLug,项目名称:mptcp,代码行数:11,


示例25: xen_pci_probe

static intxen_pci_probe(device_t dev){	if (!xen_pv_domain())		return (ENXIO);	device_set_desc(dev, "Xen PCI bus");	return (BUS_PROBE_DEFAULT);}
开发者ID:2asoft,项目名称:freebsd,代码行数:11,


示例26: xen_hvm_need_lapic

bool xen_hvm_need_lapic(void){	if (xen_nopv)		return false;	if (xen_pv_domain())		return false;	if (!xen_hvm_domain())		return false;	if (xen_feature(XENFEAT_hvm_pirqs) && xen_have_vector_callback)		return false;	return true;}
开发者ID:asmalldev,项目名称:linux,代码行数:12,


示例27: xc_identify

static voidxc_identify(driver_t *driver, device_t parent){	device_t child;	if (!xen_pv_domain())		return;	child = BUS_ADD_CHILD(parent, 0, driver_name, 0);	device_set_driver(child, driver);	device_set_desc(child, "Xen Console");}
开发者ID:Alkzndr,项目名称:freebsd,代码行数:12,


示例28: xen_has_pv_and_legacy_disk_devices

/* * This one is odd - it determines whether you want to run PV _and_ * legacy (IDE) drivers together. This combination is only possible * under HVM. */bool xen_has_pv_and_legacy_disk_devices(void){	if (!xen_domain())		return false;	/* N.B. This is only ever used in HVM mode */	if (xen_pv_domain())		return false;	if (xen_platform_pci_unplug & XEN_UNPLUG_UNNECESSARY)		return true;	return false;}
开发者ID:AK101111,项目名称:linux,代码行数:19,


示例29: xen_cons_init

static int xen_cons_init(void){	struct hv_ops *ops;	if (!xen_pv_domain())		return 0;	if (xen_initial_domain())		ops = &dom0_hvc_ops;	else		ops = &domU_hvc_ops;	hvc_instantiate(HVC_COOKIE, 0, ops);	return 0;}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:15,


示例30: xen_cpu_die

static void xen_cpu_die(unsigned int cpu){	while (xen_pv_domain() && HYPERVISOR_vcpu_op(VCPUOP_is_up, cpu, NULL)) {		current->state = TASK_UNINTERRUPTIBLE;		schedule_timeout(HZ/10);	}	unbind_from_irqhandler(per_cpu(xen_resched_irq, cpu), NULL);	unbind_from_irqhandler(per_cpu(xen_callfunc_irq, cpu), NULL);	unbind_from_irqhandler(per_cpu(xen_debug_irq, cpu), NULL);	unbind_from_irqhandler(per_cpu(xen_callfuncsingle_irq, cpu), NULL);	if (!xen_hvm_domain())		unbind_from_irqhandler(per_cpu(xen_irq_work, cpu), NULL);	xen_uninit_lock_cpu(cpu);	xen_teardown_timer(cpu);}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:15,



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


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