diff options
author | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-08-10 01:11:14 +0000 |
---|---|---|
committer | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-08-10 01:11:14 +0000 |
commit | 2114c2491d8e7bc094468ea15b39f3bcb048a2b2 (patch) | |
tree | 1ac31383b908c60792e47f27923620d542f65680 | |
parent | ea230a7cb579b7f071715f28305465a1c925726f (diff) |
Hookup hw.vendor and hw.product sysctls on sparc64.
ok dlg@, "looks good" miod@
-rw-r--r-- | sys/arch/sparc64/sparc64/autoconf.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/sys/arch/sparc64/sparc64/autoconf.c b/sys/arch/sparc64/sparc64/autoconf.c index 65cc3f8e0c2..e17d64053b6 100644 --- a/sys/arch/sparc64/sparc64/autoconf.c +++ b/sys/arch/sparc64/sparc64/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.56 2006/06/01 01:17:25 jason Exp $ */ +/* $OpenBSD: autoconf.c,v 1.57 2006/08/10 01:11:13 gwk Exp $ */ /* $NetBSD: autoconf.c,v 1.51 2001/07/24 19:32:11 eeh Exp $ */ /* @@ -104,6 +104,9 @@ extern int kgdb_debug_panic; static int rootnode; char platform_type[64]; +/* for hw.product/vendor see sys/kern/kern_sysctl.c */ +extern char *hw_prod, *hw_vendor; + static char *str2hex(char *, long *); static int mbprint(void *, const char *); void sync_crash(void); @@ -996,9 +999,9 @@ extern struct sparc_bus_dma_tag mainbus_dma_tag; extern bus_space_tag_t mainbus_space_tag; struct mainbus_attach_args ma; - char buf[32]; + char buf[32], *p; const char *const *ssp, *sp = NULL; - int node0, node, rv; + int node0, node, rv, len; static const char *const openboot_special[] = { /* ignore these (end with NULL) */ @@ -1016,12 +1019,20 @@ extern bus_space_tag_t mainbus_space_tag; NULL }; - if (OF_getprop(findroot(), "banner-name", platform_type, - sizeof(platform_type)) <= 0) + if ((len = OF_getprop(findroot(), "banner-name", platform_type, + sizeof(platform_type))) <= 0) OF_getprop(findroot(), "name", platform_type, sizeof(platform_type)); printf(": %s\n", platform_type); - + if (len > 0) { + hw_vendor = platform_type; + if ((p = memchr(hw_vendor, ' ', len)) != NULL) { + *p = '\0'; + hw_prod = ++p; + if ((p = memchr(p, '(', len - (p - hw_vendor))) != NULL) + *p = '\0'; + } + } /* * Locate and configure the ``early'' devices. These must be |