X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=kitten%2Farch%2Fx86_64%2Fkernel%2Finit_task.c;fp=kitten%2Farch%2Fx86_64%2Fkernel%2Finit_task.c;h=03441f5c749ac554455238b2108e57720eaef942;hb=66a1a4c7a9edcd7d8bc207aca093d694a6e6b5b2;hp=0000000000000000000000000000000000000000;hpb=f7cf9c19ecb0a589dd45ae0d2c91814bd3c2acc2;p=palacios-OLD.git diff --git a/kitten/arch/x86_64/kernel/init_task.c b/kitten/arch/x86_64/kernel/init_task.c new file mode 100644 index 0000000..03441f5 --- /dev/null +++ b/kitten/arch/x86_64/kernel/init_task.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include +#include + +struct aspace bootstrap_aspace = { + BOOTSTRAP_ASPACE(bootstrap_aspace) + .arch = { + .pgd = (xpte_t *) init_level4_pgt + } +}; + +union task_union bootstrap_task_union + __attribute__((__section__(".data.bootstrap_task"))) = + { + /* Initialize task_union.task_info */ + { + /* arch independent portion */ + BOOTSTRAP_TASK(bootstrap_task_union.task_info) + + /* x86_64 specific portion */ + .arch = { + .addr_limit = PAGE_OFFSET + } + } + }; + +/** + * Each CPU gets its own Task State Segment (TSS) structure. Tasks are + * completely 'soft' in the LWK, no more per-task TSS's and hardware task + * switching... we switch tasks completely in software. The TSS size is kept + * cacheline-aligned so they are allowed to end up in the + * .data.cacheline_aligned section. Since TSS's are completely CPU-local, we + * want them on exact cacheline boundaries, to eliminate cacheline ping-pong. + */ +DEFINE_PER_CPU(struct tss_struct, tss) +____cacheline_internodealigned_in_smp = BOOTSTRAP_TSS; +