diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-23 16:03:40 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2002-05-23 16:03:40 +0000 |
commit | 02aa20de070fcba35b418e69f8487dd1f8e9f712 (patch) | |
tree | 311801584c3b7eacb61a5d6c52444db647398fc6 /sys/arch/hppa | |
parent | 172dc47c27d1781bfc173062123aaa8356a4bb99 (diff) |
fetch fpu id per the book (even it works otherwise), also, hppa_mod_info() always returns some string; idea by fredette@
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/dev/cpu.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/arch/hppa/dev/cpu.c b/sys/arch/hppa/dev/cpu.c index 9f3ec4ff12d..661741c3be6 100644 --- a/sys/arch/hppa/dev/cpu.c +++ b/sys/arch/hppa/dev/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.17 2002/05/08 03:16:08 mickey Exp $ */ +/* $OpenBSD: cpu.c,v 1.18 2002/05/23 16:03:39 mickey Exp $ */ /* * Copyright (c) 1998-2002 Michael Shalayeff @@ -139,21 +139,18 @@ cpuattach(parent, self, aux) printf("MHz, "); if (fpu_enable) { - const char *name; - u_int ver; + u_int32_t ver[2]; mtctl(fpu_enable, CR_CCR); __asm volatile( + "fstds %%fr0,0(%0)\n\t" "copr,0,0\n\t" - "fstws %%fr0,0(%0)" + "fstds %%fr0,0(%0)" :: "r" (&ver) : "memory"); mtctl(0, CR_CCR); - ver = HPPA_FPUVER(ver); - name = hppa_mod_info(HPPA_TYPE_FPU, ver >> 5); - if (name) - printf("FPU %s rev %d", name, ver & 0x1f); - else - printf("FPU v%d.%02d", ver >> 5, ver & 0x1f); + ver[0] = HPPA_FPUVER(ver[0]); + printf("FPU %s rev %d", + hppa_mod_info(HPPA_TYPE_FPU, ver[0] >> 5), ver[0] & 0x1f); } /* if (pdc_model.sh) |