target-sparc: Use error_report() for CPU error reporting
Replace non-debug fprintf() with error_report(). Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
		
							parent
							
								
									94a444b295
								
							
						
					
					
						commit
						db5d39f786
					
				@ -18,6 +18,7 @@
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "cpu.h"
 | 
					#include "cpu.h"
 | 
				
			||||||
 | 
					#include "qemu/error-report.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//#define DEBUG_FEATURES
 | 
					//#define DEBUG_FEATURES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -506,7 +507,7 @@ static void add_flagname_to_bitmaps(const char *flagname, uint32_t *features)
 | 
				
			|||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    fprintf(stderr, "CPU feature %s not found\n", flagname);
 | 
					    error_report("CPU feature %s not found", flagname);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
					static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
				
			||||||
@ -545,7 +546,7 @@ static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                iu_version = strtoll(val, &err, 0);
 | 
					                iu_version = strtoll(val, &err, 0);
 | 
				
			||||||
                if (!*val || *err) {
 | 
					                if (!*val || *err) {
 | 
				
			||||||
                    fprintf(stderr, "bad numerical value %s\n", val);
 | 
					                    error_report("bad numerical value %s", val);
 | 
				
			||||||
                    goto error;
 | 
					                    goto error;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                cpu_def->iu_version = iu_version;
 | 
					                cpu_def->iu_version = iu_version;
 | 
				
			||||||
@ -557,7 +558,7 @@ static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                fpu_version = strtol(val, &err, 0);
 | 
					                fpu_version = strtol(val, &err, 0);
 | 
				
			||||||
                if (!*val || *err) {
 | 
					                if (!*val || *err) {
 | 
				
			||||||
                    fprintf(stderr, "bad numerical value %s\n", val);
 | 
					                    error_report("bad numerical value %s", val);
 | 
				
			||||||
                    goto error;
 | 
					                    goto error;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                cpu_def->fpu_version = fpu_version;
 | 
					                cpu_def->fpu_version = fpu_version;
 | 
				
			||||||
@ -569,7 +570,7 @@ static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                mmu_version = strtol(val, &err, 0);
 | 
					                mmu_version = strtol(val, &err, 0);
 | 
				
			||||||
                if (!*val || *err) {
 | 
					                if (!*val || *err) {
 | 
				
			||||||
                    fprintf(stderr, "bad numerical value %s\n", val);
 | 
					                    error_report("bad numerical value %s", val);
 | 
				
			||||||
                    goto error;
 | 
					                    goto error;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                cpu_def->mmu_version = mmu_version;
 | 
					                cpu_def->mmu_version = mmu_version;
 | 
				
			||||||
@ -582,7 +583,7 @@ static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
				
			|||||||
                nwindows = strtol(val, &err, 0);
 | 
					                nwindows = strtol(val, &err, 0);
 | 
				
			||||||
                if (!*val || *err || nwindows > MAX_NWINDOWS ||
 | 
					                if (!*val || *err || nwindows > MAX_NWINDOWS ||
 | 
				
			||||||
                    nwindows < MIN_NWINDOWS) {
 | 
					                    nwindows < MIN_NWINDOWS) {
 | 
				
			||||||
                    fprintf(stderr, "bad numerical value %s\n", val);
 | 
					                    error_report("bad numerical value %s", val);
 | 
				
			||||||
                    goto error;
 | 
					                    goto error;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                cpu_def->nwindows = nwindows;
 | 
					                cpu_def->nwindows = nwindows;
 | 
				
			||||||
@ -590,12 +591,12 @@ static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model)
 | 
				
			|||||||
                fprintf(stderr, "nwindows %d\n", nwindows);
 | 
					                fprintf(stderr, "nwindows %d\n", nwindows);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                fprintf(stderr, "unrecognized feature %s\n", featurestr);
 | 
					                error_report("unrecognized feature %s", featurestr);
 | 
				
			||||||
                goto error;
 | 
					                goto error;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            fprintf(stderr, "feature string `%s' not in format "
 | 
					            error_report("feature string `%s' not in format "
 | 
				
			||||||
                    "(+feature|-feature|feature=xyz)\n", featurestr);
 | 
					                         "(+feature|-feature|feature=xyz)", featurestr);
 | 
				
			||||||
            goto error;
 | 
					            goto error;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        featurestr = strtok(NULL, ",");
 | 
					        featurestr = strtok(NULL, ",");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user