ia64/xen-unstable

view xen/arch/ia64/asm-offsets.c @ 9495:8e0b9f31cf3f

[IA64] MAX_VIRT_CPUS and NR_CPUS

Increase MAX_VIRT_CPUS and NR_CPUS to 64.
Check maxcpus < MAX_VIRT_CPUS.
Check size of shared_info (<= PAGE_SIZE).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Fri Apr 07 11:40:33 2006 -0600 (2006-04-07)
parents 27050b1390cf
children 3ab5ab4d6d75
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/sched.h>
9 #include <asm/processor.h>
10 #include <asm/ptrace.h>
11 #include <public/xen.h>
12 #include <asm/tlb.h>
13 #include <asm/regs.h>
15 #define task_struct vcpu
17 #define DEFINE(sym, val) \
18 asm volatile("\n->" #sym " (%0) " #val : : "i" (val))
20 #define BLANK() asm volatile("\n->" : : )
22 #define OFFSET(_sym, _str, _mem) \
23 DEFINE(_sym, offsetof(_str, _mem));
25 void foo(void)
26 {
27 DEFINE(IA64_TASK_SIZE, sizeof (struct task_struct));
28 DEFINE(IA64_THREAD_INFO_SIZE, sizeof (struct thread_info));
29 DEFINE(IA64_PT_REGS_SIZE, sizeof (struct pt_regs));
30 DEFINE(IA64_SWITCH_STACK_SIZE, sizeof (struct switch_stack));
31 DEFINE(IA64_CPU_SIZE, sizeof (struct cpuinfo_ia64));
32 DEFINE(UNW_FRAME_INFO_SIZE, sizeof (struct unw_frame_info));
33 DEFINE(SHARED_INFO_SIZE, sizeof (struct shared_info));
35 BLANK();
36 #ifdef VTI_DEBUG
37 DEFINE(IVT_CUR_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_current));
38 DEFINE(IVT_DBG_OFS, offsetof(struct vcpu, arch.arch_vmx.ivt_debug));
39 #endif
40 DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
41 DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
43 BLANK();
45 DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct vcpu, arch._thread.ksp));
46 DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct vcpu, arch._thread.on_ustack));
48 DEFINE(IA64_VCPU_DOMAIN_OFFSET, offsetof (struct vcpu, domain));
49 DEFINE(IA64_VCPU_META_RR0_OFFSET, offsetof (struct vcpu, arch.metaphysical_rr0));
50 DEFINE(IA64_VCPU_META_SAVED_RR0_OFFSET, offsetof (struct vcpu, arch.metaphysical_saved_rr0));
51 DEFINE(IA64_VCPU_BREAKIMM_OFFSET, offsetof (struct vcpu, arch.breakimm));
52 DEFINE(IA64_VCPU_IVA_OFFSET, offsetof (struct vcpu, arch.iva));
53 DEFINE(IA64_VCPU_DTLB_PTE_OFFSET, offsetof (struct vcpu, arch.dtlb_pte));
54 DEFINE(IA64_VCPU_ITLB_PTE_OFFSET, offsetof (struct vcpu, arch.itlb_pte));
55 DEFINE(IA64_VCPU_IRR0_OFFSET, offsetof (struct vcpu, arch.irr[0]));
56 DEFINE(IA64_VCPU_IRR3_OFFSET, offsetof (struct vcpu, arch.irr[3]));
57 DEFINE(IA64_VCPU_INSVC3_OFFSET, offsetof (struct vcpu, arch.insvc[3]));
58 DEFINE(IA64_VCPU_STARTING_RID_OFFSET, offsetof (struct vcpu, arch.starting_rid));
59 DEFINE(IA64_VCPU_ENDING_RID_OFFSET, offsetof (struct vcpu, arch.ending_rid));
60 DEFINE(IA64_VCPU_DOMAIN_ITM_OFFSET, offsetof (struct vcpu, arch.domain_itm));
61 DEFINE(IA64_VCPU_DOMAIN_ITM_LAST_OFFSET, offsetof (struct vcpu, arch.domain_itm_last));
62 DEFINE(IA64_VCPU_ITLB_OFFSET, offsetof (struct vcpu, arch.itlb));
63 DEFINE(IA64_VCPU_DTLB_OFFSET, offsetof (struct vcpu, arch.dtlb));
65 BLANK();
66 DEFINE(IA64_CPUINFO_ITM_NEXT_OFFSET, offsetof (struct cpuinfo_ia64, itm_next));
67 DEFINE(IA64_CPUINFO_KSOFTIRQD_OFFSET, offsetof (struct cpuinfo_ia64, ksoftirqd));
70 BLANK();
72 DEFINE(IA64_PT_REGS_B6_OFFSET, offsetof (struct pt_regs, b6));
73 DEFINE(IA64_PT_REGS_B7_OFFSET, offsetof (struct pt_regs, b7));
74 DEFINE(IA64_PT_REGS_AR_CSD_OFFSET, offsetof (struct pt_regs, ar_csd));
75 DEFINE(IA64_PT_REGS_AR_SSD_OFFSET, offsetof (struct pt_regs, ar_ssd));
76 DEFINE(IA64_PT_REGS_R8_OFFSET, offsetof (struct pt_regs, r8));
77 DEFINE(IA64_PT_REGS_R9_OFFSET, offsetof (struct pt_regs, r9));
78 DEFINE(IA64_PT_REGS_R10_OFFSET, offsetof (struct pt_regs, r10));
79 DEFINE(IA64_PT_REGS_R11_OFFSET, offsetof (struct pt_regs, r11));
80 DEFINE(IA64_PT_REGS_CR_IPSR_OFFSET, offsetof (struct pt_regs, cr_ipsr));
81 DEFINE(IA64_PT_REGS_CR_IIP_OFFSET, offsetof (struct pt_regs, cr_iip));
82 DEFINE(IA64_PT_REGS_CR_IFS_OFFSET, offsetof (struct pt_regs, cr_ifs));
83 DEFINE(IA64_PT_REGS_AR_UNAT_OFFSET, offsetof (struct pt_regs, ar_unat));
84 DEFINE(IA64_PT_REGS_AR_PFS_OFFSET, offsetof (struct pt_regs, ar_pfs));
85 DEFINE(IA64_PT_REGS_AR_RSC_OFFSET, offsetof (struct pt_regs, ar_rsc));
86 DEFINE(IA64_PT_REGS_AR_RNAT_OFFSET, offsetof (struct pt_regs, ar_rnat));
88 DEFINE(IA64_PT_REGS_AR_BSPSTORE_OFFSET, offsetof (struct pt_regs, ar_bspstore));
89 DEFINE(IA64_PT_REGS_PR_OFFSET, offsetof (struct pt_regs, pr));
90 DEFINE(IA64_PT_REGS_B0_OFFSET, offsetof (struct pt_regs, b0));
91 DEFINE(IA64_PT_REGS_LOADRS_OFFSET, offsetof (struct pt_regs, loadrs));
92 DEFINE(IA64_PT_REGS_R1_OFFSET, offsetof (struct pt_regs, r1));
93 DEFINE(IA64_PT_REGS_R12_OFFSET, offsetof (struct pt_regs, r12));
94 DEFINE(IA64_PT_REGS_R13_OFFSET, offsetof (struct pt_regs, r13));
95 DEFINE(IA64_PT_REGS_AR_FPSR_OFFSET, offsetof (struct pt_regs, ar_fpsr));
96 DEFINE(IA64_PT_REGS_R15_OFFSET, offsetof (struct pt_regs, r15));
97 DEFINE(IA64_PT_REGS_R14_OFFSET, offsetof (struct pt_regs, r14));
98 DEFINE(IA64_PT_REGS_R2_OFFSET, offsetof (struct pt_regs, r2));
99 DEFINE(IA64_PT_REGS_R3_OFFSET, offsetof (struct pt_regs, r3));
100 DEFINE(IA64_PT_REGS_R16_OFFSET, offsetof (struct pt_regs, r16));
101 DEFINE(IA64_PT_REGS_R17_OFFSET, offsetof (struct pt_regs, r17));
102 DEFINE(IA64_PT_REGS_R18_OFFSET, offsetof (struct pt_regs, r18));
103 DEFINE(IA64_PT_REGS_R19_OFFSET, offsetof (struct pt_regs, r19));
104 DEFINE(IA64_PT_REGS_R20_OFFSET, offsetof (struct pt_regs, r20));
105 DEFINE(IA64_PT_REGS_R21_OFFSET, offsetof (struct pt_regs, r21));
106 DEFINE(IA64_PT_REGS_R22_OFFSET, offsetof (struct pt_regs, r22));
107 DEFINE(IA64_PT_REGS_R23_OFFSET, offsetof (struct pt_regs, r23));
108 DEFINE(IA64_PT_REGS_R24_OFFSET, offsetof (struct pt_regs, r24));
109 DEFINE(IA64_PT_REGS_R25_OFFSET, offsetof (struct pt_regs, r25));
110 DEFINE(IA64_PT_REGS_R26_OFFSET, offsetof (struct pt_regs, r26));
111 DEFINE(IA64_PT_REGS_R27_OFFSET, offsetof (struct pt_regs, r27));
112 DEFINE(IA64_PT_REGS_R28_OFFSET, offsetof (struct pt_regs, r28));
113 DEFINE(IA64_PT_REGS_R29_OFFSET, offsetof (struct pt_regs, r29));
114 DEFINE(IA64_PT_REGS_R30_OFFSET, offsetof (struct pt_regs, r30));
115 DEFINE(IA64_PT_REGS_R31_OFFSET, offsetof (struct pt_regs, r31));
116 DEFINE(IA64_PT_REGS_AR_CCV_OFFSET, offsetof (struct pt_regs, ar_ccv));
117 DEFINE(IA64_PT_REGS_F6_OFFSET, offsetof (struct pt_regs, f6));
118 DEFINE(IA64_PT_REGS_F7_OFFSET, offsetof (struct pt_regs, f7));
119 DEFINE(IA64_PT_REGS_F8_OFFSET, offsetof (struct pt_regs, f8));
120 DEFINE(IA64_PT_REGS_F9_OFFSET, offsetof (struct pt_regs, f9));
121 DEFINE(IA64_PT_REGS_F10_OFFSET, offsetof (struct pt_regs, f10));
122 DEFINE(IA64_PT_REGS_F11_OFFSET, offsetof (struct pt_regs, f11));
123 DEFINE(IA64_PT_REGS_R4_OFFSET, offsetof (struct pt_regs, r4));
124 DEFINE(IA64_PT_REGS_R5_OFFSET, offsetof (struct pt_regs, r5));
125 DEFINE(IA64_PT_REGS_R6_OFFSET, offsetof (struct pt_regs, r6));
126 DEFINE(IA64_PT_REGS_R7_OFFSET, offsetof (struct pt_regs, r7));
127 DEFINE(IA64_PT_REGS_EML_UNAT_OFFSET, offsetof (struct pt_regs, eml_unat));
128 DEFINE(IA64_PT_REGS_RFI_PFS_OFFSET, offsetof (struct pt_regs, rfi_pfs));
129 DEFINE(IA64_VCPU_IIPA_OFFSET, offsetof (struct vcpu, arch.arch_vmx.cr_iipa));
130 DEFINE(IA64_VCPU_ISR_OFFSET, offsetof (struct vcpu, arch.arch_vmx.cr_isr));
131 DEFINE(IA64_VCPU_CAUSE_OFFSET, offsetof (struct vcpu, arch.arch_vmx.cause));
132 DEFINE(IA64_VCPU_OPCODE_OFFSET, offsetof (struct vcpu, arch.arch_vmx.opcode));
133 DEFINE(SWITCH_MPTA_OFFSET,offsetof(struct vcpu ,arch.arch_vmx.mpta));
134 DEFINE(IA64_PT_REGS_R16_SLOT, (((offsetof(struct pt_regs, r16)-sizeof(struct pt_regs))>>3)&0x3f));
135 DEFINE(IA64_VCPU_FLAGS_OFFSET,offsetof(struct vcpu ,arch.arch_vmx.flags));
137 BLANK();
139 DEFINE(IA64_SWITCH_STACK_CALLER_UNAT_OFFSET, offsetof (struct switch_stack, caller_unat));
140 DEFINE(IA64_SWITCH_STACK_AR_FPSR_OFFSET, offsetof (struct switch_stack, ar_fpsr));
141 DEFINE(IA64_SWITCH_STACK_F2_OFFSET, offsetof (struct switch_stack, f2));
142 DEFINE(IA64_SWITCH_STACK_F3_OFFSET, offsetof (struct switch_stack, f3));
143 DEFINE(IA64_SWITCH_STACK_F4_OFFSET, offsetof (struct switch_stack, f4));
144 DEFINE(IA64_SWITCH_STACK_F5_OFFSET, offsetof (struct switch_stack, f5));
145 DEFINE(IA64_SWITCH_STACK_F12_OFFSET, offsetof (struct switch_stack, f12));
146 DEFINE(IA64_SWITCH_STACK_F13_OFFSET, offsetof (struct switch_stack, f13));
147 DEFINE(IA64_SWITCH_STACK_F14_OFFSET, offsetof (struct switch_stack, f14));
148 DEFINE(IA64_SWITCH_STACK_F15_OFFSET, offsetof (struct switch_stack, f15));
149 DEFINE(IA64_SWITCH_STACK_F16_OFFSET, offsetof (struct switch_stack, f16));
150 DEFINE(IA64_SWITCH_STACK_F17_OFFSET, offsetof (struct switch_stack, f17));
151 DEFINE(IA64_SWITCH_STACK_F18_OFFSET, offsetof (struct switch_stack, f18));
152 DEFINE(IA64_SWITCH_STACK_F19_OFFSET, offsetof (struct switch_stack, f19));
153 DEFINE(IA64_SWITCH_STACK_F20_OFFSET, offsetof (struct switch_stack, f20));
154 DEFINE(IA64_SWITCH_STACK_F21_OFFSET, offsetof (struct switch_stack, f21));
155 DEFINE(IA64_SWITCH_STACK_F22_OFFSET, offsetof (struct switch_stack, f22));
156 DEFINE(IA64_SWITCH_STACK_F23_OFFSET, offsetof (struct switch_stack, f23));
157 DEFINE(IA64_SWITCH_STACK_F24_OFFSET, offsetof (struct switch_stack, f24));
158 DEFINE(IA64_SWITCH_STACK_F25_OFFSET, offsetof (struct switch_stack, f25));
159 DEFINE(IA64_SWITCH_STACK_F26_OFFSET, offsetof (struct switch_stack, f26));
160 DEFINE(IA64_SWITCH_STACK_F27_OFFSET, offsetof (struct switch_stack, f27));
161 DEFINE(IA64_SWITCH_STACK_F28_OFFSET, offsetof (struct switch_stack, f28));
162 DEFINE(IA64_SWITCH_STACK_F29_OFFSET, offsetof (struct switch_stack, f29));
163 DEFINE(IA64_SWITCH_STACK_F30_OFFSET, offsetof (struct switch_stack, f30));
164 DEFINE(IA64_SWITCH_STACK_F31_OFFSET, offsetof (struct switch_stack, f31));
165 DEFINE(IA64_SWITCH_STACK_R4_OFFSET, offsetof (struct switch_stack, r4));
166 DEFINE(IA64_SWITCH_STACK_R5_OFFSET, offsetof (struct switch_stack, r5));
167 DEFINE(IA64_SWITCH_STACK_R6_OFFSET, offsetof (struct switch_stack, r6));
168 DEFINE(IA64_SWITCH_STACK_R7_OFFSET, offsetof (struct switch_stack, r7));
169 DEFINE(IA64_SWITCH_STACK_B0_OFFSET, offsetof (struct switch_stack, b0));
170 DEFINE(IA64_SWITCH_STACK_B1_OFFSET, offsetof (struct switch_stack, b1));
171 DEFINE(IA64_SWITCH_STACK_B2_OFFSET, offsetof (struct switch_stack, b2));
172 DEFINE(IA64_SWITCH_STACK_B3_OFFSET, offsetof (struct switch_stack, b3));
173 DEFINE(IA64_SWITCH_STACK_B4_OFFSET, offsetof (struct switch_stack, b4));
174 DEFINE(IA64_SWITCH_STACK_B5_OFFSET, offsetof (struct switch_stack, b5));
175 DEFINE(IA64_SWITCH_STACK_AR_PFS_OFFSET, offsetof (struct switch_stack, ar_pfs));
176 DEFINE(IA64_SWITCH_STACK_AR_LC_OFFSET, offsetof (struct switch_stack, ar_lc));
177 DEFINE(IA64_SWITCH_STACK_AR_UNAT_OFFSET, offsetof (struct switch_stack, ar_unat));
178 DEFINE(IA64_SWITCH_STACK_AR_RNAT_OFFSET, offsetof (struct switch_stack, ar_rnat));
179 DEFINE(IA64_SWITCH_STACK_AR_BSPSTORE_OFFSET, offsetof (struct switch_stack, ar_bspstore));
180 DEFINE(IA64_SWITCH_STACK_PR_OFFSET, offsetof (struct switch_stack, pr));
182 BLANK();
184 DEFINE(IA64_VPD_BASE_OFFSET, offsetof (struct vcpu, arch.privregs));
185 DEFINE(IA64_VLSAPIC_INSVC_BASE_OFFSET, offsetof (struct vcpu, arch.insvc[0]));
186 DEFINE(IA64_VPD_CR_VPTA_OFFSET, offsetof (cr_t, pta));
187 DEFINE(XXX_THASH_SIZE, sizeof (thash_data_t));
189 BLANK();
190 DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, offsetof (struct cpuinfo_ia64, nsec_per_cyc));
191 DEFINE(IA64_TIMESPEC_TV_NSEC_OFFSET, offsetof (struct timespec, tv_nsec));
194 DEFINE(CLONE_IDLETASK_BIT, 12);
195 DEFINE(CLONE_SETTLS_BIT, 19);
196 DEFINE(IA64_CPUINFO_NSEC_PER_CYC_OFFSET, offsetof (struct cpuinfo_ia64, nsec_per_cyc));
198 BLANK();
199 DEFINE(IA64_KR_CURRENT_OFFSET, offsetof (cpu_kr_ia64_t, _kr[IA64_KR_CURRENT]));
200 DEFINE(IA64_KR_PT_BASE_OFFSET, offsetof (cpu_kr_ia64_t, _kr[IA64_KR_PT_BASE]));
201 DEFINE(IA64_KR_IO_BASE_OFFSET, offsetof (cpu_kr_ia64_t, _kr[IA64_KR_IO_BASE]));
202 DEFINE(IA64_KR_PERCPU_DATA_OFFSET, offsetof (cpu_kr_ia64_t, _kr[IA64_KR_PER_CPU_DATA]));
203 DEFINE(IA64_KR_IO_BASE_OFFSET, offsetof (cpu_kr_ia64_t, _kr[IA64_KR_IO_BASE]));
204 DEFINE(IA64_KR_CURRENT_STACK_OFFSET, offsetof (cpu_kr_ia64_t, _kr[IA64_KR_CURRENT_STACK]));
206 }