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

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

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

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

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

示例1: minios_do_halt

void minios_do_halt(int reason){    minios_printk("minios: halting, reason=%d/n", reason);    for( ;; )    {        struct sched_shutdown sched_shutdown = {            .reason = (reason == MINIOS_HALT_POWEROFF) ?                SHUTDOWN_poweroff : SHUTDOWN_crash };        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    }}/* * do_exit: This is called whenever an IRET fails in entry.S. * This will generally be because an application has got itself into * a really bad state (probably a bad CS or SS). It must be killed. * Of course, minimal OS doesn't have applications :-) */void minios_do_exit(void){    minios_printk("Do_exit called!/n");    stack_walk();    for( ;; )    {        struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    }}
开发者ID:gandro,项目名称:rumprun,代码行数:29,


示例2: do_page_fault

void do_page_fault(struct pt_regs *regs, unsigned long error_code){    unsigned long addr = read_cr2();    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };    if ((error_code & TRAP_PF_WRITE) && handle_cow(addr))	return;    /* If we are already handling a page fault, and got another one       that means we faulted in pagetable walk. Continuing here would cause       a recursive fault */           if(handling_pg_fault == 1)     {        printk("Page fault in pagetable walk (access to invalid memory?)./n");         HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    }    handling_pg_fault++;    barrier();    printk("Page fault at linear address %p, rip %p, regs %p, sp %p, our_sp %p, code %lx/n",           addr, regs->rip, regs, regs->rsp, &addr, error_code);    dump_regs(regs);    //do_stack_walk(regs->rbp);    dump_mem(regs->rsp);    dump_mem(regs->rbp);    dump_mem(regs->rip);    page_walk(addr);    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    /* We should never get here ... but still */    handling_pg_fault--;}
开发者ID:d5nguyenvan,项目名称:mirage,代码行数:32,


示例3: xen_pv_cpu_up

static int xen_pv_cpu_up(unsigned int cpu, struct task_struct *idle){	int rc;	common_cpu_up(cpu, idle);	xen_setup_runstate_info(cpu);	/*	 * PV VCPUs are always successfully taken down (see 'while' loop	 * in xen_cpu_die()), so -EBUSY is an error.	 */	rc = cpu_check_up_prepare(cpu);	if (rc)		return rc;	/* make sure interrupts start blocked */	per_cpu(xen_vcpu, cpu)->evtchn_upcall_mask = 1;	rc = cpu_initialize_context(cpu, idle);	if (rc)		return rc;	xen_pmu_init(cpu);	rc = HYPERVISOR_vcpu_op(VCPUOP_up, xen_vcpu_nr(cpu), NULL);	BUG_ON(rc);	while (cpu_report_state(cpu) != CPU_ONLINE)		HYPERVISOR_sched_op(SCHEDOP_yield, NULL);	return 0;}
开发者ID:EMCAntimatter,项目名称:linux,代码行数:33,


示例4: privcmd_HYPERVISOR_sched_op

static intprivcmd_HYPERVISOR_sched_op(int cmd, void *arg){	int error;	int size = 0;	import_export_t op_ie;	struct sched_remote_shutdown op;	switch (cmd) {	case SCHEDOP_remote_shutdown:		size = sizeof (struct sched_remote_shutdown);		break;	default:#ifdef DEBUG		printf("unrecognized sched op 0x%x/n", cmd);#endif		return (-X_EINVAL);	}	error = import_buffer(&op_ie, arg, &op, size, IE_IMPORT);	if (error == 0)		error = HYPERVISOR_sched_op(cmd, (arg == NULL) ? NULL : &op);	export_buffer(&op_ie, &error);	return (error);}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:26,


示例5: xen_reboot

static void xen_reboot(int reason){	struct sched_shutdown r = { .reason = reason };	if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))		BUG();}
开发者ID:PivotalBigData,项目名称:PivotalHD,代码行数:7,


示例6: xen_restart

static void xen_restart(enum reboot_mode reboot_mode, const char *cmd){	struct sched_shutdown r = { .reason = SHUTDOWN_reboot };	int rc;	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);	BUG_ON(rc);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:7,


示例7: xen_power_off

static void xen_power_off(void){	struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };	int rc;	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);	BUG_ON(rc);}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:7,


示例8: block_domain

void block_domain(u32 millisecs){    struct timeval tv;    gettimeofday(&tv);    HYPERVISOR_set_timer_op(monotonic_clock() + 1000000LL * (s64) millisecs);    HYPERVISOR_sched_op(SCHEDOP_block, 0);}
开发者ID:andreiw,项目名称:xen3-arm-tegra,代码行数:7,


示例9: stub_sched_shutdown

CAMLprim valuestub_sched_shutdown(value v_reason){    CAMLparam1(v_reason);    struct sched_shutdown sched_shutdown = { .reason = reasons[Int_val(v_reason)] };    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    CAMLreturn(Val_unit);}
开发者ID:gbarnett,项目名称:mirage-platform,代码行数:8,


示例10: __attribute__

void __attribute__ ((noreturn)) grub_reboot (void){    for ( ;; )    {        struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_reboot };        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    }}
开发者ID:codercold,项目名称:xen-4.4,代码行数:8,


示例11: xen_restart

static void xen_restart(char str, const char *cmd){	struct sched_shutdown r = { .reason = SHUTDOWN_reboot };	int rc;	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);	if (rc)		BUG();}
开发者ID:1n00bB,项目名称:android_kernel_lenovo_a6010,代码行数:8,


示例12: domain_poweroff

void domain_poweroff(void){	printk("/nBye/n");	console_done();	// flushes and restores terminal mode	struct sched_shutdown op;	op.reason = SHUTDOWN_poweroff;	HYPERVISOR_sched_op(SCHEDOP_shutdown, &op);}
开发者ID:DavidAlphaFox,项目名称:ling,代码行数:9,


示例13: do_exit

void do_exit(void){    printk("Do_exit called!/n");    arch_do_exit();    for( ;; )    {        struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    }}
开发者ID:unigornel,项目名称:minios,代码行数:10,


示例14: xen_reboot

static void xen_reboot(int reason){	struct sched_shutdown r = { .reason = reason };#ifdef CONFIG_SMP	smp_send_stop();#endif	if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))		BUG();}
开发者ID:argentinos,项目名称:o2droid,代码行数:11,


示例15: xen_reboot

void xen_reboot(int reason){	struct sched_shutdown r = { .reason = reason };	int cpu;	for_each_online_cpu(cpu)		xen_pmu_finish(cpu);	if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))		BUG();}
开发者ID:asmalldev,项目名称:linux,代码行数:11,


示例16: caml_block_domain

CAMLprim valuecaml_block_domain(value v_timeout){  CAMLparam1(v_timeout);  block_secs = (s_time_t)(Double_val(v_timeout) * 1000000000);  set_xen_guest_handle(sched_poll.ports, ports);  sched_poll.nr_ports = sizeof(ports) / sizeof(evtchn_port_t);  sched_poll.timeout = NOW() + block_secs;  HYPERVISOR_sched_op(SCHEDOP_poll, &sched_poll);  CAMLreturn(Val_unit);}
开发者ID:crotsos,项目名称:mirage,代码行数:11,


示例17: net_accel_shutdown_remote

/* Shutdown remote domain that is misbehaving */int net_accel_shutdown_remote(int domain){    struct sched_remote_shutdown sched_shutdown = {        .domain_id = domain,        .reason = SHUTDOWN_crash    };    EPRINTK("Crashing domain %d/n", domain);    return HYPERVISOR_sched_op(SCHEDOP_remote_shutdown, &sched_shutdown);}
开发者ID:AsadRaza,项目名称:OCTEON-Linux,代码行数:12,


示例18: _exit

void _exit(int ret){  printk("main returned %d/n", ret);  stop_kernel();  if (!ret) {    /* No problem, just shutdown.  */    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);  }  do_exit();}
开发者ID:gbarnett,项目名称:mirage-platform,代码行数:11,


示例19: do_general_protection

void do_general_protection(struct pt_regs *regs, long error_code){    struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_crash };    printk("GPF rip: %p, error_code=%lx/n", regs->rip, error_code);    dump_regs(regs);    //do_stack_walk(regs->rbp);    dump_mem(regs->rsp);    dump_mem(regs->rbp);    dump_mem(regs->rip);    HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);}
开发者ID:d5nguyenvan,项目名称:mirage,代码行数:11,


示例20: console_done

void console_done(void){	// (attempt to) restore the terminal mode	char modes[] = "/x1b[4l";	console_write(modes, sizeof(modes) -1);	while (console.intf->out_cons < console.intf->out_prod)	{		HYPERVISOR_sched_op(SCHEDOP_yield, 0);		mb();	}}
开发者ID:MCRedJay,项目名称:ling,代码行数:12,


示例21: xen_smp_call_function_mask

int xen_smp_call_function_mask(cpumask_t mask, void (*func)(void *),			       void *info, int wait){	struct call_data_struct data;	int cpus, cpu;	bool yield;	/* Holding any lock stops cpus from going down. */	spin_lock(&call_lock);	cpu_clear(smp_processor_id(), mask);	cpus = cpus_weight(mask);	if (!cpus) {		spin_unlock(&call_lock);		return 0;	}	/* Can deadlock when called with interrupts disabled */	WARN_ON(irqs_disabled());	data.func = func;	data.info = info;	atomic_set(&data.started, 0);	data.wait = wait;	if (wait)		atomic_set(&data.finished, 0);	call_data = &data;	mb();			/* write everything before IPI */	/* Send a message to other CPUs and wait for them to respond */	xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR);	/* Make sure other vcpus get a chance to run if they need to. */	yield = false;	for_each_cpu_mask(cpu, mask)		if (xen_vcpu_stolen(cpu))			yield = true;	if (yield)		HYPERVISOR_sched_op(SCHEDOP_yield, 0);	/* Wait for response */	while (atomic_read(&data.started) != cpus ||	       (wait && atomic_read(&data.finished) != cpus))		cpu_relax();	spin_unlock(&call_lock);	return 0;}
开发者ID:mobilipia,项目名称:iods,代码行数:52,


示例22: xen_cpu_up

static int __cpuinit xen_cpu_up(unsigned int cpu){	struct task_struct *idle = idle_task(cpu);	int rc;#ifdef CONFIG_X86_64	/* Allocate node local memory for AP pdas */	WARN_ON(cpu == 0);	if (cpu > 0) {		rc = get_local_pda(cpu);		if (rc)			return rc;	}#endif#ifdef CONFIG_X86_32	init_gdt(cpu);	per_cpu(current_task, cpu) = idle;	irq_ctx_init(cpu);#else	cpu_pda(cpu)->pcurrent = idle;	clear_tsk_thread_flag(idle, TIF_FORK);#endif	xen_setup_timer(cpu);	xen_init_lock_cpu(cpu);	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;	/* make sure interrupts start blocked */	per_cpu(xen_vcpu, cpu)->evtchn_upcall_mask = 1;	rc = cpu_initialize_context(cpu, idle);	if (rc)		return rc;	if (num_online_cpus() == 1)		alternatives_smp_switch(1);	rc = xen_smp_intr_init(cpu);	if (rc)		return rc;	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);	BUG_ON(rc);	while(per_cpu(cpu_state, cpu) != CPU_ONLINE) {		HYPERVISOR_sched_op(SCHEDOP_yield, 0);		barrier();	}	return 0;}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:52,


示例23: xen_smp_send_call_function_ipi

static void xen_smp_send_call_function_ipi(cpumask_t mask){	int cpu;	xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR);	/* Make sure other vcpus get a chance to run if they need to. */	for_each_cpu_mask_nr(cpu, mask) {		if (xen_vcpu_stolen(cpu)) {			HYPERVISOR_sched_op(SCHEDOP_yield, 0);			break;		}	}}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:14,


示例24: xen_smp_send_call_function_ipi

static void xen_smp_send_call_function_ipi(const struct cpumask *mask){	int cpu;	xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR);		for_each_cpu(cpu, mask) {		if (xen_vcpu_stolen(cpu)) {			HYPERVISOR_sched_op(SCHEDOP_yield, NULL);			break;		}	}}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:14,


示例25: xen_cpu_up

static int __cpuinit xen_cpu_up(unsigned int cpu){	struct task_struct *idle = idle_task(cpu);	int rc;	per_cpu(current_task, cpu) = idle;#ifdef CONFIG_X86_32	irq_ctx_init(cpu);#else	clear_tsk_thread_flag(idle, TIF_FORK);	per_cpu(kernel_stack, cpu) =		(unsigned long)task_stack_page(idle) -		KERNEL_STACK_OFFSET + THREAD_SIZE;	per_cpu(kernel_stack8k, cpu) =		(unsigned long)task_stack_page(idle) -		KERNEL_STACK_OFFSET + THREAD_SIZE - 8192;#endif	xen_setup_runstate_info(cpu);	xen_setup_timer(cpu);	xen_init_lock_cpu(cpu);	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;	/* make sure interrupts start blocked */	per_cpu(xen_vcpu, cpu)->evtchn_upcall_mask = 1;	rc = cpu_initialize_context(cpu, idle);	if (rc)		return rc;	if (num_online_cpus() == 1)		alternatives_smp_switch(1);	rc = xen_smp_intr_init(cpu);	if (rc)		return rc;	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);	BUG_ON(rc);	while(per_cpu(cpu_state, cpu) != CPU_ONLINE) {		HYPERVISOR_sched_op(SCHEDOP_yield, NULL);		barrier();	}	return 0;}
开发者ID:seyko2,项目名称:openvz_rhel6_kernel_mirror,代码行数:47,


示例26: caml_block_domain

CAMLprim valuecaml_block_domain(value v_timeout){  CAMLparam1(v_timeout);  s_time_t block_nsecs = (s_time_t)(Double_val(v_timeout) * 1000000000);  HYPERVISOR_set_timer_op(NOW() + block_nsecs);  /* xen/common/schedule.c:do_block clears evtchn_upcall_mask     to re-enable interrupts. It blocks the domain and immediately     checks for pending events which otherwise may be missed. */  HYPERVISOR_sched_op(SCHEDOP_block, 0);  /* set evtchn_upcall_mask: there's no need to be interrupted     when we know we have outstanding work to do. When we next     call this function, the call to SCHEDOP_block will check     for pending events. */  local_irq_disable();  CAMLreturn(Val_unit);}
开发者ID:gbarnett,项目名称:mirage-platform,代码行数:17,


示例27: xen_cpu_up

static int __cpuinit xen_cpu_up(unsigned int cpu, struct task_struct *idle){	int rc;	per_cpu(current_task, cpu) = idle;	per_cpu(current_tinfo, cpu) = &idle->tinfo;#ifdef CONFIG_X86_32	irq_ctx_init(cpu);#else	clear_tsk_thread_flag(idle, TIF_FORK);	per_cpu(kernel_stack, cpu) = (unsigned long)task_stack_page(idle) - 16 + THREAD_SIZE;#endif	xen_setup_runstate_info(cpu);	xen_setup_timer(cpu);	xen_init_lock_cpu(cpu);	per_cpu(cpu_state, cpu) = CPU_UP_PREPARE;	/* make sure interrupts start blocked */	per_cpu(xen_vcpu, cpu)->evtchn_upcall_mask = 1;	rc = cpu_initialize_context(cpu, idle);	if (rc)		return rc;	if (num_online_cpus() == 1)		/* Just in case we booted with a single CPU. */		alternatives_enable_smp();	rc = xen_smp_intr_init(cpu);	if (rc)		return rc;	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);	BUG_ON(rc);	while(per_cpu(cpu_state, cpu) != CPU_ONLINE) {		HYPERVISOR_sched_op(SCHEDOP_yield, NULL);		barrier();	}	return 0;}
开发者ID:garyvan,项目名称:openwrt-1.6,代码行数:43,


示例28: _exit

void _exit(int ret){    int i;    for (i = 0; __DTOR_LIST__[i] != 0; i++)        ((void((*)(void)))__DTOR_LIST__[i]) ();    close_all_files();    __libc_fini_array();    printk("main returned %d/n", ret);#if defined(HAVE_LWIP) && defined(CONFIG_NETFRONT)    stop_networking();#endif    stop_kernel();    if (!ret) {	/* No problem, just shutdown.  */        struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_poweroff };        HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);    }    do_exit();}
开发者ID:farewellkou,项目名称:xen,代码行数:20,


示例29: fatal_error

void fatal_error(const char *fmt, ...){	char buffer[BUFSIZ];	va_list ap;	va_start(ap, fmt);	vsnprintf(buffer, sizeof(buffer), fmt, ap);	va_end(ap);			printk("*** CRASH: %s/r/n", buffer);	while (1)	{#ifdef LING_DEBUG		// Provide for attaching the debugger to examine the crash		gdb_break();#endif		HYPERVISOR_sched_op(SCHEDOP_yield, 0);	}}
开发者ID:DavidAlphaFox,项目名称:ling,代码行数:21,


示例30: start_kernel

/* Main kernel entry point, called by trampoline */void start_kernel(start_info_t * start_info){	/* Map the shared info page */	HYPERVISOR_update_va_mapping((unsigned long) &shared_info, 			__pte(start_info->shared_info | 7),			UVMF_INVLPG);	/* Set the pointer used in the bootstrap for reenabling	 * event delivery after an upcall */	HYPERVISOR_shared_info = &shared_info;	/* Set up and unmask events */	init_events();	/* Initialise the console */	console_init(start_info);	/* Write a message to check that it worked */	console_write("Hello world!/r/n");	/* Loop, handling events */	while(1)	{		HYPERVISOR_sched_op(SCHEDOP_block,0);	}}
开发者ID:AnilVarmaBiruduraju,项目名称:xen-examples,代码行数:22,



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


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