ia64/xen-unstable
changeset 8928:f0a8a0a9a6f5
Add arch/x86_64/kernel/{asm-offsets,init_task}.c to sparse tree.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author | cl349@firebug.cl.cam.ac.uk |
---|---|
date | Mon Feb 20 14:51:50 2006 +0000 (2006-02-20) |
parents | 16a91d8dd8ed |
children | 82f6786a0aa8 |
files | linux-2.6-xen-sparse/arch/x86_64/kernel/asm-offsets.c linux-2.6-xen-sparse/arch/x86_64/kernel/init_task.c |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/asm-offsets.c Mon Feb 20 14:51:50 2006 +0000 1.3 @@ -0,0 +1,72 @@ 1.4 +/* 1.5 + * Generate definitions needed by assembly language modules. 1.6 + * This code generates raw asm output which is post-processed to extract 1.7 + * and format the required data. 1.8 + */ 1.9 + 1.10 +#include <linux/sched.h> 1.11 +#include <linux/stddef.h> 1.12 +#include <linux/errno.h> 1.13 +#include <linux/hardirq.h> 1.14 +#include <linux/suspend.h> 1.15 +#include <asm/pda.h> 1.16 +#include <asm/processor.h> 1.17 +#include <asm/segment.h> 1.18 +#include <asm/thread_info.h> 1.19 +#include <asm/ia32.h> 1.20 + 1.21 +#define DEFINE(sym, val) \ 1.22 + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 1.23 + 1.24 +#define BLANK() asm volatile("\n->" : : ) 1.25 + 1.26 +int main(void) 1.27 +{ 1.28 +#define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry)) 1.29 + ENTRY(state); 1.30 + ENTRY(flags); 1.31 + ENTRY(thread); 1.32 + ENTRY(pid); 1.33 + BLANK(); 1.34 +#undef ENTRY 1.35 +#define ENTRY(entry) DEFINE(threadinfo_ ## entry, offsetof(struct thread_info, entry)) 1.36 + ENTRY(flags); 1.37 + ENTRY(addr_limit); 1.38 + ENTRY(preempt_count); 1.39 + ENTRY(status); 1.40 + BLANK(); 1.41 +#undef ENTRY 1.42 +#define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry)) 1.43 + ENTRY(kernelstack); 1.44 + ENTRY(oldrsp); 1.45 + ENTRY(pcurrent); 1.46 + ENTRY(irqcount); 1.47 + ENTRY(cpunumber); 1.48 + ENTRY(irqstackptr); 1.49 + ENTRY(data_offset); 1.50 + BLANK(); 1.51 +#undef ENTRY 1.52 +#ifdef CONFIG_IA32_EMULATION 1.53 +#define ENTRY(entry) DEFINE(IA32_SIGCONTEXT_ ## entry, offsetof(struct sigcontext_ia32, entry)) 1.54 + ENTRY(eax); 1.55 + ENTRY(ebx); 1.56 + ENTRY(ecx); 1.57 + ENTRY(edx); 1.58 + ENTRY(esi); 1.59 + ENTRY(edi); 1.60 + ENTRY(ebp); 1.61 + ENTRY(esp); 1.62 + ENTRY(eip); 1.63 + BLANK(); 1.64 +#undef ENTRY 1.65 + DEFINE(IA32_RT_SIGFRAME_sigcontext, 1.66 + offsetof (struct rt_sigframe32, uc.uc_mcontext)); 1.67 + BLANK(); 1.68 +#endif 1.69 + DEFINE(pbe_address, offsetof(struct pbe, address)); 1.70 + DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address)); 1.71 + DEFINE(pbe_next, offsetof(struct pbe, next)); 1.72 + BLANK(); 1.73 + DEFINE(TSS_ist, offsetof(struct tss_struct, ist)); 1.74 + return 0; 1.75 +}
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/init_task.c Mon Feb 20 14:51:50 2006 +0000 2.3 @@ -0,0 +1,49 @@ 2.4 +#include <linux/mm.h> 2.5 +#include <linux/module.h> 2.6 +#include <linux/sched.h> 2.7 +#include <linux/init.h> 2.8 +#include <linux/init_task.h> 2.9 +#include <linux/fs.h> 2.10 +#include <linux/mqueue.h> 2.11 + 2.12 +#include <asm/uaccess.h> 2.13 +#include <asm/pgtable.h> 2.14 +#include <asm/desc.h> 2.15 + 2.16 +static struct fs_struct init_fs = INIT_FS; 2.17 +static struct files_struct init_files = INIT_FILES; 2.18 +static struct signal_struct init_signals = INIT_SIGNALS(init_signals); 2.19 +static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand); 2.20 +struct mm_struct init_mm = INIT_MM(init_mm); 2.21 + 2.22 +EXPORT_SYMBOL(init_mm); 2.23 + 2.24 +/* 2.25 + * Initial task structure. 2.26 + * 2.27 + * We need to make sure that this is 8192-byte aligned due to the 2.28 + * way process stacks are handled. This is done by having a special 2.29 + * "init_task" linker map entry.. 2.30 + */ 2.31 +union thread_union init_thread_union 2.32 + __attribute__((__section__(".data.init_task"))) = 2.33 + { INIT_THREAD_INFO(init_task) }; 2.34 + 2.35 +/* 2.36 + * Initial task structure. 2.37 + * 2.38 + * All other task structs will be allocated on slabs in fork.c 2.39 + */ 2.40 +struct task_struct init_task = INIT_TASK(init_task); 2.41 + 2.42 +EXPORT_SYMBOL(init_task); 2.43 +/* 2.44 + * per-CPU TSS segments. Threads are completely 'soft' on Linux, 2.45 + * no more per-task TSS's. The TSS size is kept cacheline-aligned 2.46 + * so they are allowed to end up in the .data.cacheline_aligned 2.47 + * section. Since TSS's are completely CPU-local, we want them 2.48 + * on exact cacheline boundaries, to eliminate cacheline ping-pong. 2.49 + */ 2.50 +DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_internodealigned_in_smp = INIT_TSS; 2.51 + 2.52 +#define ALIGN_TO_4K __attribute__((section(".data.init_task")))