Changeset 1659
- Timestamp:
- 02/10/12 23:04:06 (16 months ago)
- Location:
- branches/release-1_0
- Files:
-
- 3 edited
-
platform/makefile_sub.inc (modified) (1 diff)
-
tools/finsig_dryos.c (modified) (5 diffs)
-
tools/finsig_vxworks.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-1_0/platform/makefile_sub.inc
r1366 r1659 45 45 rm -f stubs_entry.S.err 46 46 if [ -s $(TARGET_PRIMARY) ] ; then \ 47 $(topdir)tools/finsig_$(PLATFORMOS) $(TARGET_PRIMARY) $(ROMBASEADDR) >stubs_entry.S ; \47 $(topdir)tools/finsig_$(PLATFORMOS) $(TARGET_PRIMARY) $(ROMBASEADDR) stubs_entry.S ; \ 48 48 else \ 49 49 echo CAUTION! \'stubs_entry.S\' is not updated due to target firmware binary not found! ; \ -
branches/release-1_0/tools/finsig_dryos.c
r1635 r1659 22 22 // Buffer output into header and body sections 23 23 24 FILE *out_fp; 24 25 char out_buf[32*1024] = ""; 25 26 int out_len = 0; … … 53 54 { 54 55 add_blankline(); 55 printf("%s",hdr_buf); 56 printf("%s",out_buf); 56 if (out_fp) 57 { 58 fprintf(out_fp,"%s",hdr_buf); 59 fprintf(out_fp,"%s",out_buf); 60 } 57 61 } 58 62 … … 61 65 void usage(char *err) 62 66 { 63 printf("finsig <primary> <base> - Error = %s\n",err); 67 bprintf("finsig <primary> <base> <outputfilename> - Error = %s\n",err); 68 write_output(); 69 fprintf(stderr,"finsig <primary> <base> <outputfilename> - Error = %s\n",err); 64 70 exit(1); 65 71 } … … 3791 3797 clock_t t1 = clock(); 3792 3798 3793 if (argc != 3)3799 if (argc != 4) 3794 3800 usage("args"); 3801 3802 out_fp = fopen(argv[3],"w"); 3803 if (out_fp == NULL) usage("failed to open outputfile"); 3795 3804 3796 3805 //load_ignore_list(); … … 3874 3883 find_other_vals(&fw); 3875 3884 3876 fprintf(stderr,"Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC);3885 printf("Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC); 3877 3886 3878 3887 write_output(); 3879 3888 3889 fclose(out_fp); 3890 3880 3891 return ret; 3881 3892 } -
branches/release-1_0/tools/finsig_vxworks.c
r1291 r1659 89 89 } 90 90 91 FILE *out_fp; 92 91 93 void usage() 92 94 { 93 printf("finsig <primary> <base>\n"); 95 if (out_fp) fprintf(out_fp,"finsig <primary> <base> <outputfilename>\n"); 96 fprintf(stderr,"finsig <primary> <base> <outputfilename>\n"); 94 97 exit(1); 95 98 } … … 112 115 clock_t t1 = clock(); 113 116 114 if (argc != 3)117 if (argc != 4) 115 118 usage(); 119 120 out_fp = fopen(argv[3],"w"); 121 if (out_fp == NULL) usage(); 116 122 117 123 f = fopen(argv[1], "r+b"); … … 122 128 base = strtoul(argv[2], NULL, 0); 123 129 124 printf("// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!\n");125 printf("#include \"stubs_asm.h\"\n\n");130 fprintf(out_fp,"// !!! THIS FILE IS GENERATED. DO NOT EDIT. !!!\n"); 131 fprintf(out_fp,"#include \"stubs_asm.h\"\n\n"); 126 132 127 133 fseek(f,0,SEEK_END); … … 206 212 count ++; 207 213 if (count >= MAX_MATCHES){ 208 printf("// WARNING: too many matches for %s!\n", func_list[k].name);214 fprintf(out_fp,"// WARNING: too many matches for %s!\n", func_list[k].name); 209 215 break; 210 216 } … … 222 228 // find best match and report results 223 229 if (count == 0){ 224 printf("// ERROR: %s is not found!\n", curr_name);230 fprintf(out_fp,"// ERROR: %s is not found!\n", curr_name); 225 231 ret = 1; 226 232 } else { … … 230 236 231 237 if (matches->fail > 0) 232 printf("// Best match: %d%%\n", matches->success*100/(matches->success+matches->fail));233 234 printf("NSTUB(%s, 0x%x)\n", curr_name, matches->ptr);238 fprintf(out_fp,"// Best match: %d%%\n", matches->success*100/(matches->success+matches->fail)); 239 240 fprintf(out_fp,"NSTUB(%s, 0x%x)\n", curr_name, matches->ptr); 235 241 236 242 for (i=1;i<count && matches[i].fail==matches[0].fail;i++){ 237 printf("// ALT: NSTUB(%s, 0x%x) // %d/%d\n", curr_name, matches[i].ptr, matches[i].success, matches[i].fail);243 fprintf(out_fp,"// ALT: NSTUB(%s, 0x%x) // %d/%d\n", curr_name, matches[i].ptr, matches[i].success, matches[i].fail); 238 244 } 239 245 } … … 242 248 clock_t t2 = clock(); 243 249 244 fprintf(stderr,"Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC); 250 printf("Time to generate stubs %.2f seconds\n",(double)(t2-t1)/(double)CLOCKS_PER_SEC); 251 252 fclose(out_fp); 245 253 246 254 return ret;
Note: See TracChangeset
for help on using the changeset viewer.