diff options
author | Jiri Kosina <jkosina@suse.cz> | 2008-05-06 10:57:55 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2008-05-06 10:57:55 -0400 |
commit | 7022b15e2a9f878fd5184586064c63352c3dd225 (patch) | |
tree | 5365c2f5bc82ae1946636ee8d5cd5d3b7e804f1b /arch/powerpc/kernel/asm-offsets.c | |
parent | aaad2b0c757f3e6e02552cb0bdcd91a5ec0d6305 (diff) | |
parent | a15306365a16380f3bafee9e181ba01231d4acd7 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'arch/powerpc/kernel/asm-offsets.c')
-rw-r--r-- | arch/powerpc/kernel/asm-offsets.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c index 292c6d8db0e1..ec9228d687b0 100644 --- a/arch/powerpc/kernel/asm-offsets.c +++ b/arch/powerpc/kernel/asm-offsets.c | |||
@@ -23,10 +23,14 @@ | |||
23 | #include <linux/mm.h> | 23 | #include <linux/mm.h> |
24 | #include <linux/suspend.h> | 24 | #include <linux/suspend.h> |
25 | #include <linux/hrtimer.h> | 25 | #include <linux/hrtimer.h> |
26 | #ifdef CONFIG_KVM | ||
27 | #include <linux/kvm_host.h> | ||
28 | #endif | ||
26 | #ifdef CONFIG_PPC64 | 29 | #ifdef CONFIG_PPC64 |
27 | #include <linux/time.h> | 30 | #include <linux/time.h> |
28 | #include <linux/hardirq.h> | 31 | #include <linux/hardirq.h> |
29 | #endif | 32 | #endif |
33 | #include <linux/kbuild.h> | ||
30 | 34 | ||
31 | #include <asm/io.h> | 35 | #include <asm/io.h> |
32 | #include <asm/page.h> | 36 | #include <asm/page.h> |
@@ -48,11 +52,6 @@ | |||
48 | #include <asm/iseries/alpaca.h> | 52 | #include <asm/iseries/alpaca.h> |
49 | #endif | 53 | #endif |
50 | 54 | ||
51 | #define DEFINE(sym, val) \ | ||
52 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | ||
53 | |||
54 | #define BLANK() asm volatile("\n->" : : ) | ||
55 | |||
56 | int main(void) | 55 | int main(void) |
57 | { | 56 | { |
58 | DEFINE(THREAD, offsetof(struct task_struct, thread)); | 57 | DEFINE(THREAD, offsetof(struct task_struct, thread)); |
@@ -64,6 +63,7 @@ int main(void) | |||
64 | #endif /* CONFIG_PPC64 */ | 63 | #endif /* CONFIG_PPC64 */ |
65 | 64 | ||
66 | DEFINE(KSP, offsetof(struct thread_struct, ksp)); | 65 | DEFINE(KSP, offsetof(struct thread_struct, ksp)); |
66 | DEFINE(KSP_LIMIT, offsetof(struct thread_struct, ksp_limit)); | ||
67 | DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); | 67 | DEFINE(PT_REGS, offsetof(struct thread_struct, regs)); |
68 | DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); | 68 | DEFINE(THREAD_FPEXC_MODE, offsetof(struct thread_struct, fpexc_mode)); |
69 | DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); | 69 | DEFINE(THREAD_FPR0, offsetof(struct thread_struct, fpr[0])); |
@@ -93,10 +93,7 @@ int main(void) | |||
93 | DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); | 93 | DEFINE(TI_LOCAL_FLAGS, offsetof(struct thread_info, local_flags)); |
94 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); | 94 | DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); |
95 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); | 95 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); |
96 | #ifdef CONFIG_PPC32 | ||
97 | DEFINE(TI_EXECDOMAIN, offsetof(struct thread_info, exec_domain)); | ||
98 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); | 96 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); |
99 | #endif /* CONFIG_PPC32 */ | ||
100 | 97 | ||
101 | #ifdef CONFIG_PPC64 | 98 | #ifdef CONFIG_PPC64 |
102 | DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size)); | 99 | DEFINE(DCACHEL1LINESIZE, offsetof(struct ppc64_caches, dline_size)); |
@@ -165,13 +162,9 @@ int main(void) | |||
165 | 162 | ||
166 | /* Interrupt register frame */ | 163 | /* Interrupt register frame */ |
167 | DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); | 164 | DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD); |
168 | #ifndef CONFIG_PPC64 | 165 | DEFINE(INT_FRAME_SIZE, STACK_INT_FRAME_SIZE); |
169 | DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); | 166 | #ifdef CONFIG_PPC64 |
170 | #else /* CONFIG_PPC64 */ | ||
171 | DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); | 167 | DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs)); |
172 | /* 288 = # of volatile regs, int & fp, for leaf routines */ | ||
173 | /* which do not stack a frame. See the PPC64 ABI. */ | ||
174 | DEFINE(INT_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 288); | ||
175 | /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */ | 168 | /* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */ |
176 | DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); | 169 | DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); |
177 | DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); | 170 | DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16); |
@@ -331,5 +324,30 @@ int main(void) | |||
331 | 324 | ||
332 | DEFINE(PGD_TABLE_SIZE, PGD_TABLE_SIZE); | 325 | DEFINE(PGD_TABLE_SIZE, PGD_TABLE_SIZE); |
333 | 326 | ||
327 | #ifdef CONFIG_KVM | ||
328 | DEFINE(TLBE_BYTES, sizeof(struct tlbe)); | ||
329 | |||
330 | DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack)); | ||
331 | DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid)); | ||
332 | DEFINE(VCPU_HOST_TLB, offsetof(struct kvm_vcpu, arch.host_tlb)); | ||
333 | DEFINE(VCPU_SHADOW_TLB, offsetof(struct kvm_vcpu, arch.shadow_tlb)); | ||
334 | DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr)); | ||
335 | DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr)); | ||
336 | DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr)); | ||
337 | DEFINE(VCPU_XER, offsetof(struct kvm_vcpu, arch.xer)); | ||
338 | DEFINE(VCPU_CTR, offsetof(struct kvm_vcpu, arch.ctr)); | ||
339 | DEFINE(VCPU_PC, offsetof(struct kvm_vcpu, arch.pc)); | ||
340 | DEFINE(VCPU_MSR, offsetof(struct kvm_vcpu, arch.msr)); | ||
341 | DEFINE(VCPU_SPRG4, offsetof(struct kvm_vcpu, arch.sprg4)); | ||
342 | DEFINE(VCPU_SPRG5, offsetof(struct kvm_vcpu, arch.sprg5)); | ||
343 | DEFINE(VCPU_SPRG6, offsetof(struct kvm_vcpu, arch.sprg6)); | ||
344 | DEFINE(VCPU_SPRG7, offsetof(struct kvm_vcpu, arch.sprg7)); | ||
345 | DEFINE(VCPU_PID, offsetof(struct kvm_vcpu, arch.pid)); | ||
346 | |||
347 | DEFINE(VCPU_LAST_INST, offsetof(struct kvm_vcpu, arch.last_inst)); | ||
348 | DEFINE(VCPU_FAULT_DEAR, offsetof(struct kvm_vcpu, arch.fault_dear)); | ||
349 | DEFINE(VCPU_FAULT_ESR, offsetof(struct kvm_vcpu, arch.fault_esr)); | ||
350 | #endif | ||
351 | |||
334 | return 0; | 352 | return 0; |
335 | } | 353 | } |