Provide the correct architecture for HW_MACHINE_ARCH so things like

"sysctl -p" can tell they are in 32-bit land.
This commit is contained in:
eeh 2002-06-14 18:28:19 +00:00
parent 923804f36a
commit 863fc84f4d
3 changed files with 36 additions and 4 deletions

View File

@ -69,6 +69,9 @@
#include <machine/vuid_event.h>
#include <machine/netbsd32_machdep.h>
/* Provide a the name of the architecture we're emulating */
char machine_arch32[] = "sparc";
static int ev_out32 __P((struct firm_event *, int, struct uio *));
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_machdep.c,v 1.6 2002/06/12 19:13:28 fvdl Exp $ */
/* $NetBSD: netbsd32_machdep.c,v 1.7 2002/06/14 18:28:20 eeh Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -59,6 +59,9 @@
#include <compat/netbsd32/netbsd32.h>
#include <compat/netbsd32/netbsd32_syscallargs.h>
/* Provide a the name of the architecture we're emulating */
char machine_arch32[] = "i386";
int process_read_fpregs32(struct proc *, struct fpreg32 *);
int process_read_regs32(struct proc *, struct reg32 *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_sysctl.c,v 1.5 2002/02/14 07:08:20 chs Exp $ */
/* $NetBSD: netbsd32_sysctl.c,v 1.6 2002/06/14 18:28:19 eeh Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.5 2002/02/14 07:08:20 chs Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.6 2002/06/14 18:28:19 eeh Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_sysctl.c,v 1.5 2002/02/14 07:08:20 chs Exp
int uvm_sysctl32(int *, u_int, void *, size_t *, void *, size_t, struct proc *);
int kern_sysctl32(int *, u_int, void *, size_t *, void *, size_t, struct proc *);
int hw_sysctl32(int *, u_int, void *, size_t *, void *, size_t, struct proc *);
/*
* uvm_sysctl32: sysctl hook into UVM system, handling special 32-bit
@ -139,6 +140,24 @@ kern_sysctl32(name, namelen, oldp, oldlenp, newp, newlen, p)
/* NOTREACHED */
}
/*
* hardware related system variables.
*/
int
hw_sysctl32(int *name, u_int namelen, void *oldp, size_t *oldlenp,
void *newp, size_t newlen, struct proc *p)
{
extern char machine_arch32[];
switch (name[0]) {
case HW_MACHINE_ARCH:
return (sysctl_rdstring(oldp, oldlenp, newp, machine_arch32));
default:
return (EOPNOTSUPP);
}
/* NOTREACHED */
}
int
netbsd32___sysctl(p, v, retval)
struct proc *p;
@ -195,7 +214,14 @@ netbsd32___sysctl(p, v, retval)
}
break;
case CTL_HW:
fn = hw_sysctl;
switch (name[1]) {
case HW_MACHINE_ARCH:
fn = hw_sysctl32;
break;
default:
fn = hw_sysctl;
break;
}
break;
case CTL_VM:
switch (name[1]) {