Added a sysctl arg, hw.machine_arch. The hw.machine_arch is "ibm-pc"

on IBM-PC box and is "pc-98" on NEC PC-98 box.  Userland program can
distinguish architecture on which the program runs.
This commit is contained in:
KATO Takenori 1997-08-29 09:03:40 +00:00
parent 4c7bdfd64b
commit 664f85174a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28885
3 changed files with 19 additions and 4 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)param.h 5.8 (Berkeley) 6/28/91
* $Id: param.h,v 1.14 1997/08/23 05:14:23 smp Exp $
* $Id: param.h,v 1.37 1997/08/24 00:04:59 fsmp Exp $
*/
#ifndef _MACHINE_PARAM_H_
@ -52,6 +52,16 @@
#endif
#define MID_MACHINE MID_I386
/*
* Architecture dependent constants for i386 based machines.
*/
#ifdef PC98
/* NEC PC-9801/9821 series and compatibles. */
#define MACHINE_ARCH "pc-98"
#else
/* IBM-PC compatibles. */
#define MACHINE_ARCH "ibm-pc"
#endif
#ifndef LOCORE

View File

@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
* $Id: kern_mib.c,v 1.8 1997/03/04 18:31:54 bde Exp $
* $Id: kern_mib.c,v 1.9 1997/06/25 07:31:47 joerg Exp $
*/
#include <sys/param.h>
@ -107,6 +107,10 @@ SYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD, 0, BYTE_ORDER, "");
SYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD, 0, PAGE_SIZE, "");
static char machine_arch[] = MACHINE_ARCH;
SYSCTL_STRING(_hw, HW_MACHINE_ARCH, machine_arch, CTLFLAG_RD,
machine_arch, 0, "");
char hostname[MAXHOSTNAMELEN];
SYSCTL_STRING(_kern, KERN_HOSTNAME, hostname, CTLFLAG_RW,

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)sysctl.h 8.1 (Berkeley) 6/2/93
* $Id: sysctl.h,v 1.53 1997/07/12 11:04:25 peter Exp $
* $Id: sysctl.h,v 1.54 1997/07/12 11:12:41 peter Exp $
*/
#ifndef _SYS_SYSCTL_H_
@ -312,7 +312,8 @@ int sysctl_handle_opaque SYSCTL_HANDLER_ARGS;
#define HW_DISKNAMES 8 /* strings: disk drive names */
#define HW_DISKSTATS 9 /* struct: diskstats[] */
#define HW_FLOATINGPT 10 /* int: has HW floating point? */
#define HW_MAXID 11 /* number of valid hw ids */
#define HW_MACHINE_ARCH 11 /* string: machine architecture */
#define HW_MAXID 12 /* number of valid hw ids */
#define CTL_HW_NAMES { \
{ 0, 0 }, \