diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-26 20:25:52 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-06-26 20:25:52 +0000 |
commit | 6e8e19c3ec5c652ee22bb615672cceb868d6ebe5 (patch) | |
tree | ffd29ca20e827e0bf3430ec5c65fdfcadf997e87 /sys/arch/alpha/pci/pci_machdep.c | |
parent | a7926156e17b493f9d7b9ac07f4d7fe8d7a003ef (diff) |
Provide some chipset information to usreland through sysctl.
The chipset support is not here yet, but the skeleton works.
Diffstat (limited to 'sys/arch/alpha/pci/pci_machdep.c')
-rw-r--r-- | sys/arch/alpha/pci/pci_machdep.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/sys/arch/alpha/pci/pci_machdep.c b/sys/arch/alpha/pci/pci_machdep.c index cffb296b604..c1aa3144c65 100644 --- a/sys/arch/alpha/pci/pci_machdep.c +++ b/sys/arch/alpha/pci/pci_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_machdep.c,v 1.10 2000/07/03 19:30:21 mickey Exp $ */ +/* $OpenBSD: pci_machdep.c,v 1.11 2001/06/26 20:25:51 art Exp $ */ /* $NetBSD: pci_machdep.c,v 1.7 1996/11/19 04:57:32 cgd Exp $ */ /* @@ -39,6 +39,8 @@ #include <sys/errno.h> #include <sys/device.h> #include <vm/vm.h> +#include <machine/cpu.h> +#include <sys/sysctl.h> #include <dev/isa/isavar.h> #include <dev/pci/pcireg.h> @@ -55,6 +57,8 @@ #include <dev/pci/tgavar.h> #endif +struct alpha_pci_chipset *alpha_pci_chipset; + void pci_display_console(iot, memt, pc, bus, device, function) bus_space_tag_t iot, memt; @@ -101,3 +105,28 @@ pci_display_console(iot, memt, pc, bus, device, function) panic("pci_display_console: unconfigured device at %d/%d/%d", bus, device, function); } + +int +alpha_sysctl_chipset(int *name, u_int namelen, char *where, size_t *sizep) +{ + if (namelen != 1) + return (ENOTDIR); + + if (alpha_pci_chipset == NULL) + return (EOPNOTSUPP); + + switch (name[0]) { + case CPU_CHIPSET_TYPE: + return (sysctl_rdstring(where, sizep, NULL, + alpha_pci_chipset->pc_name)); + case CPU_CHIPSET_BWX: + return (sysctl_rdint(where, sizep, NULL, + alpha_pci_chipset->pc_bwx)); + case CPU_CHIPSET_MEM: + return (sysctl_rdquad(where, sizep, NULL, + alpha_pci_chipset->pc_bwx)); + default: + return (EOPNOTSUPP); + } + /* NOTREACHED */ +} |