[PATCH 3/4] solaris: Implement I/O port API

Alan Coopersmith alan.coopersmith at oracle.com
Wed Sep 22 18:41:38 PDT 2010


Failed to build on Solaris 11 with Sun Studio 12.1:

"solx_devfs.c", line 147: undefined symbol: PS_IOPL
"solx_devfs.c", line 164: improper member use: base
"solx_devfs.c", line 164: operands have incompatible types:
         struct pci_device {unsigned short domain, unsigned char bus, unsigned
char dev, unsigned char func, unsigned short vendor_id, unsigned short
device_id, unsigned short subvendor_id, unsigned short subdevice_id, unsigned
int device_class, unsigned char revision, array[6] of struct pci_mem_region {..}
regions, unsigned long long rom_size, int irq, int user_data, int vgaarb_rsrc}
"+" unsigned long long
"solx_devfs.c", line 164: argument #3 is incompatible with prototype:
        prototype: unsigned long long : "solx_devfs.c", line 142
        argument : struct pci_device {unsigned short domain, unsigned char bus,
unsigned char dev, unsigned char func, unsigned short vendor_id, unsigned short
device_id, unsigned short subvendor_id, unsigned short subdevice_id, unsigned
int device_class, unsigned char revision, array[6] of struct pci_mem_region {..}
regions, unsigned long long rom_size, int irq, int user_data, int vgaarb_rsrc}
"solx_devfs.c", line 179: warning: implicit function declaration: inl
"solx_devfs.c", line 185: warning: implicit function declaration: inw
"solx_devfs.c", line 191: warning: implicit function declaration: inb
"solx_devfs.c", line 198: warning: implicit function declaration: outl
"solx_devfs.c", line 205: warning: implicit function declaration: outw
"solx_devfs.c", line 212: warning: implicit function declaration: outb
cc: acomp failed for solx_devfs.c


The PS_IOPL definition is fixed by:

@@ -36,7 +36,10 @@
 #include <sys/mman.h>
 #include <errno.h>
 #include <sys/pci.h>
+#ifdef __x86
 #include <sys/sysi86.h>
+#include <sys/psw.h>
+#endif
 #include <libdevinfo.h>
 #include "pci_tools.h"



The next three around the "base" member of the regions struct
seem to be a typo for base_addr:

--- a/src/solx_devfs.c
+++ b/src/solx_devfs.c
@@ -162,7 +162,8 @@ pci_device_solx_open_device_io(struct pci_io_handle *ret,
                                pciaddr_t base, pciaddr_t size)
 {
     return pci_device_solx_open_legacy_io(ret, dev,
-                                          dev->regions[bar].base + base, size);
+                                          dev->regions[bar].base_addr + base,
+                                         size);

 }

The rest are simply missing the in*/out* functions previously defined in either
compiler.h or hw/xfree86/os-support/solaris/*.il & *.S

Pasting in the inline asm definitions from compiler.h allows it to build with
the Studio 12.1 compilers - I don't remember how far back the gcc-compatible
inline asm was added to Sun Studio - version 12 or 12.1 I think.

Not runtime tested yet, since I assume that requires another patch to come for
Xorg itself.

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list