From owner-svn-src-all@FreeBSD.ORG Sun Mar 16 00:53:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 172448B9; Sun, 16 Mar 2014 00:53:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB648942; Sun, 16 Mar 2014 00:53:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s2G0rfk9073672; Sun, 16 Mar 2014 00:53:41 GMT (envelope-from jmg@svn.freebsd.org) Received: (from jmg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s2G0rfmA073668; Sun, 16 Mar 2014 00:53:41 GMT (envelope-from jmg@svn.freebsd.org) Message-Id: <201403160053.s2G0rfmA073668@svn.freebsd.org> From: John-Mark Gurney Date: Sun, 16 Mar 2014 00:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Mar 2014 00:53:42 -0000 Author: jmg Date: Sun Mar 16 00:53:40 2014 New Revision: 263214 URL: http://svnweb.freebsd.org/changeset/base/263214 Log: change td_retval into a union w/ off_t, with defines to mask the change... This eliminates a cast, and also forces td_retval (often 2 32-bit registers) to be aligned so that off_t's can be stored there on arches with strict alignment requirements like armeb (AVILA)... On i386, this doesn't change alignment, and on amd64 it doesn't either, as register_t is already 64bits... This will also prevent future breakage due to people adding additional fields to the struct... This gets AVILA booting a bit farther... Reviewed by: bde Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_vnops.c head/sys/sys/proc.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/compat/freebsd32/freebsd32_misc.c Sun Mar 16 00:53:40 2014 (r263214) @@ -1504,7 +1504,7 @@ freebsd32_lseek(struct thread *td, struc ap.whence = uap->whence; error = sys_lseek(td, &ap); /* Expand the quad return into two parts for eax and edx */ - pos = *(off_t *)(td->td_retval); + pos = td->td_uretoff.tdu_off; td->td_retval[RETVAL_LO] = pos & 0xffffffff; /* %eax */ td->td_retval[RETVAL_HI] = pos >> 32; /* %edx */ return error; Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/kern/uipc_shm.c Sun Mar 16 00:53:40 2014 (r263214) @@ -270,7 +270,7 @@ shm_seek(struct file *fp, off_t offset, if (offset < 0 || offset > shmfd->shm_size) error = EINVAL; else - *(off_t *)(td->td_retval) = offset; + td->td_uretoff.tdu_off = offset; } foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/kern/vfs_vnops.c Sun Mar 16 00:53:40 2014 (r263214) @@ -2080,7 +2080,7 @@ vn_seek(struct file *fp, off_t offset, i if (error != 0) goto drop; VFS_KNOTE_UNLOCKED(vp, 0); - *(off_t *)(td->td_retval) = offset; + td->td_uretoff.tdu_off = offset; drop: foffset_unlock(fp, offset, error != 0 ? FOF_NOUPDATE : 0); return (error); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sun Mar 16 00:22:07 2014 (r263213) +++ head/sys/sys/proc.h Sun Mar 16 00:53:40 2014 (r263214) @@ -300,7 +300,11 @@ struct thread { TDS_RUNQ, TDS_RUNNING } td_state; /* (t) thread state */ - register_t td_retval[2]; /* (k) Syscall aux returns. */ + union { + register_t tdu_retval[2]; + off_t tdu_off; + } td_uretoff; /* (k) Syscall aux returns. */ +#define td_retval td_uretoff.tdu_retval struct callout td_slpcallout; /* (h) Callout for sleep. */ struct trapframe *td_frame; /* (k) */ struct vm_object *td_kstack_obj;/* (a) Kstack object. */