This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Cleanup of <sys/io.h> for 2.2



IMHO we should cleanup the i386 version of <sys/io.h>.  Shouldn't we
also add the extern inline functions to glibc (like we do with
<bits/string*.h>)?

glibc 2.1 needs a similiar cleanup patch which I can send if you like
to add it.

Andreas

2000-01-29  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/i386/sys/io.h: Add missing ints, use
	_EXTERN_INLINE, compile inline assembler functions only with gcc.

============================================================
Index: sysdeps/unix/sysv/linux/i386/sys/io.h
--- sysdeps/unix/sysv/linux/i386/sys/io.h	2000/01/23 08:53:43	1.1
+++ sysdeps/unix/sysv/linux/i386/sys/io.h	2000/01/29 10:46:31
@@ -38,9 +38,15 @@
    privileges. */
 extern int iopl (int __level) __THROW;
 
+#if defined __GNUC__ && __GNUC__ >= 2
 
-extern inline unsigned char
-inb (unsigned short port)
+# ifndef _EXTERN_INLINE
+#  define _EXTERN_INLINE extern __inline
+# endif
+
+
+_EXTERN_INLINE unsigned char
+inb (unsigned short int port)
 {
   unsigned char _v;
 
@@ -48,8 +54,8 @@
   return _v;
 }
 
-extern inline unsigned char
-inb_p (unsigned short port)
+_EXTERN_INLINE unsigned char
+inb_p (unsigned short int port)
 {
   unsigned char _v;
 
@@ -57,8 +63,8 @@
   return _v;
 }
 
-extern inline unsigned short
-inw (unsigned short port)
+_EXTERN_INLINE unsigned short int
+inw (unsigned short int port)
 {
   unsigned short _v;
 
@@ -66,17 +72,17 @@
   return _v;
 }
 
-extern inline unsigned short
-inw_p (unsigned short port)
+_EXTERN_INLINE unsigned short int
+inw_p (unsigned short int port)
 {
-  unsigned short _v;
+  unsigned short int _v;
 
   __asm__ __volatile__ ("inw %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
   return _v;
 }
 
-extern inline unsigned int
-inl (unsigned short port)
+_EXTERN_INLINE unsigned int
+inl (unsigned short int port)
 {
   unsigned int _v;
 
@@ -84,95 +90,97 @@
   return _v;
 }
 
-extern inline unsigned int
-inl_p (unsigned short port)
+_EXTERN_INLINE unsigned int
+inl_p (unsigned short int port)
 {
   unsigned int _v;
   __asm__ __volatile__ ("inl %w1,%0\noutb %%al,$0x80":"=a" (_v):"Nd" (port));
   return _v;
 }
 
-extern inline void
-outb (unsigned char value, unsigned short port)
+_EXTERN_INLINE void
+outb (unsigned char value, unsigned short int port)
 {
   __asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "Nd" (port));
 }
 
-extern inline void
-outb_p (unsigned char value, unsigned short port)
+_EXTERN_INLINE void
+outb_p (unsigned char value, unsigned short int port)
 {
   __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80"::"a" (value),
 			"Nd" (port));
 }
 
-extern inline void
-outw (unsigned short value, unsigned short port)
+_EXTERN_INLINE void
+outw (unsigned short value, unsigned short int port)
 {
   __asm__ __volatile__ ("outw %w0,%w1"::"a" (value), "Nd" (port));
 
 }
 
-extern inline void
-outw_p (unsigned short value, unsigned short port)
+_EXTERN_INLINE void
+outw_p (unsigned short int value, unsigned short int port)
 {
   __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80"::"a" (value),
 			"Nd" (port));
 }
 
-extern inline void
-outl (unsigned int value, unsigned short port)
+_EXTERN_INLINE void
+outl (unsigned int value, unsigned short int port)
 {
   __asm__ __volatile__ ("outl %0,%w1"::"a" (value), "Nd" (port));
 }
 
-extern inline void
-outl_p (unsigned int value, unsigned short port)
+_EXTERN_INLINE void
+outl_p (unsigned int value, unsigned short int port)
 {
   __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80"::"a" (value),
 			"Nd" (port));
 }
 
-extern inline void
-insb (unsigned short port, void *addr, unsigned long count)
+_EXTERN_INLINE void
+insb (unsigned short int port, void *addr, unsigned long int count)
 {
   __asm__ __volatile__ ("cld ; rep ; insb":"=D" (addr),
 			"=c" (count):"d" (port), "0" (addr), "1" (count));
 }
 
-extern inline void
-insw (unsigned short port, void *addr, unsigned long count)
+_EXTERN_INLINE void
+insw (unsigned short int port, void *addr, unsigned long int count)
 {
   __asm__ __volatile__ ("cld ; rep ; insw":"=D" (addr),
 			"=c" (count):"d" (port), "0" (addr), "1" (count));
 }
 
-extern inline void
-insl (unsigned short port, void *addr, unsigned long count)
+_EXTERN_INLINE void
+insl (unsigned short int port, void *addr, unsigned long int count)
 {
   __asm__ __volatile__ ("cld ; rep ; insl":"=D" (addr),
 			"=c" (count):"d" (port), "0" (addr), "1" (count));
 }
 
-extern inline void
-outsb (unsigned short port, const void *addr, unsigned long count)
+_EXTERN_INLINE void
+outsb (unsigned short int port, const void *addr, unsigned long int count)
 {
   __asm__ __volatile__ ("cld ; rep ; outsb":"=S" (addr),
 			"=c" (count):"d" (port), "0" (addr), "1" (count));
 }
 
-extern inline void
-outsw (unsigned short port, const void *addr, unsigned long count)
+_EXTERN_INLINE void
+outsw (unsigned short int port, const void *addr, unsigned long int count)
 {
   __asm__ __volatile__ ("cld ; rep ; outsw":"=S" (addr),
 			"=c" (count):"d" (port), "0" (addr), "1" (count));
 }
 
-extern inline void
-outsl (unsigned short port, const void *addr, unsigned long count)
+_EXTERN_INLINE void
+outsl (unsigned short int port, const void *addr, unsigned long int count)
 {
   __asm__ __volatile__ ("cld ; rep ; outsl":"=S" (addr),
 			"=c" (count):"d" (port), "0" (addr), "1" (count));
 }
+
+#endif
 
 __END_DECLS
 #endif /* _SYS_IO_H */

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.rhein-neckar.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]