ia64/xen-unstable

view xen/arch/x86/x86_64/asm-offsets.c @ 11756:eee52c100996

[XEN] Remove unused MULTICALL_arg6, and unnecessary use of STR() macro.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Thu Oct 05 16:36:39 2006 +0100 (2006-10-05)
parents d20e1835c24b
children 1c506820c468
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>
10 #include <asm/fixmap.h>
11 #include <asm/hardirq.h>
13 #define DEFINE(_sym, _val) \
14 __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) )
15 #define BLANK() \
16 __asm__ __volatile__ ( "\n->" : : )
17 #define OFFSET(_sym, _str, _mem) \
18 DEFINE(_sym, offsetof(_str, _mem));
20 /* base-2 logarithm */
21 #define __L2(_x) (((_x) & 0x00000002) ? 1 : 0)
22 #define __L4(_x) (((_x) & 0x0000000c) ? ( 2 + __L2( (_x)>> 2)) : __L2( _x))
23 #define __L8(_x) (((_x) & 0x000000f0) ? ( 4 + __L4( (_x)>> 4)) : __L4( _x))
24 #define __L16(_x) (((_x) & 0x0000ff00) ? ( 8 + __L8( (_x)>> 8)) : __L8( _x))
25 #define LOG_2(_x) (((_x) & 0xffff0000) ? (16 + __L16((_x)>>16)) : __L16(_x))
27 void __dummy__(void)
28 {
29 OFFSET(UREGS_r15, struct cpu_user_regs, r15);
30 OFFSET(UREGS_r14, struct cpu_user_regs, r14);
31 OFFSET(UREGS_r13, struct cpu_user_regs, r13);
32 OFFSET(UREGS_r12, struct cpu_user_regs, r12);
33 OFFSET(UREGS_rbp, struct cpu_user_regs, rbp);
34 OFFSET(UREGS_rbx, struct cpu_user_regs, rbx);
35 OFFSET(UREGS_r11, struct cpu_user_regs, r11);
36 OFFSET(UREGS_r10, struct cpu_user_regs, r10);
37 OFFSET(UREGS_r9, struct cpu_user_regs, r9);
38 OFFSET(UREGS_r8, struct cpu_user_regs, r8);
39 OFFSET(UREGS_rax, struct cpu_user_regs, rax);
40 OFFSET(UREGS_rcx, struct cpu_user_regs, rcx);
41 OFFSET(UREGS_rdx, struct cpu_user_regs, rdx);
42 OFFSET(UREGS_rsi, struct cpu_user_regs, rsi);
43 OFFSET(UREGS_rdi, struct cpu_user_regs, rdi);
44 OFFSET(UREGS_error_code, struct cpu_user_regs, error_code);
45 OFFSET(UREGS_entry_vector, struct cpu_user_regs, entry_vector);
46 OFFSET(UREGS_rip, struct cpu_user_regs, rip);
47 OFFSET(UREGS_cs, struct cpu_user_regs, cs);
48 OFFSET(UREGS_eflags, struct cpu_user_regs, eflags);
49 OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
50 OFFSET(UREGS_ss, struct cpu_user_regs, ss);
51 OFFSET(UREGS_kernel_sizeof, struct cpu_user_regs, es);
52 DEFINE(UREGS_user_sizeof, sizeof(struct cpu_user_regs));
53 BLANK();
55 OFFSET(VCPU_processor, struct vcpu, processor);
56 OFFSET(VCPU_vcpu_info, struct vcpu, vcpu_info);
57 OFFSET(VCPU_trap_bounce, struct vcpu, arch.trap_bounce);
58 OFFSET(VCPU_thread_flags, struct vcpu, arch.flags);
59 OFFSET(VCPU_event_addr, struct vcpu,
60 arch.guest_context.event_callback_eip);
61 OFFSET(VCPU_failsafe_addr, struct vcpu,
62 arch.guest_context.failsafe_callback_eip);
63 OFFSET(VCPU_syscall_addr, struct vcpu,
64 arch.guest_context.syscall_callback_eip);
65 OFFSET(VCPU_kernel_sp, struct vcpu,
66 arch.guest_context.kernel_sp);
67 OFFSET(VCPU_guest_context_flags, struct vcpu, arch.guest_context.flags);
68 OFFSET(VCPU_arch_guest_fpu_ctxt, struct vcpu, arch.guest_context.fpu_ctxt);
69 OFFSET(VCPU_flags, struct vcpu, vcpu_flags);
70 OFFSET(VCPU_nmi_addr, struct vcpu, nmi_addr);
71 DEFINE(_VCPUF_nmi_pending, _VCPUF_nmi_pending);
72 DEFINE(_VCPUF_nmi_masked, _VCPUF_nmi_masked);
73 DEFINE(_VGCF_failsafe_disables_events, _VGCF_failsafe_disables_events);
74 DEFINE(_VGCF_syscall_disables_events, _VGCF_syscall_disables_events);
75 BLANK();
77 OFFSET(VCPU_svm_vmcb_pa, struct vcpu, arch.hvm_svm.vmcb_pa);
78 OFFSET(VCPU_svm_vmcb, struct vcpu, arch.hvm_svm.vmcb);
79 OFFSET(VCPU_svm_vmexit_tsc, struct vcpu, arch.hvm_svm.vmexit_tsc);
80 BLANK();
82 OFFSET(VCPU_vmx_launched, struct vcpu, arch.hvm_vmx.launched);
83 BLANK();
85 OFFSET(VMCB_rax, struct vmcb_struct, rax);
86 OFFSET(VMCB_tsc_offset, struct vmcb_struct, tsc_offset);
87 BLANK();
89 OFFSET(VCPUINFO_upcall_pending, vcpu_info_t, evtchn_upcall_pending);
90 OFFSET(VCPUINFO_upcall_mask, vcpu_info_t, evtchn_upcall_mask);
91 BLANK();
93 DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info));
94 BLANK();
96 OFFSET(TRAPBOUNCE_error_code, struct trap_bounce, error_code);
97 OFFSET(TRAPBOUNCE_flags, struct trap_bounce, flags);
98 OFFSET(TRAPBOUNCE_cs, struct trap_bounce, cs);
99 OFFSET(TRAPBOUNCE_eip, struct trap_bounce, eip);
100 BLANK();
102 #if PERF_COUNTERS
103 OFFSET(PERFC_hypercalls, struct perfcounter, hypercalls);
104 OFFSET(PERFC_exceptions, struct perfcounter, exceptions);
105 BLANK();
106 #endif
108 OFFSET(MULTICALL_op, struct multicall_entry, op);
109 OFFSET(MULTICALL_arg0, struct multicall_entry, args[0]);
110 OFFSET(MULTICALL_arg1, struct multicall_entry, args[1]);
111 OFFSET(MULTICALL_arg2, struct multicall_entry, args[2]);
112 OFFSET(MULTICALL_arg3, struct multicall_entry, args[3]);
113 OFFSET(MULTICALL_arg4, struct multicall_entry, args[4]);
114 OFFSET(MULTICALL_arg5, struct multicall_entry, args[5]);
115 OFFSET(MULTICALL_result, struct multicall_entry, result);
116 BLANK();
118 DEFINE(IRQSTAT_shift, LOG_2(sizeof(irq_cpustat_t)));
119 }