Linux Manual Pages development
 help / color / mirror / Atom feed
* outb(2): terminology correction
@ 2026-08-31  9:09 astian
  2026-09-11 11:36 ` Alejandro Colomar
  0 siblings, 1 reply; 7+ messages in thread
From: astian @ 2026-08-31  9:09 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: linux-man

outb(2) says:

  You must compile with -O or -O2 or similar.  The functions are defined
  as inline macros, and will not be substituted in without optimization
  enabled, causing unresolved references at link time.

"inline macros [...] not substituted in without optimization" doesn't
make any sense.  C pre-processor macros cannot be inline or not inline.
Indeed these are inline *functions* (at least in this system) with
embedded assembly apparently referencing parameters (which, I surmise,
is why the functions need to be inlined by the compiler or the assembly
will not work).

From /usr/include/x86_64-linux-gnu/sys/io.h (glibc 2.43):

  [...]
  #if defined __GNUC__ && __GNUC__ >= 2

  static __inline unsigned char
  inb (unsigned short int __port)
  {
    unsigned char _v;

    __asm__ __volatile__ ("inb %w1,%0":"=a" (_v):"Nd" (__port));
    return _v;
  }

  [...]

  static __inline void
  outb (unsigned char __value, unsigned short int __port)
  {
    __asm__ __volatile__ ("outb %b0,%w1": :"a" (__value), "Nd" (__port));
  }

  [...]

So I would say just s/inline macros/inline functions/g.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-12 22:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  9:09 outb(2): terminology correction astian
2026-09-11 11:36 ` Alejandro Colomar
2026-09-11 11:43   ` Alejandro Colomar
2026-09-11 12:20   ` Arnd Bergmann
2026-09-11 12:54     ` [PATCH v1] man/man2/outb.2: Remove obsolete note about optimizations Alejandro Colomar
2026-09-12 21:58     ` outb(2): terminology correction astian
2026-09-12 22:09       ` Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox