Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2003 PathScale, Inc. |
| 3 | * |
| 4 | * Licensed under the GPL |
| 5 | */ |
| 6 | |
| 7 | #include <stdio.h> |
| 8 | #define __FRAME_OFFSETS |
| 9 | #include <asm/ptrace.h> |
| 10 | |
| 11 | #define PRINT_REG(name, val) \ |
| 12 | printf("#define HOST_%s (%d / sizeof(unsigned long))\n", (name), (val)) |
| 13 | |
| 14 | int main(int argc, char **argv) |
| 15 | { |
| 16 | printf("/* Automatically generated by " |
| 17 | "arch/um/kernel/skas/util/mk_ptregs */\n"); |
| 18 | printf("\n"); |
| 19 | printf("#ifndef __SKAS_PT_REGS_\n"); |
| 20 | printf("#define __SKAS_PT_REGS_\n"); |
| 21 | printf("#define HOST_FRAME_SIZE (%d / sizeof(unsigned long))\n", |
| 22 | FRAME_SIZE); |
| 23 | PRINT_REG("RBX", RBX); |
| 24 | PRINT_REG("RCX", RCX); |
| 25 | PRINT_REG("RDI", RDI); |
| 26 | PRINT_REG("RSI", RSI); |
| 27 | PRINT_REG("RDX", RDX); |
| 28 | PRINT_REG("RBP", RBP); |
| 29 | PRINT_REG("RAX", RAX); |
| 30 | PRINT_REG("R8", R8); |
| 31 | PRINT_REG("R9", R9); |
| 32 | PRINT_REG("R10", R10); |
| 33 | PRINT_REG("R11", R11); |
| 34 | PRINT_REG("R12", R12); |
| 35 | PRINT_REG("R13", R13); |
| 36 | PRINT_REG("R14", R14); |
| 37 | PRINT_REG("R15", R15); |
| 38 | PRINT_REG("ORIG_RAX", ORIG_RAX); |
| 39 | PRINT_REG("CS", CS); |
| 40 | PRINT_REG("SS", SS); |
| 41 | PRINT_REG("EFLAGS", EFLAGS); |
| 42 | #if 0 |
| 43 | PRINT_REG("FS", FS); |
| 44 | PRINT_REG("GS", GS); |
| 45 | PRINT_REG("DS", DS); |
| 46 | PRINT_REG("ES", ES); |
| 47 | #endif |
| 48 | |
| 49 | PRINT_REG("IP", RIP); |
| 50 | PRINT_REG("SP", RSP); |
| 51 | printf("#define HOST_FP_SIZE 0\n"); |
| 52 | printf("#define HOST_XFP_SIZE 0\n"); |
| 53 | printf("\n"); |
| 54 | printf("\n"); |
| 55 | printf("#endif\n"); |
| 56 | return(0); |
| 57 | } |
| 58 | |
| 59 | /* |
| 60 | * Overrides for Emacs so that we follow Linus's tabbing style. |
| 61 | * Emacs will notice this stuff at the end of the file and automatically |
| 62 | * adjust the settings for this buffer only. This must remain at the end |
| 63 | * of the file. |
| 64 | * --------------------------------------------------------------------------- |
| 65 | * Local variables: |
| 66 | * c-file-style: "linux" |
| 67 | * End: |
| 68 | */ |