diff options
author | jake <jake@FreeBSD.org> | 2001-09-30 19:45:34 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-09-30 19:45:34 +0000 |
commit | 5e37317159125f5e57e6a3e16d82cbc3b3ad18dd (patch) | |
tree | 7607a4bb0f9195dca1e48a8d7946a0c2ecc0faf2 /sys/sparc64 | |
parent | 31f25c3f3d9fc4da3f35b87f7e848d186b01221f (diff) | |
download | FreeBSD-src-5e37317159125f5e57e6a3e16d82cbc3b3ad18dd.zip FreeBSD-src-5e37317159125f5e57e6a3e16d82cbc3b3ad18dd.tar.gz |
Use %ver to identify the cpu instead of openfirmware.
Submitted by: robert
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/md_var.h | 2 | ||||
-rw-r--r-- | sys/sparc64/sparc64/identcpu.c | 71 |
2 files changed, 72 insertions, 1 deletions
diff --git a/sys/sparc64/include/md_var.h b/sys/sparc64/include/md_var.h index 7a0733b..4f8650a 100644 --- a/sys/sparc64/include/md_var.h +++ b/sys/sparc64/include/md_var.h @@ -43,8 +43,8 @@ struct thread; struct reg; void cpu_halt(void); +void cpu_identify(u_int clock); void cpu_reset(void); -int fill_dbregs(struct thread *td, struct dbreg *dbregs); int fill_fpregs(struct thread *td, struct fpreg *fpregs); int fill_regs(struct thread *td, struct reg *regs); void swi_vm(void *v); diff --git a/sys/sparc64/sparc64/identcpu.c b/sys/sparc64/sparc64/identcpu.c new file mode 100644 index 0000000..f1d7fa3 --- /dev/null +++ b/sys/sparc64/sparc64/identcpu.c @@ -0,0 +1,71 @@ +/* + * Initial implementation: + * Copyright (c) 2001 Robert Drehmel + * All rights reserved. + * + * As long as the above copyright statement and this notice remain + * unchanged, you can do what ever you want with this file. + * + * $FreeBSD$ + */ +#include <sys/param.h> +#include <sys/systm.h> + +#include <machine/cpu.h> +#include <machine/cpufunc.h> +#include <machine/ver.h> + +void +cpu_identify(unsigned int freq) +{ + const char *manus; + const char *impls; + unsigned long vers; + + manus = NULL; + impls = NULL; + vers = rdpr(ver); + + switch (VER_MANUF(vers)) { + case 0x04: + manus = "HAL"; + break; + case 0x13: + case 0x17: + manus = "Sun Microsystems"; + break; + } + switch (VER_IMPL(vers)) { + case 0x01: + impls = "SPARC64"; + break; + case 0x10: + impls = "UltraSparc-I"; + break; + case 0x11: + impls = "UltraSparc-II"; + break; + case 0x12: + impls = "UltraSparc-IIi"; + break; + case 0x13: + /* V9 Manual says `UltraSparc-e'. I assume this is wrong. */ + impls = "UltraSparc-IIe"; + break; + } + if (manus == NULL || impls == NULL) { + printf( + "CPU: unknown; please e-mail the following value together\n" + " with the exact name of your processor to " + "<freebsd-sparc@FreeBSD.org>.\n" + " version register: <0x%lx>\n", vers); + return; + } + + printf("CPU: %s %s Processor (%d.%02d MHZ CPU)\n", manus, impls, + (freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100); + if (bootverbose) { + printf(" mask=0x%x maxtl=%d maxwin=%d\n", VER_MASK(vers), + VER_MAXTL(vers), VER_MAXWIN(vers)); + } +} |