From owner-svn-src-all@FreeBSD.ORG Sun Mar 16 01:17:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E6E6E21; Sun, 16 Mar 2014 01:17:54 +0000 (UTC) Received: from mail-qc0-x235.google.com (mail-qc0-x235.google.com [IPv6:2607:f8b0:400d:c01::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB752AC6; Sun, 16 Mar 2014 01:17:53 +0000 (UTC) Received: by mail-qc0-f181.google.com with SMTP id e9so4458709qcy.26 for ; Sat, 15 Mar 2014 18:17:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=xuBeMC3zNN7pt85OSNwlCN8TAzdYOwH4X16c6P1T3EQ=; b=PiP+FZxCpWSEkkXHIRlAgLXvnXkw/BDs6BiI010+kBCLOjL2Jg/WfEATb/GyhqwETd 6sgRN0+D7amU7rt3fuQCflNnozRPvJpnQy5jx/m3ZqQZ8gqblLusIrFzvUe/DR/9FB4o XY9Nuvq1U4/LESw2z0SHjIuepx77B9y5lp29bRMq3LW8aN2mfnTkvo9znGyptCEO+U1Q s0uMJtL93ff/jepieYm6UPOMfm5BN9ueANs/RfhIt52ZfqMtFTGyOyPZe+SX+C+nfbm+ ZTJw51YUx14JiKUK1f+hyKG92YYYzaDZi8vK/7f/T7xFTWf6htyqU6hpplGZMLgtT67P SK3Q== MIME-Version: 1.0 X-Received: by 10.140.92.6 with SMTP id a6mr18244095qge.34.1394932672879; Sat, 15 Mar 2014 18:17:52 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.8.137 with HTTP; Sat, 15 Mar 2014 18:17:52 -0700 (PDT) In-Reply-To: <201403160053.s2G0rfmA073668@svn.freebsd.org> References: <201403160053.s2G0rfmA073668@svn.freebsd.org> Date: Sat, 15 Mar 2014 18:17:52 -0700 X-Google-Sender-Auth: abn8jKBtfJBt8OfRQPDeQrrIqYA Message-ID: Subject: Re: svn commit: r263214 - in head/sys: compat/freebsd32 kern sys From: Adrian Chadd To: John-Mark Gurney Content-Type: text/plain; charset=ISO-8859-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" 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 01:17:54 -0000 How far along does it get? -a On 15 March 2014 17:53, John-Mark Gurney wrote: > 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. */ >