diff options
author | jmallett <jmallett@FreeBSD.org> | 2012-03-03 08:19:18 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2012-03-03 08:19:18 +0000 |
commit | 50c253779ff59b0d64f2cfbb7efedabe19a620d8 (patch) | |
tree | 84d0a513be42586ec703acf6b5a531bc9d48d09c /sys/net | |
parent | 402a0f9de41a1a087445529e59d3183a11d266b9 (diff) | |
download | FreeBSD-src-50c253779ff59b0d64f2cfbb7efedabe19a620d8.zip FreeBSD-src-50c253779ff59b0d64f2cfbb7efedabe19a620d8.tar.gz |
o) Add COMPAT_FREEBSD32 support for MIPS kernels using the n64 ABI with userlands
using the o32 ABI. This mostly follows nwhitehorn's lead in implementing
COMPAT_FREEBSD32 on powerpc64.
o) Add a new type to the freebsd32 compat layer, time32_t, which is time_t in the
32-bit ABI being used. Since the MIPS port is relatively-new, even the 32-bit
ABIs use a 64-bit time_t.
o) Because time{spec,val}32 has the same size and layout as time{spec,val} on MIPS
with 32-bit compatibility, then, disable some code which assumes otherwise
wrongly when built for MIPS. A more general macro to check in this case would
seem like a good idea eventually. If someone adds support for using n32
userland with n64 kernels on MIPS, then they will have to add a variety of
flags related to each piece of the ABI that can vary. That's probably the
right time to generalize further.
o) Add MIPS to the list of architectures which use PAD64_REQUIRED in the
freebsd32 compat code. Probably this should be generalized at some point.
Reviewed by: gonzo
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/bpf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/net/bpf.c b/sys/net/bpf.c index 80f5636..4f163d9 100644 --- a/sys/net/bpf.c +++ b/sys/net/bpf.c @@ -1055,7 +1055,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, #endif case BIOCGETIF: case BIOCGRTIMEOUT: -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) case BIOCGRTIMEOUT32: #endif case BIOCGSTATS: @@ -1067,7 +1067,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, case FIONREAD: case BIOCLOCK: case BIOCSRTIMEOUT: -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) case BIOCSRTIMEOUT32: #endif case BIOCIMMEDIATE: @@ -1262,12 +1262,12 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, * Set read timeout. */ case BIOCSRTIMEOUT: -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) case BIOCSRTIMEOUT32: #endif { struct timeval *tv = (struct timeval *)addr; -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) struct timeval32 *tv32; struct timeval tv64; @@ -1293,12 +1293,12 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, * Get read timeout. */ case BIOCGRTIMEOUT: -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) case BIOCGRTIMEOUT32: #endif { struct timeval *tv; -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) struct timeval32 *tv32; struct timeval tv64; @@ -1310,7 +1310,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, tv->tv_sec = d->bd_rtout / hz; tv->tv_usec = (d->bd_rtout % hz) * tick; -#ifdef COMPAT_FREEBSD32 +#if defined(COMPAT_FREEBSD32) && !defined(__mips__) if (cmd == BIOCGRTIMEOUT32) { tv32 = (struct timeval32 *)addr; tv32->tv_sec = tv->tv_sec; |