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--2006 Martin Mares <mj@ucw.cz>
7 * Can be freely distributed and used under the terms of the GNU GPL.
10 #include <sys/sysi86.h>
14 intel_setup_io(struct pci_access *a UNUSED)
16 return (sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0) ? 0 : 1;
20 intel_cleanup_io(struct pci_access *a UNUSED)
22 /* FIXME: How to switch off I/O port access? */
30 __asm__ __volatile__ ("inb (%w1)":"=a" (v):"Nd" (port));
38 __asm__ __volatile__ ("inw (%w1)":"=a" (v):"Nd" (port));
46 __asm__ __volatile__ ("inl (%w1)":"=a" (v):"Nd" (port));
51 outb (u8 value, u16 port)
53 __asm__ __volatile__ ("outb (%w1)": :"a" (value), "Nd" (port));
57 outw (u16 value, u16 port)
59 __asm__ __volatile__ ("outw (%w1)": :"a" (value), "Nd" (port));
63 outl (u32 value, u16 port)
65 __asm__ __volatile__ ("outl (%w1)": :"a" (value), "Nd" (port));