diff options
author | tjr <tjr@FreeBSD.org> | 2004-08-16 08:19:18 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-08-16 08:19:18 +0000 |
commit | 33d20b8677e53bca918bc0dfbc1e6716d4ed748f (patch) | |
tree | 840bba9657de112b378203e4856b0d3c1543a85f /sys/compat/linprocfs | |
parent | d38a75138ffc03fd7a1fff4e00a85229549c1492 (diff) | |
download | FreeBSD-src-33d20b8677e53bca918bc0dfbc1e6716d4ed748f.zip FreeBSD-src-33d20b8677e53bca918bc0dfbc1e6716d4ed748f.tar.gz |
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.
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 f20bab5..040c649 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 |