summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-07-16 10:33:38 +0000
committerphk <phk@FreeBSD.org>1995-07-16 10:33:38 +0000
commit161d38ad3142ecedb3aa0b9296765bb56fe05c66 (patch)
tree90ee773d7a3f5705ae92761b9f28744abe782d81 /sys
parent8173e866568eb594570ebbe3a0e81d24fdafa6e3 (diff)
downloadFreeBSD-src-161d38ad3142ecedb3aa0b9296765bb56fe05c66.zip
FreeBSD-src-161d38ad3142ecedb3aa0b9296765bb56fe05c66.tar.gz
Make the bootinfo structure visible from sysctl.
This can be used in libdisk to guess a better bios-geometry.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/machdep.c5
-rw-r--r--sys/amd64/include/cpu.h6
-rw-r--r--sys/i386/i386/machdep.c5
-rw-r--r--sys/i386/include/cpu.h6
4 files changed, 16 insertions, 6 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 37fe7fb..a31b7ee 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.130 1995/06/28 04:46:11 davidg Exp $
+ * $Id: machdep.c,v 1.131 1995/07/13 08:47:24 davidg Exp $
*/
#include "npx.h"
@@ -1014,6 +1014,9 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return error;
case CPU_DISRTCSET:
return (sysctl_int(oldp, oldlenp, newp, newlen, &disable_rtc_set));
+ case CPU_BOOTINFO:
+ return (sysctl_rdstruct(oldp, oldlenp, newp, &bootinfo,
+ sizeof bootinfo));
default:
return (EOPNOTSUPP);
}
diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h
index 58a5ab6..ed33a5a 100644
--- a/sys/amd64/include/cpu.h
+++ b/sys/amd64/include/cpu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
- * $Id: cpu.h,v 1.19 1994/12/03 10:18:24 bde Exp $
+ * $Id: cpu.h,v 1.20 1995/05/04 07:50:06 davidg Exp $
*/
#ifndef _MACHINE_CPU_H_
@@ -114,13 +114,15 @@ struct cpu_nameclass {
#define CPU_CONSDEV 1 /* dev_t: console terminal device */
#define CPU_ADJKERNTZ 2 /* int: timezone offset for resettodr() */
#define CPU_DISRTCSET 3 /* int: disable resettodr() call */
-#define CPU_MAXID 4 /* number of valid machdep ids */
+#define CPU_BOOTINFO 4 /* struct: bootinfo */
+#define CPU_MAXID 5 /* number of valid machdep ids */
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \
{ "console_device", CTLTYPE_STRUCT }, \
{ "adjkerntz", CTLTYPE_INT }, \
{ "disable_rtc_set", CTLTYPE_INT }, \
+ { "bootinfo", CTLTYPE_STRUCT }, \
}
#ifdef KERNEL
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 37fe7fb..a31b7ee 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
- * $Id: machdep.c,v 1.130 1995/06/28 04:46:11 davidg Exp $
+ * $Id: machdep.c,v 1.131 1995/07/13 08:47:24 davidg Exp $
*/
#include "npx.h"
@@ -1014,6 +1014,9 @@ cpu_sysctl(name, namelen, oldp, oldlenp, newp, newlen, p)
return error;
case CPU_DISRTCSET:
return (sysctl_int(oldp, oldlenp, newp, newlen, &disable_rtc_set));
+ case CPU_BOOTINFO:
+ return (sysctl_rdstruct(oldp, oldlenp, newp, &bootinfo,
+ sizeof bootinfo));
default:
return (EOPNOTSUPP);
}
diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h
index 58a5ab6..ed33a5a 100644
--- a/sys/i386/include/cpu.h
+++ b/sys/i386/include/cpu.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)cpu.h 5.4 (Berkeley) 5/9/91
- * $Id: cpu.h,v 1.19 1994/12/03 10:18:24 bde Exp $
+ * $Id: cpu.h,v 1.20 1995/05/04 07:50:06 davidg Exp $
*/
#ifndef _MACHINE_CPU_H_
@@ -114,13 +114,15 @@ struct cpu_nameclass {
#define CPU_CONSDEV 1 /* dev_t: console terminal device */
#define CPU_ADJKERNTZ 2 /* int: timezone offset for resettodr() */
#define CPU_DISRTCSET 3 /* int: disable resettodr() call */
-#define CPU_MAXID 4 /* number of valid machdep ids */
+#define CPU_BOOTINFO 4 /* struct: bootinfo */
+#define CPU_MAXID 5 /* number of valid machdep ids */
#define CTL_MACHDEP_NAMES { \
{ 0, 0 }, \
{ "console_device", CTLTYPE_STRUCT }, \
{ "adjkerntz", CTLTYPE_INT }, \
{ "disable_rtc_set", CTLTYPE_INT }, \
+ { "bootinfo", CTLTYPE_STRUCT }, \
}
#ifdef KERNEL
OpenPOWER on IntegriCloud