本文整理汇总了C++中HYPERVISOR_sched_op函数的典型用法代码示例。如果您正苦于以下问题:C++ HYPERVISOR_sched_op函数的具体用法?C++ HYPERVISOR_sched_op怎么用?C++ HYPERVISOR_sched_op使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HYPERVISOR_sched_op函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:kernel.c
示例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,代码来源:x86_traps.c
示例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,代码来源:smp_pv.c
示例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);
}
开发者ID:MatiasNAmendola,项目名称:AuroraUX-SunOS,代码行数:26,代码来源:privcmd_hcall.c
示例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,代码来源:enlighten.c
示例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,代码来源:enlighten.c
示例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,代码来源:enlighten.c
示例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,代码来源:time.c
示例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);
}
开发者ID:gbarnett,项目名称:mirage-platform,代码行数:8,代码来源:sched_stubs.c
示例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,代码来源:mini-os.c
示例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,代码来源:enlighten.c
示例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,代码来源:ling.c
示例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,代码来源:kernel.c
示例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,代码来源:enlighten.c
示例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,代码来源:enlighten.c
示例16: caml_block_domain
CAMLprim value
caml_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,代码来源:main.c
示例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,代码来源:accel_util.c
示例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,代码来源:main.c
示例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,代码来源:x86_traps.c
示例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,代码来源:console.c
注:本文中的HYPERVISOR_sched_op函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论