Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 1 | #include <stdio.h> |
| 2 | #include <asm/types.h> |
| 3 | /* For some reason, x86_64 nowhere defines u64 and u32, even though they're |
| 4 | * used throughout the headers. |
| 5 | */ |
| 6 | typedef __u64 u64; |
| 7 | typedef __u32 u32; |
| 8 | #include <asm/user.h> |
| 9 | |
| 10 | int main(int argc, char **argv) |
| 11 | { |
| 12 | printf("/*\n"); |
| 13 | printf(" * Generated by mk_user_constants\n"); |
| 14 | printf(" */\n"); |
| 15 | printf("\n"); |
| 16 | printf("#ifndef __UM_USER_CONSTANTS_H\n"); |
| 17 | printf("#define __UM_USER_CONSTANTS_H\n"); |
| 18 | printf("\n"); |
| 19 | /* I'd like to use FRAME_SIZE from ptrace.h here, but that's wrong on |
| 20 | * x86_64 (216 vs 168 bytes). user_regs_struct is the correct size on |
| 21 | * both x86_64 and i386. |
| 22 | */ |
| 23 | printf("#define UM_FRAME_SIZE %d\n", (int) sizeof(struct user_regs_struct)); |
| 24 | |
| 25 | printf("\n"); |
| 26 | printf("#endif\n"); |
| 27 | |
| 28 | return(0); |
| 29 | } |