Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | /* * This program is used to generate definitions needed by * assembly language modules. */ #define MK_DEFS #include <stdio.h> #include <linux/config.h> #include <linux/signal.h> #include <linux/sched.h> #include <linux/head.h> #include <linux/kernel.h> #include <linux/errno.h> #include <linux/string.h> #include <linux/types.h> #include <linux/ptrace.h> #include <linux/mman.h> #include <linux/mm.h> #include <asm/pgtable.h> extern int errno; main(int argc, char *argv[]) { FILE *out; struct task_struct task; struct thread_struct tss; int i; char s[256]; struct pt_regs regs; if (!(out = fopen(argv[1], "w"))) { fprintf(stderr, "Can't create output file: %s\n", strerror(errno)); exit(1); } fprintf(out, "/*\n"); fprintf(out, " * WARNING! This file is automatically generated - DO NOT EDIT!\n"); fprintf(out, " */\n"); put_line(out, "STATE", (int)&task.state-(int)&task); put_line(out, "COUNTER", (int)&task.counter-(int)&task); put_line(out, "BLOCKED", (int)&task.blocked-(int)&task); put_line(out, "SIGNAL", (int)&task.signal-(int)&task); put_line(out, "KERNEL_STACK_PAGE", (int)&task.kernel_stack_page-(int)&task); put_line(out, "TSS", (int)&task.tss-(int)&task); put_line(out, "KSP", (int)&tss.ksp-(int)&tss); put_line(out, "LAST_PC", (int)&tss.last_pc-(int)&tss); put_line(out, "USER_STACK", (int)&tss.user_stack-(int)&tss); put_line(out, "PT_REGS", (int)&tss.regs-(int)&tss); put_line(out, "PF_TRACESYS", PF_TRACESYS); put_line(out, "TASK_FLAGS", (int)&task.flags-(int)&task); put_line(out, "MMU_SEG0", (int)&tss.segs[0]-(int)&tss); put_line(out, "MMU_SEG1", (int)&tss.segs[1]-(int)&tss); put_line(out, "MMU_SEG2", (int)&tss.segs[2]-(int)&tss); put_line(out, "MMU_SEG3", (int)&tss.segs[3]-(int)&tss); put_line(out, "MMU_SEG4", (int)&tss.segs[4]-(int)&tss); put_line(out, "MMU_SEG5", (int)&tss.segs[5]-(int)&tss); put_line(out, "MMU_SEG6", (int)&tss.segs[6]-(int)&tss); put_line(out, "MMU_SEG7", (int)&tss.segs[7]-(int)&tss); put_line(out, "MMU_SEG8", (int)&tss.segs[8]-(int)&tss); put_line(out, "MMU_SEG9", (int)&tss.segs[9]-(int)&tss); put_line(out, "MMU_SEG10", (int)&tss.segs[10]-(int)&tss); put_line(out, "MMU_SEG11", (int)&tss.segs[11]-(int)&tss); put_line(out, "MMU_SEG12", (int)&tss.segs[12]-(int)&tss); put_line(out, "MMU_SEG13", (int)&tss.segs[13]-(int)&tss); put_line(out, "MMU_SEG14", (int)&tss.segs[14]-(int)&tss); put_line(out, "MMU_SEG15", (int)&tss.segs[15]-(int)&tss); put_line(out, "TSS_EXPC", (int)&tss.expc-(int)&tss); put_line(out, "TSS_EXCOUNT", (int)&tss.excount-(int)&tss); put_line(out, "TSS_FPR0", (int)&tss.fpr[0]-(int)&tss); put_line(out, "TSS_FPR1", (int)&tss.fpr[1]-(int)&tss); put_line(out, "TSS_FPR2", (int)&tss.fpr[2]-(int)&tss); put_line(out, "TSS_FPR3", (int)&tss.fpr[3]-(int)&tss); put_line(out, "TSS_FPR4", (int)&tss.fpr[4]-(int)&tss); put_line(out, "TSS_FPR5", (int)&tss.fpr[5]-(int)&tss); put_line(out, "TSS_FPR6", (int)&tss.fpr[6]-(int)&tss); put_line(out, "TSS_FPR7", (int)&tss.fpr[7]-(int)&tss); put_line(out, "TSS_FPR8", (int)&tss.fpr[8]-(int)&tss); put_line(out, "TSS_FPR9", (int)&tss.fpr[9]-(int)&tss); put_line(out, "TSS_FPR10", (int)&tss.fpr[10]-(int)&tss); put_line(out, "TSS_FPR11", (int)&tss.fpr[11]-(int)&tss); put_line(out, "TSS_FPR12", (int)&tss.fpr[12]-(int)&tss); put_line(out, "TSS_FPR13", (int)&tss.fpr[13]-(int)&tss); put_line(out, "TSS_FPR14", (int)&tss.fpr[14]-(int)&tss); put_line(out, "TSS_FPR15", (int)&tss.fpr[15]-(int)&tss); put_line(out, "TSS_FPR16", (int)&tss.fpr[16]-(int)&tss); put_line(out, "TSS_FPR17", (int)&tss.fpr[17]-(int)&tss); put_line(out, "TSS_FPR18", (int)&tss.fpr[18]-(int)&tss); put_line(out, "TSS_FPR19", (int)&tss.fpr[19]-(int)&tss); put_line(out, "TSS_FPR20", (int)&tss.fpr[20]-(int)&tss); put_line(out, "TSS_FPR21", (int)&tss.fpr[21]-(int)&tss); put_line(out, "TSS_FPR22", (int)&tss.fpr[22]-(int)&tss); put_line(out, "TSS_FPR23", (int)&tss.fpr[23]-(int)&tss); put_line(out, "TSS_FPR24", (int)&tss.fpr[24]-(int)&tss); put_line(out, "TSS_FPR25", (int)&tss.fpr[25]-(int)&tss); put_line(out, "TSS_FPR26", (int)&tss.fpr[26]-(int)&tss); put_line(out, "TSS_FPR27", (int)&tss.fpr[27]-(int)&tss); put_line(out, "TSS_FPR28", (int)&tss.fpr[28]-(int)&tss); put_line(out, "TSS_FPR29", (int)&tss.fpr[29]-(int)&tss); put_line(out, "TSS_FPR30", (int)&tss.fpr[30]-(int)&tss); put_line(out, "TSS_FPR31", (int)&tss.fpr[31]-(int)&tss); put_line(out, "TSS_FP_USED", (int)&tss.fp_used-(int)&tss); /* Interrupt register frame */ put_line(out, "INT_FRAME_SIZE", sizeof(regs)); put_line(out, "GPR0", (int)®s.gpr[0]-(int)®s); put_line(out, "GPR1", (int)®s.gpr[1]-(int)®s); put_line(out, "GPR2", (int)®s.gpr[2]-(int)®s); put_line(out, "GPR3", (int)®s.gpr[3]-(int)®s); put_line(out, "GPR4", (int)®s.gpr[4]-(int)®s); put_line(out, "GPR5", (int)®s.gpr[5]-(int)®s); put_line(out, "GPR6", (int)®s.gpr[6]-(int)®s); put_line(out, "GPR7", (int)®s.gpr[7]-(int)®s); put_line(out, "GPR8", (int)®s.gpr[8]-(int)®s); put_line(out, "GPR9", (int)®s.gpr[9]-(int)®s); put_line(out, "GPR10", (int)®s.gpr[10]-(int)®s); put_line(out, "GPR11", (int)®s.gpr[11]-(int)®s); put_line(out, "GPR12", (int)®s.gpr[12]-(int)®s); put_line(out, "GPR13", (int)®s.gpr[13]-(int)®s); put_line(out, "GPR14", (int)®s.gpr[14]-(int)®s); put_line(out, "GPR15", (int)®s.gpr[15]-(int)®s); put_line(out, "GPR16", (int)®s.gpr[16]-(int)®s); put_line(out, "GPR17", (int)®s.gpr[17]-(int)®s); put_line(out, "GPR18", (int)®s.gpr[18]-(int)®s); put_line(out, "GPR19", (int)®s.gpr[19]-(int)®s); put_line(out, "GPR20", (int)®s.gpr[20]-(int)®s); put_line(out, "GPR21", (int)®s.gpr[21]-(int)®s); put_line(out, "GPR22", (int)®s.gpr[22]-(int)®s); put_line(out, "GPR23", (int)®s.gpr[23]-(int)®s); put_line(out, "GPR24", (int)®s.gpr[24]-(int)®s); put_line(out, "GPR25", (int)®s.gpr[25]-(int)®s); put_line(out, "GPR26", (int)®s.gpr[26]-(int)®s); put_line(out, "GPR27", (int)®s.gpr[27]-(int)®s); put_line(out, "GPR28", (int)®s.gpr[28]-(int)®s); put_line(out, "GPR29", (int)®s.gpr[29]-(int)®s); put_line(out, "GPR30", (int)®s.gpr[30]-(int)®s); put_line(out, "GPR31", (int)®s.gpr[31]-(int)®s); #if 0 for ( i = 0 ; i <= 31 ; i++) { sprintf(s,"FPR%d",i); put_line(out, s, (int)®s.fpr[i]-(int)®s); } #endif put_line(out, "FPCSR", (int)®s.fpcsr-(int)®s); /* Note: these symbols include "_" because they overlap with special register names */ put_line(out, "_NIP", (int)®s.nip-(int)®s); put_line(out, "_MSR", (int)®s.msr-(int)®s); /* put_line(out, "_SRR1", (int)®s.srr1-(int)®s); put_line(out, "_SRR0", (int)®s.srr0-(int)®s); */ put_line(out, "_CTR", (int)®s.ctr-(int)®s); put_line(out, "_LINK", (int)®s.link-(int)®s); put_line(out, "_CCR", (int)®s.ccr-(int)®s); put_line(out, "_XER", (int)®s.xer-(int)®s); put_line(out, "_DAR", (int)®s.dar-(int)®s); put_line(out, "_DSISR", (int)®s.dsisr-(int)®s); put_line(out, "_HASH1", (int)®s.hash1-(int)®s); put_line(out, "_HASH2", (int)®s.hash2-(int)®s); put_line(out, "_IMISS", (int)®s.imiss-(int)®s); put_line(out, "_DMISS", (int)®s.dmiss-(int)®s); put_line(out, "_ICMP", (int)®s.icmp-(int)®s); put_line(out, "_DCMP", (int)®s.dcmp-(int)®s); put_line(out, "ORIG_GPR3", (int)®s.orig_gpr3-(int)®s); put_line(out, "RESULT", (int)®s.result-(int)®s); put_line(out, "TRAP", (int)®s.trap-(int)®s); put_line(out, "MARKER", (int)®s.marker-(int)®s); exit(0); } put_line(FILE *out, char *name, int offset) { fprintf(out, "#define %s %d\n", name, offset); } |