Changeset 1660


Ignore:
Timestamp:
02/10/12 23:05:45 (2 years ago)
Author:
philmoz
Message:

Merged revision(s) 1659 from branches/release-1_0:

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/platform/makefile_sub.inc

    r1507 r1660  
    3636        rm -f stubs_entry.S.err 
    3737        if [ -s $(TARGET_PRIMARY) ] ; then \ 
    38           $(topdir)tools/finsig_$(PLATFORMOS) $(TARGET_PRIMARY) $(ROMBASEADDR) > stubs_entry.S ; \ 
     38          $(topdir)tools/finsig_$(PLATFORMOS) $(TARGET_PRIMARY) $(ROMBASEADDR) stubs_entry.S ; \ 
    3939        else \ 
    4040          echo CAUTION! \'stubs_entry.S\' is not updated due to target firmware binary not found! ; \ 
  • trunk/tools/finsig_dryos.c

    r1636 r1660  
    2222// Buffer output into header and body sections 
    2323 
     24FILE    *out_fp; 
    2425char    out_buf[32*1024] = ""; 
    2526int             out_len = 0; 
     
    5354{ 
    5455        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    } 
    5761} 
    5862 
     
    6165void usage(char *err) 
    6266{ 
    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); 
    6470    exit(1); 
    6571} 
     
    37913797    clock_t t1 = clock(); 
    37923798 
    3793     if (argc != 3) 
     3799    if (argc != 4) 
    37943800        usage("args"); 
     3801 
     3802    out_fp = fopen(argv[3],"w"); 
     3803    if (out_fp == NULL) usage("failed to open outputfile"); 
    37953804 
    37963805    //load_ignore_list(); 
     
    38743883    find_other_vals(&fw); 
    38753884 
    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); 
    38773886         
    38783887        write_output(); 
    38793888         
     3889    fclose(out_fp); 
     3890 
    38803891    return ret; 
    38813892} 
  • trunk/tools/finsig_vxworks.c

    r1291 r1660  
    8989} 
    9090 
     91FILE *out_fp; 
     92 
    9193void usage() 
    9294{ 
    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"); 
    9497    exit(1); 
    9598} 
     
    112115    clock_t t1 = clock(); 
    113116 
    114     if (argc != 3) 
     117    if (argc != 4) 
    115118        usage(); 
     119 
     120    out_fp = fopen(argv[3],"w"); 
     121    if (out_fp == NULL) usage(); 
    116122 
    117123    f = fopen(argv[1], "r+b"); 
     
    122128    base = strtoul(argv[2], NULL, 0); 
    123129 
    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"); 
    126132 
    127133    fseek(f,0,SEEK_END); 
     
    206212                        count ++; 
    207213                        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); 
    209215                            break; 
    210216                        } 
     
    222228        // find best match and report results 
    223229        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); 
    225231            ret = 1; 
    226232        } else { 
     
    230236 
    231237            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); 
    235241 
    236242            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); 
    238244            } 
    239245        } 
     
    242248    clock_t t2 = clock(); 
    243249 
    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); 
    245253 
    246254    return ret; 
Note: See TracChangeset for help on using the changeset viewer.