2 * The PCI Library -- Access to i386 I/O ports on Solaris
4 * Copyright (c) 2003 Bill Moore <billm@eng.sun.com>
5 * Copyright (c) 2003 Martin Mares <mj@ucw.cz>
7 * Can be freely distributed and used under the terms of the GNU GPL.
10 #include <sys/sysi86.h>
13 static int intel_iopl_set = -1;
18 if (intel_iopl_set < 0)
20 if (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0)
25 return intel_iopl_set;
29 intel_cleanup_io(void)
31 if (intel_iopl_set > 0)
33 /* FIXME: How to switch off I/O port access? */
42 __asm__ __volatile__ ("inb (%w1)":"=a" (v):"Nd" (port));
50 __asm__ __volatile__ ("inw (%w1)":"=a" (v):"Nd" (port));
58 __asm__ __volatile__ ("inl (%w1)":"=a" (v):"Nd" (port));
63 outb (u8 value, u16 port)
65 __asm__ __volatile__ ("outb (%w1)": :"a" (value), "Nd" (port));
69 outw (u16 value, u16 port)
71 __asm__ __volatile__ ("outw (%w1)": :"a" (value), "Nd" (port));
75 outl (u32 value, u16 port)
77 __asm__ __volatile__ ("outl (%w1)": :"a" (value), "Nd" (port));