diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2004-08-16 08:19:18 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2004-08-16 08:19:18 +0000 |
commit | 84880f87d0628aaf2a064a315fa9360d8e37b805 (patch) | |
tree | 840bba9657de112b378203e4856b0d3c1543a85f /sys/compat/linprocfs | |
parent | e9abf2d6e2ae45f9d14bc29dd4f1239583c6f602 (diff) | |
download | src-84880f87d0628aaf2a064a315fa9360d8e37b805.tar.gz src-84880f87d0628aaf2a064a315fa9360d8e37b805.zip |
Add support for 32-bit Linux binary emulation on amd64:
- include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h>
if building with the COMPAT_LINUX32 option.
- make minimal changes to the i386 linprocfs_docpuinfo() function to support
amd64. We return a fake CPU family of 6 for now.
Notes
Notes:
svn path=/head/; revision=133822
Diffstat (limited to 'sys/compat/linprocfs')
-rw-r--r-- | sys/compat/linprocfs/linprocfs.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index f20bab56fbc0..040c6491b35a 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -86,12 +86,17 @@ __FBSDID("$FreeBSD$"); extern int ncpus; #endif /* __alpha__ */ -#ifdef __i386__ +#if defined(__i386__) || defined(__amd64__) #include <machine/cputypes.h> #include <machine/md_var.h> -#endif /* __i386__ */ +#endif /* __i386__ || __amd64__ */ +#include "opt_compat.h" +#if !COMPAT_LINUX32 /* XXX */ #include <machine/../linux/linux.h> +#else +#include <machine/../linux32/linux.h> +#endif #include <compat/linux/linux_ioctl.h> #include <compat/linux/linux_mib.h> #include <compat/linux/linux_util.h> @@ -251,9 +256,9 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) } #endif /* __alpha__ */ -#ifdef __i386__ +#if defined(__i386__) || defined(__amd64__) /* - * Filler function for proc/cpuinfo (i386 version) + * Filler function for proc/cpuinfo (i386 & amd64 version) */ static int linprocfs_docpuinfo(PFS_FILL_ARGS) @@ -276,6 +281,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) }; switch (cpu_class) { +#ifdef __i386__ case CPUCLASS_286: class = 2; break; @@ -294,6 +300,11 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) default: class = 0; break; +#else + default: + class = 6; + break; +#endif } for (i = 0; i < mp_ncpus; ++i) { @@ -331,7 +342,7 @@ linprocfs_docpuinfo(PFS_FILL_ARGS) return (0); } -#endif /* __i386__ */ +#endif /* __i386__ || __amd64__ */ /* * Filler function for proc/mtab |