Re: New resources - pls, explain :-(

Alan Cox (alan@lxorguk.ukuu.org.uk)
Wed, 11 Aug 1999 23:47:19 +0100 (BST)


> Various implementations of writel() do stuff to stall the pipeline a bit
> anyway. It's really a convenience/speed tradeoff. IMHO writel() should
> continue to "do the right thing" as it currently does, regardless of its

They don't do the right thing at the moment. Its platform specific whether
you get ordering, endian conversion and other stuff. In short its a mess

> buses. The 'if' has to occur somewhere, if your driver supports
> multiple buses. I would rather have the ifs in a common place,
> writel(), to avoid
>
> void vga_mm_wcrt (caddr_t vga_base, unsigned char reg, unsigned char
> val)
> {
> if (zorro_bus) {
> zorro_writeb
> zorro_writeb
> } else if (pci_bus) {
> ...use pci_writeb to duplicate above logic...
> } else if (sbus) {
> ...use sbus_writeb to duplicate above logic...
> }
> }

But you should be unrolling the loop for each case to avoid the overhead

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/