]> mj.ucw.cz Git - pciutils.git/blobdiff - lib/i386-io-linux.h
CXL: Capability vendor ID changed
[pciutils.git] / lib / i386-io-linux.h
index ee119d25094608eb1ecc43be4f4c37951671e2f7..b39b4eb8267d0585ab7bcdede85e7a9137812932 100644 (file)
@@ -1,31 +1,30 @@
 /*
  *     The PCI Library -- Access to i386 I/O ports on Linux
  *
- *     Copyright (c) 1997--2003 Martin Mares <mj@ucw.cz>
+ *     Copyright (c) 1997--2006 Martin Mares <mj@ucw.cz>
  *
  *     Can be freely distributed and used under the terms of the GNU GPL.
  */
 
-#ifdef __GLIBC__
 #include <sys/io.h>
-#else
-#include <asm/io.h>
-#endif
-
-static int intel_iopl_set = -1;
 
 static int
-intel_setup_io(void)
+intel_setup_io(struct pci_access *a UNUSED)
+{
+  return (iopl(3) < 0) ? 0 : 1;
+}
+
+static inline int
+intel_cleanup_io(struct pci_access *a UNUSED)
+{
+  iopl(3);
+  return -1;
+}
+
+static inline void intel_io_lock(void)
 {
-  if (intel_iopl_set < 0)
-    intel_iopl_set = (iopl(3) < 0) ? 0 : 1;
-  return intel_iopl_set;
 }
 
-static inline void
-intel_cleanup_io(void)
+static inline void intel_io_unlock(void)
 {
-  if (intel_iopl_set > 0)
-    iopl(3);
-  intel_iopl_set = -1;
 }