summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_misc.c32
-rw-r--r--sys/compat/linux/linux_misc.h15
2 files changed, 16 insertions, 31 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index bdbb5dd..82bd7b9 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -92,10 +92,6 @@ __FBSDID("$FreeBSD$");
#include <compat/linux/linux_emul.h>
#include <compat/linux/linux_misc.h>
-#ifdef __i386__
-#include <machine/cputypes.h>
-#endif
-
#define BSD_TO_LINUX_SIGNAL(sig) \
(((sig) <= LINUX_SIGTBLSZ) ? bsd_to_linux_signal[_SIG_IDX(sig)] : sig)
@@ -731,34 +727,8 @@ linux_newuname(struct thread *td, struct linux_newuname_args *args)
*p = '\0';
break;
}
-#ifdef __i386__
- {
- const char *class;
+ strlcpy(utsname.machine, linux_platform, LINUX_MAX_UTSNAME);
- switch (cpu_class) {
- case CPUCLASS_686:
- class = "i686";
- break;
- case CPUCLASS_586:
- class = "i586";
- break;
- case CPUCLASS_486:
- class = "i486";
- break;
- default:
- class = "i386";
- }
- strlcpy(utsname.machine, class, LINUX_MAX_UTSNAME);
- }
-#elif defined(__amd64__) /* XXX: Linux can change 'personality'. */
-#ifdef COMPAT_LINUX32
- strlcpy(utsname.machine, "i686", LINUX_MAX_UTSNAME);
-#else
- strlcpy(utsname.machine, "x86_64", LINUX_MAX_UTSNAME);
-#endif /* COMPAT_LINUX32 */
-#else /* something other than i386 or amd64 - assume we and Linux agree */
- strlcpy(utsname.machine, machine, LINUX_MAX_UTSNAME);
-#endif /* __i386__ */
mtx_lock(&hostname_mtx);
strlcpy(utsname.domainname, V_domainname, LINUX_MAX_UTSNAME);
mtx_unlock(&hostname_mtx);
diff --git a/sys/compat/linux/linux_misc.h b/sys/compat/linux/linux_misc.h
index c80a432..37991f3 100644
--- a/sys/compat/linux/linux_misc.h
+++ b/sys/compat/linux/linux_misc.h
@@ -45,4 +45,19 @@
#define LINUX_MREMAP_MAYMOVE 1
#define LINUX_MREMAP_FIXED 2
+extern const char *linux_platform;
+
+/*
+ * Non-standard aux entry types used in Linux ELF binaries.
+ */
+
+#define LINUX_AT_PLATFORM 15 /* String identifying CPU */
+#define LINUX_AT_HWCAP 16 /* CPU capabilities */
+#define LINUX_AT_CLKTCK 17 /* frequency at which times() increments */
+#define LINUX_AT_SECURE 23 /* secure mode boolean */
+#define LINUX_AT_BASE_PLATFORM 24 /* string identifying real platform, may
+ * differ from AT_PLATFORM.
+ */
+#define LINUX_AT_EXECFN 31 /* filename of program */
+
#endif /* _LINUX_MISC_H_ */
OpenPOWER on IntegriCloud