Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / arch / x86_64 / kernel / asm-offsets.c
1 /*
2  * Generate definitions needed by assembly language modules.
3  * This code generates raw asm output which is post-processed to extract
4  * and format the required data.
5  */
6
7 #if 0
8 #include <linux/sched.h> 
9 #include <linux/stddef.h>
10 #include <linux/errno.h> 
11 #include <linux/hardirq.h>
12 #include <linux/suspend.h>
13 #include <asm/pda.h>
14 #include <asm/processor.h>
15 #include <asm/segment.h>
16 #include <asm/thread_info.h>
17 #endif
18
19 #include <lwk/task.h>
20 #include <arch/pda.h>
21
22 #define DEFINE(sym, val) \
23         asm volatile("\n->" #sym " %0 " #val : : "i" (val))
24
25 #define BLANK() asm volatile("\n->" : : )
26
27 /**
28  * This is used to automatically count the number of system calls.
29  * A table is generated with one entry for each system call defined in
30  * arch/unistd.h, which contains the list of system calls.
31  */
32 #define __NO_STUBS 1
33 #undef __SYSCALL
34 #undef _ARCH_X86_64_UNISTD_H
35 #define __SYSCALL(nr, sym) [nr] = 1,
36 static char syscalls[] = {
37 #include <arch/unistd.h>
38 };
39
40 int main(void)
41 {
42 #define ENTRY(entry) DEFINE(tsk_ ## entry, offsetof(struct task_struct, entry))
43 #if 0
44         ENTRY(state);
45         ENTRY(flags); 
46         ENTRY(thread); 
47 #endif
48         ENTRY(id);
49         BLANK();
50 #undef ENTRY
51 #define ENTRY(entry) DEFINE(tsk_arch_ ## entry, offsetof(struct task_struct, arch) + offsetof(struct arch_task, entry))
52         ENTRY(flags);
53         ENTRY(addr_limit);
54         BLANK();
55 #undef ENTRY
56 #define ENTRY(entry) DEFINE(tsk_arch_ ## entry, offsetof(struct task_struct, arch) + offsetof(struct arch_task, thread) + offsetof(struct thread_struct, entry))
57         ENTRY(rsp);
58         BLANK();
59 #undef ENTRY
60 #define ENTRY(entry) DEFINE(pda_ ## entry, offsetof(struct x8664_pda, entry))
61         ENTRY(kernelstack); 
62         ENTRY(oldrsp); 
63         ENTRY(pcurrent); 
64         ENTRY(irqcount);
65         ENTRY(cpunumber);
66         ENTRY(irqstackptr);
67         ENTRY(data_offset);
68         BLANK();
69 #undef ENTRY
70 #if 0
71         DEFINE(pbe_address, offsetof(struct pbe, address));
72         DEFINE(pbe_orig_address, offsetof(struct pbe, orig_address));
73         DEFINE(pbe_next, offsetof(struct pbe, next));
74         BLANK();
75         DEFINE(TSS_ist, offsetof(struct tss_struct, ist));
76 #endif
77         BLANK();
78         DEFINE(__NR_syscall_max, sizeof(syscalls) - 1);
79         return 0;
80 }