本文整理汇总了C++中HYPERVISOR_set_trap_table函数的典型用法代码示例。如果您正苦于以下问题:C++ HYPERVISOR_set_trap_table函数的具体用法?C++ HYPERVISOR_set_trap_table怎么用?C++ HYPERVISOR_set_trap_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HYPERVISOR_set_trap_table函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xen_write_idt_entry
/* Set an IDT entry. If the entry is part of the current IDT, then
also update Xen. */
static void xen_write_idt_entry(gate_desc *dt, int entrynum, const gate_desc *g)
{
unsigned long p = (unsigned long)&dt[entrynum];
unsigned long start, end;
preempt_disable();
start = __get_cpu_var(idt_desc).address;
end = start + __get_cpu_var(idt_desc).size + 1;
xen_mc_flush();
native_write_idt_entry(dt, entrynum, g);
if (p >= start && (p + 8) <= end) {
struct trap_info info[2];
info[1].address = 0;
if (cvt_gate_to_trap(entrynum, g, &info[0]))
if (HYPERVISOR_set_trap_table(info))
BUG();
}
preempt_enable();
}
示例2: xen_set_trap_table
long
xen_set_trap_table(trap_info_t *table)
{
long err;
if ((err = HYPERVISOR_set_trap_table(table)) != 0) {
/*
* X_EFAULT: bad address
* X_EPERM: bad selector
*/
panic("xen_set_trap_table(%p): error %d", (void *)table,
-(int)err);
}
return (err);
}
示例3: array
/* Load a new IDT into Xen. In principle this can be per-CPU, so we
hold a spinlock to protect the static traps[] array (static because
it avoids allocation, and saves stack space). */
static void xen_load_idt(const struct desc_ptr *desc)
{
static DEFINE_SPINLOCK(lock);
static struct trap_info traps[257];
spin_lock(&lock);
__get_cpu_var(idt_desc) = *desc;
xen_convert_trap_info(desc, traps);
xen_mc_flush();
if (HYPERVISOR_set_trap_table(traps))
BUG();
spin_unlock(&lock);
}
示例4: trap_fini
void trap_fini(void)
{
HYPERVISOR_set_trap_table(NULL);
}
示例5: trap_init
void trap_init(void)
{
HYPERVISOR_set_trap_table(trap_table);
}