From owner-cvs-all Wed Jan 19 14:56: 4 2000 Delivered-To: cvs-all@freebsd.org Received: from gidora.zeta.org.au (gidora.zeta.org.au [203.26.10.25]) by hub.freebsd.org (Postfix) with SMTP id DA1B61530B for ; Wed, 19 Jan 2000 14:55:45 -0800 (PST) (envelope-from bde@zeta.org.au) Received: (qmail 11091 invoked from network); 19 Jan 2000 22:55:28 -0000 Received: from bde.zeta.org.au (203.2.228.102) by gidora.zeta.org.au with SMTP; 19 Jan 2000 22:55:28 -0000 Date: Thu, 20 Jan 2000 09:55:27 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Garrett Wollman Cc: Peter Wemm , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin Makefile src/usr.bin/uac Makefile uac.1 uac.c In-Reply-To: <200001191810.NAA30224@khavrinen.lcs.mit.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk On Wed, 19 Jan 2000, Garrett Wollman wrote: > < said: > > > Is it necessarily Alpha specific? What about sparc? MIPS? other risc cpus > > that might require manual fixups for unaligned accesses? > > i386en with the AC bit set in EFLAGS? i486en :-). The AC bit isn't implemented on plain i386's. Unfortunately, gcc still doesn't generate aligned accesses for all cases, e.g., for copying properly aligned but non-4-byte aligned structs: --- struct misaligned { char x[16]; }; struct { int x; char y; struct misaligned z; } x, y; main() { /* The magic 0x40000 is PSL_AC. */ asm("pushfl; popl %eax; orl $0x40000,%eax; pushl %eax; popfl"); x.z = y.z; } --- The struct assignment is implemented as 4 misaligned load-stores, so the above traps on the first load the assignment. The "fixup" on i386's can be as simple as turning off the AC bit it the kernel, but this defeats the point of applications setting their AC bit in order to find all pessimal alignments. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message