diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-10-25 08:36:43 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-10-25 08:36:43 +0000 |
commit | 35f9002a2769cc177b5332b709c68b1ec7edb0be (patch) | |
tree | 2acfc564796565ccb12ab1805b5becfa2585cd72 /sys | |
parent | aa426ab49f532c63da9554f1314e8fcef66b3467 (diff) |
do blk<-->chr dev_t conversions through the sysctl
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 10 | ||||
-rw-r--r-- | sys/arch/i386/include/cpu.h | 8 |
2 files changed, 15 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index ed3e5ac2432..0e4d96a57c4 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.58 1997/10/25 06:58:00 niklas Exp $ */ +/* $OpenBSD: machdep.c,v 1.59 1997/10/25 08:36:41 mickey Exp $ */ /* $NetBSD: machdep.c,v 1.202 1996/05/18 15:54:59 christos Exp $ */ /*- @@ -1487,6 +1487,14 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p) return bios_sysctl(name + 1, namelen - 1, oldp, oldlenp, newp, newlen, p); #endif + case CPU_BLK2CHR: + if (namelen != 2) + return (ENOTDIR); /* overloaded */ + return blktochr(name[1]); + case CPU_CHR2BLK: + if (namelen != 2) + return (ENOTDIR); /* overloaded */ + return chrtoblk(name[1]); default: return EOPNOTSUPP; } diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h index 778909acff2..f1b083cb83c 100644 --- a/sys/arch/i386/include/cpu.h +++ b/sys/arch/i386/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.15 1997/09/27 06:31:32 mickey Exp $ */ +/* $OpenBSD: cpu.h,v 1.16 1997/10/25 08:36:42 mickey Exp $ */ /* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */ /*- @@ -208,12 +208,16 @@ void setconf __P((void)); */ #define CPU_CONSDEV 1 /* dev_t: console terminal device */ #define CPU_BIOS 2 /* BIOS variables */ -#define CPU_MAXID 3 /* number of valid machdep ids */ +#define CPU_BLK2CHR 3 /* convert blk maj into chr one */ +#define CPU_CHR2BLK 4 /* convert chr maj into blk one */ +#define CPU_MAXID 5 /* number of valid machdep ids */ #define CTL_MACHDEP_NAMES { \ { 0, 0 }, \ { "console_device", CTLTYPE_STRUCT }, \ { "bios", CTLTYPE_INT }, \ + { "blk2chr", CTLTYPE_INT }, \ + { "chr2blk", CTLTYPE_INT }, \ } #endif /* !_I386_CPU_H_ */ |