From: george anzinger <george@mvista.com>
To: Nicolas Pitre <nico@cam.org>
Cc: Mark Mielke <mark@mark.mielke.cc>,
"David S. Miller" <davem@redhat.com>,
Russell King <rmk@arm.linux.org.uk>,
simon@baydel.com, alan@lxorguk.ukuu.org.uk,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: The end of embedded Linux?
Date: Mon, 07 Oct 2002 11:54:54 -0700 [thread overview]
Message-ID: <3DA1D87E.81A1351C@mvista.com> (raw)
In-Reply-To: Pine.LNX.4.44.0210071307420.913-100000@xanadu.home
Nicolas Pitre wrote:
>
> On Mon, 7 Oct 2002, Mark Mielke wrote:
>
> > On Mon, Oct 07, 2002 at 09:02:33AM -0700, David S. Miller wrote:
> > > From: Nicolas Pitre <nico@cam.org>
> > > Date: Mon, 7 Oct 2002 12:05:16 -0400 (EDT)
> > > 2) Not inlining inb() and friend reduce the bloat but then you further
> > > impact performances on CPUs which are generally many order of
> > > magnitude slower than current desktop machines.
> > > I don't buy this one. You are saying that the overhead of a procedure
> > > call is larger than the overhead of going out over the I/O bus to
> > > touch a device?
> >
> > I think the key phrase is 'further impact'.
> >
> > If anything, the procedure call increases latency.
> >
> > Although... I don't see why CONFIG_TINY wouldn't be able to decide whether
> > inb() should be inlined or not...
>
> Please don't mix up the issues.
>
> The problems with inb() and friends as it stands in the embedded world right
> now as to do with code cleanness not kernel image bloat. Nothing to be
> solved with CONFIG_TINY. Please let's keep those issues separate.
>
> Here's the IO macro issue: On some embedded platforms the IO bus is only 8
> bit wide or only 16 bit wide, or address lines are shifted so registers
> offsets are not the same, etc. All this because embedded platforms are
> often using standard ISA peripheral chipsets since they can be easily glued
> to any kind of bare buses or static memory banks.
>
> The nice thing here is the fact that only by modifying inb() and friends you
> can reuse most current kernel drivers without further modifications.
> However the modifs to inb() are often different whether the peripheral in
> question is wired to a static memory bank, to the PCMCIA space or onto some
> expansion board via a CPLD or other weirdness some hardware designers are
> pleased to come with. Hence no global inb() and friend tweaking is possible
> without some performance hit by using a runtime fixup based on the address
> passed to them.
>
> We therefore end up with something that looks like this in each drivers for
> which a fixup is needed:
>
> #ifdef CONFIG_ASSABET_NEPONSET
>
> /*
> * These functions allow us to handle IO addressing as we wish - this
> * ethernet controller can be connected to a variety of busses. Some
> * busses do not support 16 bit or 32 bit transfers. --rmk
> */
> static inline u8 smc_inb(u_int base, u_int reg)
> {
> u_int port = base + reg * 4;
>
> return readb(port);
> }
>
> static inline u16 smc_inw(u_int base, u_int reg)
> {
> u_int port = base + reg * 4;
>
> return readb(port) | readb(port + 4) << 8;
> }
>
> static inline void smc_outb(u8 val, u_int base, u_int reg)
> {
> u_int port = base + reg * 4;
>
> writeb(val, port);
> }
>
> static inline void smc_outw(u16 val, u_int base, u_int reg)
> {
> u_int port = base + reg * 4;
>
> writeb(val, port);
> writeb(val >> 8, port + 4);
> }
>
> #endif
>
> As you can see such code duplicated multiple times for all bus arrangements
> in existence out there is just not pretty and was refused by Alan. We lack
> a global lightweight IO abstraction to nicely override the default IO macros
> for individual drivers at compile time to fix that problem optimally and
> keep the driver proper clean.
Uh, what about stuff like this (from tulip.h):
#ifndef USE_IO_OPS
#undef inb
#undef inw
#undef inl
#undef outb
#undef outw
#undef outl
#define inb(addr) readb((void*)(addr))
#define inw(addr) readw((void*)(addr))
#define inl(addr) readl((void*)(addr))
#define outb(val,addr) writeb((val), (void*)(addr))
#define outw(val,addr) writew((val), (void*)(addr))
#define outl(val,addr) writel((val), (void*)(addr))
#endif /* !USE_IO_OPS */
--
George Anzinger george@mvista.com
High-res-timers:
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml
next prev parent reply other threads:[~2002-10-07 18:50 UTC|newest]
Thread overview: 115+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-05 19:36 The end of embedded Linux? Gigi Duru
2002-10-05 19:46 ` Francois Romieu
2002-10-05 19:49 ` Ben Greear
2002-10-05 19:53 ` Andre Hedrick
2002-10-05 20:52 ` Gigi Duru
2002-10-05 20:58 ` Mark Mielke
2002-10-06 1:54 ` Andre Hedrick
2002-10-07 23:28 ` Gigi Duru
2002-10-06 0:46 ` Rik van Riel
2002-10-06 1:52 ` Andre Hedrick
2002-10-06 20:20 ` Gigi Duru
2002-10-07 2:01 ` Andre Hedrick
2002-10-06 4:28 ` David S. Miller
2002-10-06 16:53 ` Alan Cox
2002-10-06 18:50 ` george anzinger
2002-10-07 10:06 ` simon
2002-10-07 10:36 ` David S. Miller
2002-10-07 11:57 ` Russell King
2002-10-07 12:10 ` Abraham vd Merwe
2002-10-07 14:12 ` Alan Cox
2002-10-07 16:05 ` Nicolas Pitre
2002-10-07 16:02 ` David S. Miller
2002-10-07 16:20 ` Benjamin LaHaise
2002-10-07 16:38 ` Nicolas Pitre
2002-10-07 16:53 ` Mark Mielke
2002-10-07 17:45 ` Nicolas Pitre
2002-10-07 18:11 ` Richard B. Johnson
2002-10-07 18:54 ` george anzinger [this message]
2002-10-07 19:11 ` Russell King
2002-10-07 20:05 ` Ben Greear
2002-10-12 10:08 ` Richard Zidlicky
2002-10-14 12:26 ` Richard Zidlicky
2002-10-07 17:15 ` simon
2002-10-07 17:24 ` David S. Miller
2002-10-07 20:22 ` Alan Cox
2002-10-07 22:22 ` Christer Weinigel
2002-10-07 22:52 ` Alan Cox
2002-10-07 22:56 ` Arnaldo Carvalho de Melo
2002-10-09 11:19 ` Jamie Lokier
2002-10-08 10:11 ` simon
2002-10-08 11:11 ` jbradford
2002-10-08 11:53 ` Richard B. Johnson
2002-10-08 12:09 ` jbradford
2002-10-08 11:25 ` Vojtech Pavlik
2002-10-08 11:25 ` Alan Cox
2002-10-08 20:04 ` David S. Miller
2002-10-08 22:53 ` Alan Cox
2002-10-08 22:38 ` David S. Miller
2002-10-08 11:27 ` jw schultz
2002-10-09 7:37 ` Alexander Kellett
2002-10-09 11:49 ` Alan Cox
2002-10-09 11:53 ` Richard B. Johnson
2002-10-09 19:17 ` jbradford
2002-10-09 23:49 ` jw schultz
2002-10-13 16:30 ` Eric W. Biederman
2002-10-09 12:42 ` Ian Molton
2002-10-10 4:47 ` Shane Nay
2002-10-08 15:52 ` David Lang
2002-10-09 10:53 ` David Woodhouse
2002-10-07 10:55 ` Xavier Bestel
2002-10-07 17:20 ` simon
2002-10-07 22:59 ` Arnaldo Carvalho de Melo
2002-10-07 23:18 ` Alan Cox
2002-10-07 16:15 ` Matt Porter
2002-10-07 16:22 ` Matt Porter
2002-10-07 16:41 ` Rob Landley
2002-10-07 21:56 ` Gigi Duru
2002-10-07 19:44 ` Rob Landley
2002-10-08 13:22 ` Thomas Molina
2002-10-08 16:34 ` Rob Landley
2002-10-07 23:20 ` Matt Porter
2002-10-07 19:50 ` Rob Landley
2002-10-08 15:04 ` Matt Porter
2002-10-08 16:52 ` Rob Landley
2002-10-09 11:38 ` Adrian Bunk
2002-10-09 12:15 ` [patch] show Fusion MPT dialog only when CONFIG_BLK_DEV_SD is set Adrian Bunk
2002-10-09 19:55 ` Rob Landley
2002-10-09 19:54 ` [PATCH]: Move Fusion MPT config menu into scsi driver support (was Re: The end of embedded Linux?) Rob Landley
2002-10-07 23:01 ` The end of embedded Linux? Arnaldo Carvalho de Melo
2002-10-07 23:23 ` Alan Cox
2002-10-07 23:47 ` Arnaldo Carvalho de Melo
2002-10-08 0:06 ` Arnaldo Carvalho de Melo
2002-10-08 1:23 ` Xcytame@yahoo.es
2002-10-06 13:02 ` Ian Molton
2002-10-05 19:53 ` jbradford
2002-10-05 22:23 ` Oliver Xymoron
2002-10-05 23:28 ` Arnaldo Carvalho de Melo
2002-10-06 1:57 ` Andre Hedrick
2002-10-12 4:01 ` Daniel Phillips
2002-10-12 4:09 ` William Lee Irwin III
2002-10-06 0:36 ` Rik van Riel
2002-10-06 0:41 ` Zwane Mwaikambo
2002-10-06 0:50 ` William Lee Irwin III
2002-10-06 1:00 ` Zwane Mwaikambo
2002-10-06 0:44 ` William Lee Irwin III
2002-10-06 22:24 ` Aaron Lehmann
2002-10-06 22:54 ` William Lee Irwin III
2002-10-07 1:33 ` Andre Hedrick
2002-10-07 22:25 ` Andre Hedrick
2002-10-07 9:10 ` Jan-Benedict Glaw
[not found] <Pine.LNX.4.33.0210061854190.24860-100000@coffee.psychology.mcmaster.ca>
2002-10-07 5:38 ` Gigi Duru
2002-10-07 5:42 ` Rik van Riel
2002-10-07 6:06 ` Arnaldo Carvalho de Melo
2002-10-07 12:04 ` Richard B. Johnson
2002-10-07 12:00 ` David S. Miller
2002-10-07 12:32 ` Richard B. Johnson
2002-10-07 12:29 ` David S. Miller
2002-10-07 13:06 ` Dana Lacoste
-- strict thread matches above, loose matches on Subject: below --
2002-10-07 20:04 Hell.Surfers
2002-10-07 23:01 ` David S. Miller
2002-10-08 0:10 ` jw schultz
2002-10-08 9:36 Hell.Surfers
2002-10-08 9:51 Hell.Surfers
2002-10-08 20:00 ` David S. Miller
2002-10-08 12:05 Hicks, Jamey
2002-10-12 20:45 Hell.Surfers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3DA1D87E.81A1351C@mvista.com \
--to=george@mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@mark.mielke.cc \
--cc=nico@cam.org \
--cc=rmk@arm.linux.org.uk \
--cc=simon@baydel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox