本文整理汇总了C++中HYPERVISOR_sched_op函数的典型用法代码示例。如果您正苦于以下问题:C++ HYPERVISOR_sched_op函数的具体用法?C++ HYPERVISOR_sched_op怎么用?C++ HYPERVISOR_sched_op使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HYPERVISOR_sched_op函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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--;
}
示例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;
}
示例4: privcmd_HYPERVISOR_sched_op
static int
privcmd_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);
}
示例5: xen_reboot
static void xen_reboot(int reason)
{
struct sched_shutdown r = { .reason = reason };
if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r))
BUG();
}
示例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);
}
示例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);
}
示例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);
}
示例9: stub_sched_shutdown
CAMLprim value
stub_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);
}
示例10: __attribute__
void __attribute__ ((noreturn)) grub_reboot (void)
{
for ( ;; )
{
struct sched_shutdown sched_shutdown = { .reason = SHUTDOWN_reboot };
HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown);
}
}
示例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();
}
示例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);
}
示例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);
}
}
示例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();
}
示例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();
}