ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / arch / um / kernel / skas / util / mk_ptregs.c
1 #include <asm/ptrace.h>
2 #include <asm/user.h>
3
4 #define PRINT_REG(name, val) printf("#define HOST_%s %d\n", (name), (val))
5
6 int main(int argc, char **argv)
7 {
8         printf("/* Automatically generated by "
9                "arch/um/kernel/skas/util/mk_ptregs */\n");
10         printf("\n");
11         printf("#ifndef __SKAS_PT_REGS_\n");
12         printf("#define __SKAS_PT_REGS_\n");
13         printf("\n");
14         printf("#define HOST_FRAME_SIZE %d\n", FRAME_SIZE);
15         printf("#define HOST_FP_SIZE %d\n", 
16                sizeof(struct user_i387_struct) / sizeof(unsigned long));
17         printf("#define HOST_XFP_SIZE %d\n", 
18                sizeof(struct user_fxsr_struct) / sizeof(unsigned long));
19
20         PRINT_REG("IP", EIP);
21         PRINT_REG("SP", UESP);
22         PRINT_REG("EFLAGS", EFL);
23         PRINT_REG("EAX", EAX);
24         PRINT_REG("EBX", EBX);
25         PRINT_REG("ECX", ECX);
26         PRINT_REG("EDX", EDX);
27         PRINT_REG("ESI", ESI);
28         PRINT_REG("EDI", EDI);
29         PRINT_REG("EBP", EBP);
30         PRINT_REG("CS", CS);
31         PRINT_REG("SS", SS);
32         PRINT_REG("DS", DS);
33         PRINT_REG("FS", FS);
34         PRINT_REG("ES", ES);
35         PRINT_REG("GS", GS);
36         printf("\n");
37         printf("#endif\n");
38         return(0);
39 }
40
41 /*
42  * Overrides for Emacs so that we follow Linus's tabbing style.
43  * Emacs will notice this stuff at the end of the file and automatically
44  * adjust the settings for this buffer only.  This must remain at the end
45  * of the file.
46  * ---------------------------------------------------------------------------
47  * Local variables:
48  * c-file-style: "linux"
49  * End:
50  */