[lkml]   [2002]   [Mar]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Cleanup port 0x80 use (was: Re: IO delay ...)
On Sun, 17 Mar 2002, Jamie Lokier wrote:

> As long as __SLOW_DOWN_IO_PORT is a simple constant, you can just use
> this instead:
> #define __SLOW_DOWN_IO_ASM "\noutb %%al,$" #__SLOW_DOWN_IO_PORT

What cpp are you guys using? Mine does stringification (#s) only with
arguments of function-like macros. However

#define __SLOW_DOWN_IO_P(p) "\noutb %%al,%" #p

won't work, either, because cpp does not recursively substitute macros
for stringification, so in the above _SLOW_DOWN_IO wuold evaluate as
"\noutb %%al,$__SLOW_DOWN_IO_PORT" - bad.

I have tried a number of things to make this a single cpp line, but they
all don't work. The only way would be to change the way the inb_p ...
macros are coded.

It is possible to write
#define __SLOW_DOWN_IO __asm__ ("outb %%al, %0" : : "i" (__SLOW_DOWN_IO_PORT));

but only if one modifies the definitions of inb_p etc which are so complex
that I don't dare touch them now.

Please note that, as an intermediate solution, my patch reduces explicit
usage of the constant 0x80 from ~20 in 8 different source files to 2
immediately following each other in 1 source file.


Martin Wilck Phone: +49 5251 8 15113
Fujitsu Siemens Computers Fax: +49 5251 8 20409
Heinz-Nixdorf-Ring 1
D-33106 Paderborn

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:25    [W:0.072 / U:3.752 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site