direct-io.hg

view xen/arch/x86/x86_64/asm-offsets.c @ 3280:dda5ab69e74a

bitkeeper revision 1.1159.1.477 (41bf20d2wgoxIqhcE0nzBC8W-yFPhg)

sync w/ head.
author cl349@arcadians.cl.cam.ac.uk
date Tue Dec 14 17:20:18 2004 +0000 (2004-12-14)
parents da409d40699a
children c65b544a8c4e
line source
1 /*
2 * Generate definitions needed by assembly language modules.
3 * This code generates raw asm output which is post-processed
4 * to extract and format the required data.
5 */
7 #include <xen/sched.h>
9 #define DEFINE(_sym, _val) \
10 __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
11 #define BLANK() \
12 __asm__ __volatile__ ( "\n->" : : )
13 #define OFFSET(_sym, _str, _mem) \
14 DEFINE(_sym, offsetof(_str, _mem));
16 void __dummy__(void)
17 {
18 OFFSET(XREGS_r15, struct xen_regs, r15);
19 OFFSET(XREGS_r14, struct xen_regs, r14);
20 OFFSET(XREGS_r13, struct xen_regs, r13);
21 OFFSET(XREGS_r12, struct xen_regs, r12);
22 OFFSET(XREGS_rbp, struct xen_regs, rbp);
23 OFFSET(XREGS_rbx, struct xen_regs, rbx);
24 OFFSET(XREGS_r11, struct xen_regs, r11);
25 OFFSET(XREGS_r10, struct xen_regs, r10);
26 OFFSET(XREGS_r9, struct xen_regs, r9);
27 OFFSET(XREGS_r8, struct xen_regs, r8);
28 OFFSET(XREGS_rax, struct xen_regs, rax);
29 OFFSET(XREGS_rcx, struct xen_regs, rcx);
30 OFFSET(XREGS_rdx, struct xen_regs, rdx);
31 OFFSET(XREGS_rsi, struct xen_regs, rsi);
32 OFFSET(XREGS_rdi, struct xen_regs, rdi);
33 OFFSET(XREGS_orig_rax, struct xen_regs, orig_rax);
34 OFFSET(XREGS_rip, struct xen_regs, rip);
35 OFFSET(XREGS_cs, struct xen_regs, cs);
36 OFFSET(XREGS_eflags, struct xen_regs, eflags);
37 OFFSET(XREGS_rsp, struct xen_regs, rsp);
38 OFFSET(XREGS_ss, struct xen_regs, ss);
39 BLANK();
41 OFFSET(DOMAIN_processor, struct domain, processor);
42 OFFSET(DOMAIN_shared_info, struct domain, shared_info);
43 OFFSET(DOMAIN_event_sel, struct domain, thread.event_selector);
44 OFFSET(DOMAIN_event_addr, struct domain, thread.event_address);
45 OFFSET(DOMAIN_failsafe_sel, struct domain, thread.failsafe_selector);
46 OFFSET(DOMAIN_failsafe_addr, struct domain, thread.failsafe_address);
47 OFFSET(DOMAIN_trap_bounce, struct domain, thread.trap_bounce);
48 OFFSET(DOMAIN_thread_flags, struct domain, thread.flags);
49 BLANK();
51 OFFSET(SHINFO_upcall_pending, shared_info_t,
52 vcpu_data[0].evtchn_upcall_pending);
53 OFFSET(SHINFO_upcall_mask, shared_info_t,
54 vcpu_data[0].evtchn_upcall_mask);
55 BLANK();
57 OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
58 OFFSET(TRAPBOUNCE_cr2, struct trap_bounce, cr2);
59 OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
60 OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
61 OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
62 BLANK();
64 OFFSET(MULTICALL_op, multicall_entry_t, op);
65 OFFSET(MULTICALL_arg0, multicall_entry_t, args[0]);
66 OFFSET(MULTICALL_arg1, multicall_entry_t, args[1]);
67 OFFSET(MULTICALL_arg2, multicall_entry_t, args[2]);
68 OFFSET(MULTICALL_arg3, multicall_entry_t, args[3]);
69 OFFSET(MULTICALL_arg4, multicall_entry_t, args[4]);
70 OFFSET(MULTICALL_result, multicall_entry_t, args[5]);
71 }