summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorGordon Willem Klok <gwk@cvs.openbsd.org>2006-07-11 06:33:49 +0000
committerGordon Willem Klok <gwk@cvs.openbsd.org>2006-07-11 06:33:49 +0000
commita34ce906a523c69327f6514f1833afa8b6b7a3ed (patch)
treebcbb9924e4e653085578ac28a7ccc5c5ab13c657 /sys/arch
parent1e1befc58137f85ae8afd495bb0803d98bdde9ce (diff)
Hook up the hw.product sysctl on macppc,
requested by deraadt@, ok drahn@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/macppc/macppc/mainbus.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/arch/macppc/macppc/mainbus.c b/sys/arch/macppc/macppc/mainbus.c
index 577b7d6869e..4591691228b 100644
--- a/sys/arch/macppc/macppc/mainbus.c
+++ b/sys/arch/macppc/macppc/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.14 2005/10/31 06:14:53 drahn Exp $ */
+/* $OpenBSD: mainbus.c,v 1.15 2006/07/11 06:33:48 gwk Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@@ -30,6 +30,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
+#include <sys/malloc.h>
#include <sys/reboot.h>
#include <machine/autoconf.h>
@@ -52,6 +53,9 @@ struct cfdriver mainbus_cd = {
NULL, "mainbus", DV_DULL
};
+/* hw.product sysctl see sys/kern/kern_sysctl.c */
+extern char *hw_prod;
+
void mb_intr_establish(struct confargs *, int (*)(void *), void *);
void mb_intr_disestablish(struct confargs *);
caddr_t mb_cvtaddr(struct confargs *);
@@ -81,6 +85,9 @@ mbattach(struct device *parent, struct device *self, void *aux)
if (len > 1) {
name[len] = '\0';
printf(": model %s", name);
+ len = strlen(name)+1;
+ if ((hw_prod = malloc(len, M_DEVBUF, M_NOWAIT)) != NULL)
+ strlcpy(hw_prod, name, len);
}
printf("\n");