From owner-svn-src-head@freebsd.org Tue Jun 27 01:29:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D92D6D97A09; Tue, 27 Jun 2017 01:29:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B473972D13; Tue, 27 Jun 2017 01:29:11 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5R1TADV019605; Tue, 27 Jun 2017 01:29:10 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5R1TAuG019602; Tue, 27 Jun 2017 01:29:10 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201706270129.v5R1TAuG019602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 27 Jun 2017 01:29:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r320391 - in head/sys: compat/freebsd32 net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2017 01:29:11 -0000 Author: jhibbits Date: Tue Jun 27 01:29:10 2017 New Revision: 320391 URL: https://svnweb.freebsd.org/changeset/base/320391 Log: Update comments and simplify conditionals for compat32 Only amd64 (because of i386) needs 32-bit time_t compat now, everything else is 64-bit time_t. Rather than checking on all 64-bit time_t archs, only check the oddball amd64/i386. Reviewed By: emaste, kib, andrew Differential Revision: https://reviews.freebsd.org/D11364 Modified: head/sys/compat/freebsd32/freebsd32.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/net/bpf.c Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Tue Jun 27 01:22:27 2017 (r320390) +++ head/sys/compat/freebsd32/freebsd32.h Tue Jun 27 01:29:10 2017 (r320391) @@ -43,12 +43,12 @@ do { (dst).fld = PTROUT((src).fld); } while (0) /* - * Being a newer port, 32-bit FreeBSD/MIPS uses 64-bit time_t. + * i386 is the only arch with a 32-bit time_t */ -#if defined (__mips__) || defined(__powerpc__) -typedef int64_t time32_t; -#else +#ifdef __amd64__ typedef int32_t time32_t; +#else +typedef int64_t time32_t; #endif struct timeval32 { Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Jun 27 01:22:27 2017 (r320390) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Jun 27 01:29:10 2017 (r320391) @@ -109,13 +109,13 @@ __FBSDID("$FreeBSD$"); FEATURE(compat_freebsd_32bit, "Compatible with 32-bit FreeBSD"); -#if !defined(__mips__) && !defined(__powerpc__) +#ifdef __amd64__ CTASSERT(sizeof(struct timeval32) == 8); CTASSERT(sizeof(struct timespec32) == 8); CTASSERT(sizeof(struct itimerval32) == 16); #endif CTASSERT(sizeof(struct statfs32) == 256); -#if !defined(__mips__) && !defined(__powerpc__) +#ifdef __amd64__ CTASSERT(sizeof(struct rusage32) == 72); #endif CTASSERT(sizeof(struct sigaltstack32) == 12); @@ -124,8 +124,6 @@ CTASSERT(sizeof(struct iovec32) == 8); CTASSERT(sizeof(struct msghdr32) == 28); #ifdef __amd64__ CTASSERT(sizeof(struct stat32) == 208); -#endif -#if !defined(__mips__) && !defined(__powerpc__) CTASSERT(sizeof(struct freebsd11_stat32) == 96); #endif CTASSERT(sizeof(struct sigaction32) == 24); Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Jun 27 01:22:27 2017 (r320390) +++ head/sys/net/bpf.c Tue Jun 27 01:29:10 2017 (r320391) @@ -1283,7 +1283,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i #endif case BIOCGETIF: case BIOCGRTIMEOUT: -#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__) +#if defined(COMPAT_FREEBSD32) && defined(__amd64__) case BIOCGRTIMEOUT32: #endif case BIOCGSTATS: @@ -1295,7 +1295,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i case FIONREAD: case BIOCLOCK: case BIOCSRTIMEOUT: -#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__) +#if defined(COMPAT_FREEBSD32) && defined(__amd64__) case BIOCSRTIMEOUT32: #endif case BIOCIMMEDIATE: @@ -1519,7 +1519,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i * Set read timeout. */ case BIOCSRTIMEOUT: -#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__) +#if defined(COMPAT_FREEBSD32) && defined(__amd64__) case BIOCSRTIMEOUT32: #endif { @@ -1550,12 +1550,12 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i * Get read timeout. */ case BIOCGRTIMEOUT: -#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__) +#if defined(COMPAT_FREEBSD32) && defined(__amd64__) case BIOCGRTIMEOUT32: #endif { struct timeval *tv; -#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__) +#if defined(COMPAT_FREEBSD32) && defined(__amd64__) struct timeval32 *tv32; struct timeval tv64; @@ -1567,7 +1567,7 @@ bpfioctl(struct cdev *dev, u_long cmd, caddr_t addr, i tv->tv_sec = d->bd_rtout / hz; tv->tv_usec = (d->bd_rtout % hz) * tick; -#if defined(COMPAT_FREEBSD32) && !defined(__mips__) && !defined(__powerpc__) +#if defined(COMPAT_FREEBSD32) && defined(__amd64__) if (cmd == BIOCGRTIMEOUT32) { tv32 = (struct timeval32 *)addr; tv32->tv_sec = tv->tv_sec;