summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-10-25 21:47:28 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-10-25 21:47:28 +0000
commitc38684c1d48044e950b278da4306d241699a0a87 (patch)
tree1ac8a531f542b8686dd8791fa33e0614a53e69b0
parent921cf2920873366958a9fa18ca57c084d0675338 (diff)
fix blk2chr,chr2blk
-rw-r--r--sys/arch/i386/i386/machdep.c17
-rw-r--r--sys/arch/i386/include/cpu.h6
2 files changed, 12 insertions, 11 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 90c94d52b49..b231462cfa3 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.60 1997/10/25 20:30:45 niklas Exp $ */
+/* $OpenBSD: machdep.c,v 1.61 1997/10/25 21:47:26 mickey Exp $ */
/* $NetBSD: machdep.c,v 1.202 1996/05/18 15:54:59 christos Exp $ */
/*-
@@ -1469,7 +1469,7 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
size_t newlen;
struct proc *p;
{
- dev_t consdev;
+ dev_t dev;
switch (name[0]) {
case CPU_CONSDEV:
@@ -1477,11 +1477,10 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return (ENOTDIR); /* overloaded */
if (cn_tab != NULL)
- consdev = cn_tab->cn_dev;
+ dev = cn_tab->cn_dev;
else
- consdev = NODEV;
- return sysctl_rdstruct(oldp, oldlenp, newp,
- &consdev, sizeof consdev);
+ dev = NODEV;
+ return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
#if NBIOS > 0
case CPU_BIOS:
return bios_sysctl(name + 1, namelen - 1, oldp, oldlenp,
@@ -1490,11 +1489,13 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
case CPU_BLK2CHR:
if (namelen != 2)
return (ENOTDIR); /* overloaded */
- return blktochr(name[1]);
+ dev = blktochr((dev_t)name[1]);
+ return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
case CPU_CHR2BLK:
if (namelen != 2)
return (ENOTDIR); /* overloaded */
- return chrtoblk(name[1]);
+ dev = blktochr((dev_t)name[1]);
+ return sysctl_rdstruct(oldp, oldlenp, newp, &dev, sizeof(dev));
default:
return EOPNOTSUPP;
}
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index f1b083cb83c..ed1b2880f76 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.16 1997/10/25 08:36:42 mickey Exp $ */
+/* $OpenBSD: cpu.h,v 1.17 1997/10/25 21:47:27 mickey Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -216,8 +216,8 @@ void setconf __P((void));
{ 0, 0 }, \
{ "console_device", CTLTYPE_STRUCT }, \
{ "bios", CTLTYPE_INT }, \
- { "blk2chr", CTLTYPE_INT }, \
- { "chr2blk", CTLTYPE_INT }, \
+ { "blk2chr", CTLTYPE_STRUCT }, \
+ { "chr2blk", CTLTYPE_STRUCT }, \
}
#endif /* !_I386_CPU_H_ */