diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-14 23:15:51 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-07-14 23:15:51 +0000 |
commit | 15c79903aa9d47dfaeb292a5b97ec11393b6a16a (patch) | |
tree | dafbbc053298506963d9521e423ca0710f03627f | |
parent | abf14e9a2ac34d22bbb82ce5364875f0d48419ad (diff) |
put sub-class of architecture in SVR4_SI_PLATFORM
-rw-r--r-- | sys/arch/sparc/sparc/cpu.c | 18 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stat.c | 17 |
2 files changed, 29 insertions, 6 deletions
diff --git a/sys/arch/sparc/sparc/cpu.c b/sys/arch/sparc/sparc/cpu.c index ae45a93ded0..1e378842d1e 100644 --- a/sys/arch/sparc/sparc/cpu.c +++ b/sys/arch/sparc/sparc/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.17 1999/03/03 21:58:28 jason Exp $ */ +/* $OpenBSD: cpu.c,v 1.18 1999/07/14 23:15:49 deraadt Exp $ */ /* $NetBSD: cpu.c,v 1.56 1997/09/15 20:52:36 pk Exp $ */ /* @@ -75,6 +75,7 @@ /* The following are used externally (sysctl_hw). */ char machine[] = MACHINE; /* from <machine/param.h> */ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ +char *cpu_class = "sun4"; char cpu_model[130]; char cpu_hotfix[40]; extern char mainbus_model[]; /* from autoconf.c */ @@ -193,6 +194,21 @@ cpu_attach(parent, self, aux) bcopy(&cpuinfo, sc, sizeof(cpuinfo)); } +#if defined(SUN4C) || defined(SUN4M) + switch (cputyp) { +#if defined(SUN4C) + case CPU_SUN4C: + cpu_class = "sun4c"; + break; +#endif /* defined(SUN4C) */ +#if defined(SUN4M) + case CPU_SUN4M: + cpu_class = "sun4m"; + break; +#endif /* defined(SUN4M) */ + } +#endif /* defined(SUN4C) || defined(SUN4M) */ + getcpuinfo(sc, node); fpuname = "no"; diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 9f2386702f4..de785ab4520 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_stat.c,v 1.14 1999/07/02 19:16:32 deraadt Exp $ */ +/* $OpenBSD: svr4_stat.c,v 1.15 1999/07/14 23:15:50 deraadt Exp $ */ /* $NetBSD: svr4_stat.c,v 1.21 1996/04/22 01:16:07 christos Exp $ */ /* @@ -403,13 +403,13 @@ svr4_sys_uname(p, v, retval) bzero(&sut, sizeof(sut)); - strncpy(sut.sysname, ostype, sizeof(sut.sysname)); + strncpy(sut.sysname, ostype, sizeof(sut.sysname)-1); sut.sysname[sizeof(sut.sysname) - 1] = '\0'; - strncpy(sut.nodename, hostname, sizeof(sut.nodename)); + strncpy(sut.nodename, hostname, sizeof(sut.nodename)-1); sut.nodename[sizeof(sut.nodename) - 1] = '\0'; - strncpy(sut.release, osrelease, sizeof(sut.release)); + strncpy(sut.release, osrelease, sizeof(sut.release)-1); sut.release[sizeof(sut.release) - 1] = '\0'; dp = sut.version; @@ -424,7 +424,7 @@ svr4_sys_uname(p, v, retval) *dp++ = *cp; *dp = '\0'; - strncpy(sut.machine, machine, sizeof(sut.machine)); + strncpy(sut.machine, machine, sizeof(sut.machine)-1); sut.machine[sizeof(sut.machine) - 1] = '\0'; return copyout((caddr_t) &sut, (caddr_t) SCARG(uap, name), @@ -444,6 +444,9 @@ svr4_sys_systeminfo(p, v, retval) long len; extern char ostype[], hostname[], osrelease[], version[], machine[], domainname[]; +#ifdef __sparc__ + extern char cpu_class[]; +#endif u_int rlen = SCARG(uap, len); @@ -485,7 +488,11 @@ svr4_sys_systeminfo(p, v, retval) break; case SVR4_SI_PLATFORM: +#ifdef __sparc__ + str = cpu_class; +#else str = machine; +#endif break; case SVR4_SI_KERB_REALM: |