Make COMPAT_NETBSD32 emulate hw.machine. While it might seem wrong to do

so, it introduces breakage because a lot of applications make assumptions
from its value.  It's especially bad in the sparc64 case, where 64-bits
instructions can be used in 32-bits addressing mode.  However, there are
other means to know the capabilities of the CPU.
This commit is contained in:
cube 2005-07-03 16:53:46 +00:00
parent e2ba6dc38f
commit 6f082c10a9
4 changed files with 17 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.15 2005/06/10 05:10:12 matt Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.16 2005/07/03 16:53:46 cube Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15 2005/06/10 05:10:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.16 2005/07/03 16:53:46 cube Exp $");
#include "opt_compat_netbsd.h"
#include "opt_execfmt.h"
@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.15 2005/06/10 05:10:12 matt E
#include <compat/netbsd32/netbsd32_syscallargs.h>
/* Provide a the name of the architecture we're emulating */
char machine32[] = "i386";
char machine_arch32[] = "i386";
int process_read_fpregs32(struct lwp *, struct fpreg32 *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.8 2005/06/16 05:38:43 he Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.9 2005/07/03 16:53:46 cube Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.8 2005/06/16 05:38:43 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.9 2005/07/03 16:53:46 cube Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -77,6 +77,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.8 2005/06/16 05:38:43 he Exp
#include <sh5/fpu.h>
char machine32[] = "sh5";
char machine_arch32[] = "sh5";
#ifdef COMPAT_16

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.47 2005/06/10 05:10:12 matt Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.48 2005/07/03 16:53:46 cube Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.47 2005/06/10 05:10:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.48 2005/07/03 16:53:46 cube Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@ -78,6 +78,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.47 2005/06/10 05:10:12 matt E
#include <machine/netbsd32_machdep.h>
/* Provide a the name of the architecture we're emulating */
char machine32[] = "sparc";
char machine_arch32[] = "sparc";
#if NFIRM_EVENTS > 0

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_sysctl.c,v 1.17 2005/06/22 03:13:34 atatat Exp $ */
/* $NetBSD: netbsd32_sysctl.c,v 1.18 2005/07/03 16:53:46 cube Exp $ */
/*
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.17 2005/06/22 03:13:34 atatat Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.18 2005/07/03 16:53:46 cube Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@ -105,6 +105,7 @@ SYSCTL_SETUP(netbsd32_sysctl_emul_setup, "sysctl netbsd32 shadow tree setup")
{
const struct sysctlnode *_root = &netbsd32_sysctl_root;
extern char machine_arch32[];
extern char machine32[];
sysctl_createv(clog, 0, &_root, NULL,
CTLFLAG_PERMANENT,
@ -135,6 +136,11 @@ SYSCTL_SETUP(netbsd32_sysctl_emul_setup, "sysctl netbsd32 shadow tree setup")
CTLTYPE_NODE, "hw", NULL,
NULL, 0, NULL, 0,
CTL_HW, CTL_EOL);
sysctl_createv(clog, 0, &_root, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRING, "machine", NULL,
NULL, 0, machine32, 0,
CTL_HW, HW_MACHINE, CTL_EOL);
sysctl_createv(clog, 0, &_root, NULL,
CTLFLAG_PERMANENT,
CTLTYPE_STRING, "machine_arch", NULL,