From owner-cvs-all Tue Sep 28 18:58:59 1999 Delivered-To: cvs-all@freebsd.org Received: from eclogite.eps.nagoya-u.ac.jp (eclogite.eps.nagoya-u.ac.jp [133.6.124.145]) by hub.freebsd.org (Postfix) with ESMTP id 8D59A14DDD; Tue, 28 Sep 1999 18:58:49 -0700 (PDT) (envelope-from kato@ganko.eps.nagoya-u.ac.jp) Received: from localhost (gneiss.eps.nagoya-u.ac.jp [133.6.124.148]) by eclogite.eps.nagoya-u.ac.jp (8.9.3/3.7W) with ESMTP id KAA04214; Wed, 29 Sep 1999 10:56:43 +0900 (JST) To: bde@zeta.org.au Cc: imp@village.org, winter@jurai.net, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Cc: FreeBSD98-hackers@jp.freebsd.org Subject: Re: cvs commit: src/sys/conf files src/sys/i386/conf files.i386 From: KATO Takenori In-Reply-To: Your message of "Mon, 27 Sep 1999 23:52:49 +1000 (EST)" References: X-Mailer: Mew version 1.93 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA) X-PGP-Fingerprint: 03 72 85 36 62 46 23 03 52 B1 10 22 44 10 0D 9E Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990929105613Q.kato@gneiss.eps.nagoya-u.ac.jp> Date: Wed, 29 Sep 1999 10:56:13 +0900 X-Dispatcher: imput version 980905(IM100) Lines: 34 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk Bruce Evans wrote: > I don't like this much. At least for PIO, indirection may be best in > all cases. I use it for most accesses in sio. I pre-compute all the > heavily used port addresses at attach time to avoid additions at > compile time. > > E.g., the line status port is accessed via com->line_status_port instead > of via (com->iobase + com_lsr). The former is always faster (since gcc > doesn't (can't?) know enough about aliasing to use a previously loaded > value of com->iobase, and the addition takes some time. Even if > com->iobase is explicitly loaded into a (register) variable, the > computation of (iobase + com_lsr) takes the same time as the load of > com->line_status_register provided the machine is an i386 and > com->line_status_register is in the L1 cache. (This is where MEMIO may > benefit if we use (iobase + com_lsr). On machines with base+index > addressing, the addition tends to be free. This is also the only excuse > for pushing the addition to the bus space functions.) If all drivers use your method, it may not have any problem except you pointed. But if there is a bus_space_foo with non-zero offset, it may not work on non-contig address space bus (e.g., ISA-like 16-bit bus on PC98). Of cource, such code can be rewrited to solve this problem. On the point of performance, I think Bruce's method is better than Warner's method, but on the point of readablity or beauty of source code, I think Warner's method is better. Hmm.... -----------------------------------------------+--------------------------+ KATO Takenori | FreeBSD | Dept. Earth Planet. Sci, Nagoya Univ. | The power to serve! | Nagoya, 464-8602, Japan | http://www.FreeBSD.org/ | ++++ FreeBSD(98) 3.2: Rev. 01 available! |http://www.jp.FreeBSD.org/| ++++ FreeBSD(98) 2.2.8: Rev. 02 available! +==========================+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message