diff options
| author | Burt P <pburt0@gmail.com> | 2017-07-09 22:36:19 -0500 | 
|---|---|---|
| committer | Leandro Pereira <leandro@hardinfo.org> | 2017-07-12 19:38:41 -0700 | 
| commit | 17651fbf35c8e6a6d16c5a31ddb7ab0ef03daeec (patch) | |
| tree | bdf8aae3053b4f7e173d5077a81ed00b64009c73 | |
| parent | 269b16b3801c0e3fd05eb7d8c9d1551ea8172529 (diff) | |
m68k: fixes, add test
Signed-off-by: Burt P <pburt0@gmail.com>
| -rw-r--r-- | includes/m68k/processor-platform.h | 2 | ||||
| -rw-r--r-- | modules/devices/m68k/processor.c | 22 | ||||
| -rw-r--r-- | test/data/m68k_sun3_cpuinfo | 6 | ||||
| -rw-r--r-- | test/test.sh | 3 | 
4 files changed, 24 insertions, 9 deletions
diff --git a/includes/m68k/processor-platform.h b/includes/m68k/processor-platform.h index 40bd2f96..9aea1dfe 100644 --- a/includes/m68k/processor-platform.h +++ b/includes/m68k/processor-platform.h @@ -23,7 +23,7 @@ struct _Processor {      gchar *model_name;      gfloat bogomips, cpu_mhz; -    gchar *has_fpu; +    gchar *fpu_name, *mmu_name, *calibration;  };  #endif	/* __PROCESSOR_PLATFORM_H__ */ diff --git a/modules/devices/m68k/processor.c b/modules/devices/m68k/processor.c index 995e34af..0dd4c62f 100644 --- a/modules/devices/m68k/processor.c +++ b/modules/devices/m68k/processor.c @@ -51,10 +51,11 @@ processor_scan(void)              tmp[1] = g_strstrip(tmp[1]);              get_str("CPU", processor->model_name); +            get_str("MMU", processor->mmu_name); +            get_str("FPU", processor->fpu_name);              get_float("Clocking", processor->cpu_mhz); -            get_float("bogomips", processor->bogomips); - -            get_str("FPU", processor->has_fpu); /* not used? */ +            get_float("BogoMips", processor->bogomips); +            get_str("Calibration", processor->calibration);          }          g_strfreev(tmp);      } @@ -74,14 +75,21 @@ processor_get_info(GSList *processors)  {      Processor *processor = (Processor *)processors->data; -    return g_strdup_printf("[Processor]\n" -                        "%s=%s\n" +    return g_strdup_printf("[%s]\n" +                        "%s=%s\n"      /* cpu */ +                        "%s=%s\n"      /* mmu */ +                        "%s=%s\n"      /* fpu */                          "%s=%.2f %s\n" /* frequency */                          "%s=%.2f\n"    /* bogomips */ -                        "%s=%s\n",     /* byte order */ +                        "%s=%s\n"      /* byte order */ +                        "%s=%s\n",     /* calibration */ +                    _("Processor"),                      _("Model"), processor->model_name, +                    _("MMU"), processor->mmu_name, +                    _("FPU"), processor->fpu_name,                      _("Frequency"), processor->cpu_mhz, _("MHz"),                      _("BogoMips"), processor->bogomips, -                    _("Byte Order"), byte_order_str() +                    _("Byte Order"), byte_order_str(), +                    _("Calibration"), processor->calibration                          );  } diff --git a/test/data/m68k_sun3_cpuinfo b/test/data/m68k_sun3_cpuinfo new file mode 100644 index 00000000..8c9c8d54 --- /dev/null +++ b/test/data/m68k_sun3_cpuinfo @@ -0,0 +1,6 @@ +CPU:            68020 +MMU:            Sun-3 +FPU:            68881 +Clocking:       19.9MHz +BogoMips:       4.97 +Calibration: 24896 loops diff --git a/test/test.sh b/test/test.sh index c0d6080b..89254a34 100644 --- a/test/test.sh +++ b/test/test.sh @@ -18,7 +18,8 @@ do_test() {  #do_test mips data/mips_loongson_cpuinfo  #do_test alpha data/alpha_as_cpuinfo  #do_test parisc data/parisc_hppa_fortex4_cpuinfo -do_test ia64 data/ia64_x2_cpuinfo +#do_test ia64 data/ia64_x2_cpuinfo +do_test m68k data/m68k_sun3_cpuinfo  | 
