Hello This is the patch necessary for freeipmi to compile on sparc machines. The solution for the typedef error is simple, don't include <asm/io.h> because iopl,inb,outb isn't used. For testing i just put printf in _INB _OUTB macro, but replace it with read/write is easy. It's necessary to make that __ARCH_IS_SPARC__ is defined in config.h when compiling on sparc.
But now, there is an another problem. Some tools segfault when using it. For example i saw that smbios segfault ipmi-locate. (when removing smbios_probe...() from ipmi-locate.c it detect nothing). The other problem is, do my sparc have really IPMI? The thing that makes me thinking that is that the lm_sensors tools(sensors-detect) say to me: Probing for `IPMI BMC KCS' at 0xca0... Success! (confidence 4, driver `bmcsensors') Probing for `IPMI BMC SMIC' at 0xca8... Success! (confidence 4, driver `bmcsensors') but when i search the web for infos about ipmi on it, i don't find anything. I also tried to check this addresses with a home-prog and i just read 0 value. Same value in 0xca1 0xca2 etc.. so i think that memory is initialized with zeroes, and so perhaps the sensors-detect adresses!=FF test is false. If you have any idea for helping me to know if i have really IPMI on it. Anyway, i hope that my works was usefull for you, i saw that some recent sun station have IPMI. Cordially. LABBE Corentin --- freeipmi-0.3.1/libfreeipmi/src/ipmi-inband.h 2006-09-13 23:23:56.000000000 +0200 +++ /freeipmi-0.3.1/libfreeipmi/src/ipmi-inband.h 2007-03-17 17:07:09.000000000 +0100 @@ -21,6 +21,8 @@ #ifndef _IPMI_INBAND_H #define _IPMI_INBAND_H 1 +int devport; + #ifdef __cplusplus extern "C" { #endif @@ -40,15 +42,22 @@ # include <sys/io.h> #elif defined(HAVE_ASM_IO_H) /* PPC */ +#ifndef __ARCH_IS_SPARC__ # include <asm/io.h> #endif +#endif #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # define _INB(port) inb (port) # define _OUTB(data, port) outb (port, data) #else +#ifdef __ARCH_IS_SPARC__ +# define _INB(port) printf ("read %d port=%d\n",devport,port) +# define _OUTB(data, port) printf ("write %d port=%d date=%d\n",devport, port,data) +#else /* !__ARCH_IS_SPARC__ */ # define _INB(port) inb (port) # define _OUTB(data, port) outb (data, port) +#endif /* !__ARCH_IS_SPARC__*/ #endif #ifdef __cplusplus --- freeipmi-0.3.1/libfreeipmi/src/ipmi-smic-api.c 2006-09-13 23:23:56.000000000 +0200 +++ /freeipmi-0.3.1/libfreeipmi/src/ipmi-smic-api.c 2007-03-17 16:57:21.000000000 +0100 @@ -146,7 +146,12 @@ return (ipmi_smic_dev_io_fd == -1 ? -1 : 0); #endif #else +#ifdef __ARCH_IS_SPARC__ +devport = open("/dev/port",O_RDONLY); +return devport; +#else /* !__ARCH_IS_SPARC__ */ return (iopl (3)); +#endif /* !__ARCH_IS_SPARC__ */ #endif } --- freeipmi-0.3.1/libfreeipmi/src/ipmi-kcs-api.c 2006-07-29 19:05:22.000000000 +0200 +++ /freeipmi-0.3.1/libfreeipmi/src/ipmi-kcs-api.c 2007-03-17 16:53:41.000000000 +0100 @@ -371,6 +371,10 @@ } #endif /* !USE_IOPERM */ #else /* !__FreeBSD__ */ +# ifdef __ARCH_IS_SPARC__ +devport = open("/dev/port",O_RDONLY); +return devport; +#else /*!__ARCH_IS_SPARC__*/ if (iopl (3) < 0) { if (errno == EPERM || errno == EACCES) @@ -379,6 +383,7 @@ ERR_LOG(ctx->errnum = IPMI_KCS_CTX_ERR_INTERNAL); return (-1); } +#endif /* !__ARCH_IS_SPARC__*/ #endif/* !__FreeBSD__ */ ctx->io_init = 1; _______________________________________________ Freeipmi-users mailing list Freeipmi-users@gnu.org http://lists.gnu.org/mailman/listinfo/freeipmi-users