Re: [PATCH] Cleanup port 0x80 use (was: Re: IO delay ...)

Andreas Dilger (adilger@clusterfs.com)
Fri, 15 Mar 2002 11:57:22 -0700


On Mar 15, 2002 18:41 +0100, Martin Wilck wrote:
> +#define __SLOW_DOWN_IO_PORT 0x80
> +#define __SLOW_DOWN_IO "\noutb %%al,$0x80"

You may want to change the above to:
#define __SLOW_DOWN_IO_ASM "\noutb %%al,$__SLOW_DOWN_IO_PORT"

> + outb(3, __SLOW_DOWN_IO_PORT);

You may also want to replace the above entirely with a macro, like:
#define __SLOW_DOWN_IO outb(3, __SLOW_DOWN_IO_PORT)

so that on architectures that don't need/have this ISA nonsense can
just replace __SLOW_DOWN_IO with something else like udelay.

> --- ./arch/i386/boot/setup.S.orig Fri Mar 15 17:23:15 2002
> +++ ./arch/i386/boot/setup.S Fri Mar 15 18:33:12 2002
> @@ -65,6 +66,7 @@
> # ... and the former contents of CS
>
> DELTA_INITSEG = SETUPSEG - INITSEG # 0x0020
> +DELAY_PORT = __SLOW_DOWN_IO_PORT # port for IO delay (0x80)
>
> .code16
> .globl begtext, begdata, begbss, endtext, enddata, endbss

May as well just stick with a single define here (i.e. remove DELAY_PORT).

> @@ -1001,7 +1003,7 @@
>
> # Delay is needed after doing I/O
> delay:
> - outb %al,$0x80
> + outb %al,$DELAY_PORT
> ret

And use __SLOW_DOWN_IO_ASM here.

Cheers, Andreas

--
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

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