diff -cNr 915resolution-0.5.3.orig/915resolution.c 915resolution-0.5.3_solaris/915resolution.c *** 915resolution-0.5.3.orig/915resolution.c 2007-04-15 19:46:56.000000000 +0900 --- 915resolution-0.5.3_solaris/915resolution.c 2007-05-16 13:21:37.143471000 +0900 *************** *** 22,40 **** #include #include #include - #include #include #include ! ! ! #define NEW(a) ((a *)(calloc(1, sizeof(a)))) #define FREE(a) (free(a)) #define VBIOS_START 0xc0000 #define VBIOS_SIZE 0x10000 ! #define VBIOS_FILE "/dev/mem" #define FALSE 0 #define TRUE 1 --- 22,39 ---- #include #include #include #include #include ! #include ! #include ! #include "bsd_io.h" #define NEW(a) ((a *)(calloc(1, sizeof(a)))) #define FREE(a) (free(a)) #define VBIOS_START 0xc0000 #define VBIOS_SIZE 0x10000 ! #define VBIOS_FILE "/dev/xsvc" #define FALSE 0 #define TRUE 1 *************** *** 160,180 **** boolean unlocked; } vbios_map; void initialize_system(char * filename) { ! if (!filename) { ! if (iopl(3) < 0) { ! perror("Unable to obtain the proper IO permissions"); ! exit(2); ! } } } cardinal get_chipset_id(void) { ! outl(0x80000000, 0xcf8); ! return inl(0xcfc); } chipset_type get_chipset(cardinal id) { --- 159,189 ---- boolean unlocked; } vbios_map; + static void *memmem(const void *haystack, size_t haystacklen, + const void *needle, size_t needlelen) { + void *ptr = haystack; + while (ptr < haystack + (haystacklen - needlelen)) { + if (memcmp(ptr, needle, needlelen) == 0) { + return (void*)ptr; + } + ptr++; + } + return NULL; + } void initialize_system(char * filename) { ! if (!filename) { ! if( sysi86(SI86V86, V86SC_IOPL, PS_IOPL) < 0){; ! perror("Unable to obtain the proper IO permissions"); ! exit(2); ! } } } cardinal get_chipset_id(void) { ! return 0x25908086; } chipset_type get_chipset(cardinal id) { diff -cNr 915resolution-0.5.3.orig/Makefile 915resolution-0.5.3_solaris/Makefile *** 915resolution-0.5.3.orig/Makefile 2007-04-15 16:31:29.000000000 +0900 --- 915resolution-0.5.3_solaris/Makefile 2007-05-16 13:12:40.320961000 +0900 *************** *** 1,5 **** PRG=915resolution ! SRCS=915resolution.c OBJS=${SRCS:.c=.o} --- 1,5 ---- PRG=915resolution ! CC=/usr/sfw/bin/gcc SRCS=915resolution.c OBJS=${SRCS:.c=.o} diff -cNr 915resolution-0.5.3.orig/bsd_io.h 915resolution-0.5.3_solaris/bsd_io.h *** 915resolution-0.5.3.orig/bsd_io.h 1970-01-01 09:00:00.000000000 +0900 --- 915resolution-0.5.3_solaris/bsd_io.h 2007-05-16 13:12:40.355890000 +0900 *************** *** 0 **** --- 1,40 ---- + #include + + #ifndef _BSD_IO_H_ + #define _BSD_IO_H_ + /* Ripped out of cpufunc.h, changed args to match Linux. */ + static __inline u_int + inl(u_int port) + { + u_int data; + + __asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port)); + return (data); + } + + static __inline void + outl(u_int data, u_int port) + { + /* + * outl() and outw() aren't used much so we haven't looked at + * possible micro-optimizations such as the unnecessary + * assignment for them. + */ + __asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port)); + } + + static __inline void + outb(u_char data, u_int port) + { + __asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port))); + } + static __inline__ unsigned int + inb(unsigned short int port) + { + unsigned char ret; + __asm__ __volatile__("in%B0 (%1)" : + "=a" (ret) : + "d" (port)); + return ret; + } + #endif