- linux uname -m on x86 returns i{3,4,5,6}86 make it so.
- delete the machine sysctl that never worked, and gc linux_machine.
This commit is contained in:
parent
7ab6f41450
commit
48f401a8e0
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_machdep.c,v 1.124 2007/04/16 19:12:20 ad Exp $ */
|
||||
/* $NetBSD: linux_machdep.c,v 1.125 2007/05/10 21:30:14 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.124 2007/04/16 19:12:20 ad Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.125 2007/05/10 21:30:14 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_vm86.h"
|
||||
|
@ -1183,3 +1183,13 @@ linux_usertrap(struct lwp *l, vaddr_t trapaddr,
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
const char *
|
||||
linux_get_uname_arch(void)
|
||||
{
|
||||
static char uname_arch[5] = "i386";
|
||||
|
||||
if (uname_arch[1] == '3')
|
||||
uname_arch[1] += cpu_class;
|
||||
return uname_arch;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_machdep.h,v 1.29 2005/12/11 12:20:14 christos Exp $ */
|
||||
/* $NetBSD: linux_machdep.h,v 1.30 2007/05/10 21:30:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
|
||||
|
@ -209,9 +209,12 @@ struct linux_sigframe {
|
|||
#define LINUX_IOCTL_MIN_PASS LINUX_VMWARE_NONE
|
||||
#define LINUX_IOCTL_MAX_PASS (LINUX_VMWARE_LAST+8)
|
||||
|
||||
#define LINUX_UNAME_ARCH linux_get_uname_arch()
|
||||
|
||||
#ifdef _KERNEL
|
||||
__BEGIN_DECLS
|
||||
void linux_syscall_intern __P((struct proc *));
|
||||
void linux_syscall_intern(struct proc *);
|
||||
const char *linux_get_uname_arch(void);
|
||||
__END_DECLS
|
||||
#endif /* !_KERNEL */
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_machdep.h,v 1.15 2006/08/23 19:49:09 manu Exp $ */
|
||||
/* $NetBSD: linux_machdep.h,v 1.16 2007/05/10 21:30:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -57,6 +57,10 @@
|
|||
#error Undefined linux_machdep.h machine type.
|
||||
#endif
|
||||
|
||||
#ifndef LINUX_UNAME_ARCH
|
||||
#define LINUX_UNAME_ARCH machine
|
||||
#endif
|
||||
|
||||
#ifdef _KERNEL
|
||||
__BEGIN_DECLS
|
||||
void linux_sendsig __P((const ksiginfo_t *, const sigset_t *));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_misc.c,v 1.174 2007/05/08 20:54:15 dsl Exp $ */
|
||||
/* $NetBSD: linux_misc.c,v 1.175 2007/05/10 21:30:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
|
||||
|
@ -64,7 +64,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.174 2007/05/08 20:54:15 dsl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.175 2007/05/10 21:30:15 christos Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_ptrace.h"
|
||||
|
@ -373,7 +373,7 @@ linux_sys_uname(struct lwp *l, void *v, register_t *retval)
|
|||
strncpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
|
||||
strncpy(luts.l_release, linux_release, sizeof(luts.l_release));
|
||||
strncpy(luts.l_version, linux_version, sizeof(luts.l_version));
|
||||
strncpy(luts.l_machine, linux_machine, sizeof(luts.l_machine));
|
||||
strncpy(luts.l_machine, LINUX_UNAME_ARCH, sizeof(luts.l_machine));
|
||||
strncpy(luts.l_domainname, domainname, sizeof(luts.l_domainname));
|
||||
|
||||
return copyout(&luts, SCARG(uap, up), sizeof(luts));
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_oldolduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $ */
|
||||
/* $NetBSD: linux_oldolduname.c,v 1.63 2007/05/10 21:30:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.63 2007/05/10 21:30:15 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_oldolduname.c,v 1.62 2007/03/23 04:16:13 mrg E
|
|||
#include <compat/linux/common/linux_mmap.h>
|
||||
#include <compat/linux/common/linux_signal.h>
|
||||
#include <compat/linux/common/linux_oldolduname.h>
|
||||
#include <compat/linux/common/linux_machdep.h>
|
||||
|
||||
#include <compat/linux/linux_syscallargs.h>
|
||||
|
||||
|
@ -69,7 +70,7 @@ linux_sys_oldolduname(struct lwp *l, void *v,
|
|||
strncpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
|
||||
strncpy(luts.l_release, linux_release, sizeof(luts.l_release));
|
||||
strncpy(luts.l_version, linux_version, sizeof(luts.l_version));
|
||||
strncpy(luts.l_machine, linux_machine, sizeof(luts.l_machine));
|
||||
strncpy(luts.l_machine, LINUX_UNAME_ARCH, sizeof(luts.l_machine));
|
||||
|
||||
return copyout(&luts, SCARG(uap, up), sizeof(luts));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_olduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $ */
|
||||
/* $NetBSD: linux_olduname.c,v 1.63 2007/05/10 21:30:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.63 2007/05/10 21:30:15 christos Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
|
@ -52,6 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_olduname.c,v 1.62 2007/03/23 04:16:13 mrg Exp
|
|||
#include <compat/linux/common/linux_mmap.h>
|
||||
#include <compat/linux/common/linux_signal.h>
|
||||
#include <compat/linux/common/linux_olduname.h>
|
||||
#include <compat/linux/common/linux_machdep.h>
|
||||
|
||||
#include <compat/linux/linux_syscallargs.h>
|
||||
|
||||
|
@ -71,7 +72,7 @@ linux_sys_olduname(struct lwp *l, void *v, register_t *retval)
|
|||
strncpy(luts.l_nodename, hostname, sizeof(luts.l_nodename));
|
||||
strncpy(luts.l_release, linux_release, sizeof(luts.l_release));
|
||||
strncpy(luts.l_version, linux_version, sizeof(luts.l_version));
|
||||
strncpy(luts.l_machine, linux_machine, sizeof(luts.l_machine));
|
||||
strncpy(luts.l_machine, LINUX_UNAME_ARCH, sizeof(luts.l_machine));
|
||||
|
||||
return copyout(&luts, SCARG(uap, up), sizeof(luts));
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: linux_sysctl.c,v 1.29 2007/05/10 17:12:32 christos Exp $ */
|
||||
/* $NetBSD: linux_sysctl.c,v 1.30 2007/05/10 21:30:15 christos Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2003 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.29 2007/05/10 17:12:32 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: linux_sysctl.c,v 1.30 2007/05/10 21:30:15 christos Exp $");
|
||||
|
||||
#if defined (_KERNEL_OPT)
|
||||
#include "opt_ktrace.h"
|
||||
|
@ -74,7 +74,6 @@ char linux_version[128] = "#0 Wed Feb 20 20:00:02 CET 2002";
|
|||
char linux_release[128] = "2.0.38";
|
||||
char linux_version[128] = "#0 Sun Nov 11 11:11:11 MET 2000";
|
||||
#endif
|
||||
char linux_machine[128] = "";
|
||||
|
||||
#ifndef _LKM
|
||||
static
|
||||
|
@ -116,18 +115,6 @@ SYSCTL_SETUP(linux_sysctl_setup, "linux emulated sysctl subtree setup")
|
|||
NULL, 0, linux_version, sizeof(linux_version),
|
||||
LINUX_KERN_VERSION, CTL_EOL);
|
||||
|
||||
#ifndef LINUX_UNAME_ARCH
|
||||
#define LINUX_UNAME_ARCH machine
|
||||
#endif
|
||||
strlcpy(linux_machine, LINUX_UNAME_ARCH, sizeof(linux_machine));
|
||||
#if 0
|
||||
sysctl_createv(clog, 0, &node, NULL,
|
||||
CTLFLAG_PERMANENT,
|
||||
CTLTYPE_STRING, "machine", NULL,
|
||||
NULL, 0, linux_machine, sizeof(linux_machine),
|
||||
LINUX_KERN_VERSION, CTL_EOL);
|
||||
#endif
|
||||
|
||||
linux_sysctl_root.sysctl_flags &= ~CTLFLAG_READWRITE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue