debuggers.hg

view xen/arch/x86/x86_64/asm-offsets.c @ 4632:05621922c024

bitkeeper revision 1.1340 (426652e8h-OWfDH7vm_elbT4wtH2cA)

Merge maf46@ssh-relay1.cl.cam.ac.uk:/usr/groups/xeno/BK/xen-unstable.bk
into fleming.research:/scratch/fleming/mafetter/xen-unstable.bk

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author mafetter@fleming.research
date Wed Apr 20 13:02:32 2005 +0000 (2005-04-20)
parents a01199a95070 d10fe13887d7
children 38a02ee9a9c8 65b28c74cec2
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/config.h>
8 #include <xen/perfc.h>
9 #include <xen/sched.h>
11 #define DEFINE(_sym, _val) \
12 __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
13 #define BLANK() \
14 __asm__ __volatile__ ( "\n->" : : )
15 #define OFFSET(_sym, _str, _mem) \
16 DEFINE(_sym, offsetof(_str, _mem));
18 /* base-2 logarithm */
19 #define __L2(_x) (((_x) & 0x00000002) ? 1 : 0)
20 #define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
21 #define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
22 #define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
23 #define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
25 void __dummy__(void)
26 {
27 OFFSET(XREGS_r15, struct xen_regs, r15);
28 OFFSET(XREGS_r14, struct xen_regs, r14);
29 OFFSET(XREGS_r13, struct xen_regs, r13);
30 OFFSET(XREGS_r12, struct xen_regs, r12);
31 OFFSET(XREGS_rbp, struct xen_regs, rbp);
32 OFFSET(XREGS_rbx, struct xen_regs, rbx);
33 OFFSET(XREGS_r11, struct xen_regs, r11);
34 OFFSET(XREGS_r10, struct xen_regs, r10);
35 OFFSET(XREGS_r9, struct xen_regs, r9);
36 OFFSET(XREGS_r8, struct xen_regs, r8);
37 OFFSET(XREGS_rax, struct xen_regs, rax);
38 OFFSET(XREGS_rcx, struct xen_regs, rcx);
39 OFFSET(XREGS_rdx, struct xen_regs, rdx);
40 OFFSET(XREGS_rsi, struct xen_regs, rsi);
41 OFFSET(XREGS_rdi, struct xen_regs, rdi);
42 OFFSET(XREGS_error_code, struct xen_regs, error_code);
43 OFFSET(XREGS_entry_vector, struct xen_regs, entry_vector);
44 OFFSET(XREGS_rip, struct xen_regs, rip);
45 OFFSET(XREGS_cs, struct xen_regs, cs);
46 OFFSET(XREGS_eflags, struct xen_regs, eflags);
47 OFFSET(XREGS_rsp, struct xen_regs, rsp);
48 OFFSET(XREGS_ss, struct xen_regs, ss);
49 OFFSET(XREGS_kernel_sizeof, struct xen_regs, es);
50 DEFINE(XREGS_user_sizeof, sizeof(struct xen_regs));
51 BLANK();
53 OFFSET(EDOMAIN_processor, struct exec_domain, processor);
54 OFFSET(EDOMAIN_vcpu_info, struct exec_domain, vcpu_info);
55 OFFSET(EDOMAIN_event_addr, struct exec_domain, arch.event_address);
56 OFFSET(EDOMAIN_failsafe_addr, struct exec_domain, arch.failsafe_address);
57 OFFSET(EDOMAIN_syscall_addr, struct exec_domain, arch.syscall_address);
58 OFFSET(EDOMAIN_trap_bounce, struct exec_domain, arch.trap_bounce);
59 OFFSET(EDOMAIN_thread_flags, struct exec_domain, arch.flags);
60 OFFSET(EDOMAIN_kernel_sp, struct exec_domain, arch.kernel_sp);
61 BLANK();
63 OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
64 OFFSET(VCPUINFO_upcall_mask, vcpu_info_t, evtchn_upcall_mask);
65 BLANK();
67 OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
68 OFFSET(TRAPBOUNCE_cr2, struct trap_bounce, cr2);
69 OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
70 OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
71 OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
72 BLANK();
74 #if PERF_COUNTERS
75 OFFSET(PERFC_hypercalls, struct perfcounter, hypercalls);
76 OFFSET(PERFC_exceptions, struct perfcounter, exceptions);
77 BLANK();
78 #endif
80 OFFSET(MULTICALL_op, multicall_entry_t, op);
81 OFFSET(MULTICALL_arg0, multicall_entry_t, args[0]);
82 OFFSET(MULTICALL_arg1, multicall_entry_t, args[1]);
83 OFFSET(MULTICALL_arg2, multicall_entry_t, args[2]);
84 OFFSET(MULTICALL_arg3, multicall_entry_t, args[3]);
85 OFFSET(MULTICALL_arg4, multicall_entry_t, args[4]);
86 OFFSET(MULTICALL_result, multicall_entry_t, args[5]);
87 BLANK();
89 DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
90 }