本文整理汇总了C++中HYPERVISOR_update_descriptor函数的典型用法代码示例。如果您正苦于以下问题:C++ HYPERVISOR_update_descriptor函数的具体用法?C++ HYPERVISOR_update_descriptor怎么用?C++ HYPERVISOR_update_descriptor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HYPERVISOR_update_descriptor函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: xen_write_gdt_entry
static void xen_write_gdt_entry(struct desc_struct *dt, int entry,
const void *desc, int type)
{
trace_xen_cpu_write_gdt_entry(dt, entry, desc, type);
preempt_disable();
switch (type) {
case DESC_LDT:
case DESC_TSS:
break;
default: {
xmaddr_t maddr = arbitrary_virt_to_machine(&dt[entry]);
xen_mc_flush();
if (HYPERVISOR_update_descriptor(maddr.maddr, *(u64 *)desc))
BUG();
}
}
preempt_enable();
}
示例2: xen_write_ldt_entry
static void xen_write_ldt_entry(struct desc_struct *dt, int entrynum,
const void *ptr)
{
xmaddr_t mach_lp = arbitrary_virt_to_machine(&dt[entrynum]);
u64 entry = *(u64 *)ptr;
preempt_disable();
xen_mc_flush();
if (HYPERVISOR_update_descriptor(mach_lp.maddr, entry))
BUG();
preempt_enable();
}
示例3: xen_load_user_cs_desc
static void xen_load_user_cs_desc(int cpu, struct mm_struct *mm)
{
void *gdt;
xmaddr_t mgdt;
u64 descriptor;
struct desc_struct user_cs;
gdt = &get_cpu_gdt_table(cpu)[GDT_ENTRY_DEFAULT_USER_CS];
mgdt = virt_to_machine(gdt);
user_cs = mm->context.user_cs;
descriptor = (u64) user_cs.a | ((u64) user_cs.b) << 32;
HYPERVISOR_update_descriptor(mgdt.maddr, descriptor);
}
示例4: update_descriptor
static void
update_descriptor(union descriptor *table, union descriptor *entry)
{
#ifndef XEN
*table = *entry;
#else
paddr_t pa;
pt_entry_t *ptp;
ptp = kvtopte((vaddr_t)table);
pa = (*ptp & PG_FRAME) | ((vaddr_t)table & ~PG_FRAME);
if (HYPERVISOR_update_descriptor(pa, entry->raw[0], entry->raw[1]))
panic("HYPERVISOR_update_descriptor failed\n");
#endif
}
示例5: xen_write_gdt_entry_boot
/*
* Version of write_gdt_entry for use at early boot-time needed to
* update an entry as simply as possible.
*/
static void __init xen_write_gdt_entry_boot(struct desc_struct *dt, int entry,
const void *desc, int type)
{
switch (type) {
case DESC_LDT:
case DESC_TSS:
/* ignore */
break;
default: {
xmaddr_t maddr = virt_to_machine(&dt[entry]);
if (HYPERVISOR_update_descriptor(maddr.maddr, *(u64 *)desc))
dt[entry] = *(struct desc_struct *)desc;
}
}
}