ENDFUNC(exec_user_stub)
.popsection
+ENTRY(entry_EVTCHN)
+ push $0
+ push $0x200
+
+ push %es
+ push %ds
+
+ SAVE_ALL
+
+ mov $__KERN_DS, %eax /* Restore data segments. */
+ mov %eax, %ds
+ mov %eax, %es
+
+ push %esp /* struct cpu_regs * */
+ call do_evtchn
+ add $4, %esp
+
+ RESTORE_ALL
+
+ pop %ds
+ pop %es
+
+ add $8, %esp /* Pop error_code/entry_vector. */
+
+ env_IRET
+ENDFUNC(entry_EVTCHN)
+
#if defined(CONFIG_PV)
ENTRY(entry_SYSCALL)
push $0
ENDFUNC(exec_user_stub)
.popsection
+ENTRY(entry_EVTCHN)
+ env_ADJUST_FRAME
+
+ push $0
+ movl $0x200, 4(%rsp)
+
+ SAVE_ALL
+
+ mov %rsp, %rdi /* struct cpu_regs * */
+ call do_evtchn
+
+ RESTORE_ALL
+ add $8, %rsp /* Pop error_code/entry_vector. */
+
+ env_IRETQ
+ENDFUNC(entry_EVTCHN)
+
#if defined(CONFIG_PV)
ENTRY(entry_SYSCALL)
env_ADJUST_FRAME
*/
void do_syscall(struct cpu_regs *regs);
+/**
+ * May be implemented by a guest to handle Event Channel upcalls.
+ */
+void do_evtchn(struct cpu_regs *regs);
+
#endif /* XTF_X86_TEST_H */
/*
void entry_ret_to_kernel(void);
void entry_SYSCALL(void);
+void entry_EVTCHN(void);
struct xen_trap_info pv_default_trap_info[] =
{
xen_callback_register_t cb;
+ cb = (xen_callback_register_t) {
+ .type = CALLBACKTYPE_event,
+ .address = INIT_XEN_CALLBACK(__KERN_CS, _u(entry_EVTCHN)),
+ };
+
+ rc = hypercall_register_callback(&cb);
+ if ( rc )
+ panic("Failed to register evtchn callback: %d\n", rc);
+
#ifdef __x86_64__
cb = (xen_callback_register_t) {
.type = CALLBACKTYPE_syscall,
panic("Unhandled syscall\n");
}
+void __weak do_evtchn(struct cpu_regs *regs)
+{
+ panic("Unhandled evtchn upcall\n");
+}
+
/*
* Local variables:
* mode: C