summaryrefslogtreecommitdiff
path: root/src/plugins/imb
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 22:59:06 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-08 22:59:06 +0200
commita7c8ed90be739a49937a229828c470f1ad01396e (patch)
tree4cd43ff357d98a1ce5afb3bb9449afcce5a299d1 /src/plugins/imb
parentfa5ac2da06fae952fe1295a1e955bdb35e6d86c4 (diff)
parent342ebce798fe98ede64939a49bbc3770d8214649 (diff)
Merge tag 'upstream/1.8.17'
Upstream version 1.8.17
Diffstat (limited to 'src/plugins/imb')
-rw-r--r--src/plugins/imb/Makefile.am2
-rw-r--r--src/plugins/imb/Makefile.in2
-rw-r--r--src/plugins/imb/imb.c1
-rw-r--r--src/plugins/imb/imbapi.c41
-rw-r--r--src/plugins/imb/imbapi.h5
5 files changed, 37 insertions, 14 deletions
diff --git a/src/plugins/imb/Makefile.am b/src/plugins/imb/Makefile.am
index 91d5966..6f1b68c 100644
--- a/src/plugins/imb/Makefile.am
+++ b/src/plugins/imb/Makefile.am
@@ -30,7 +30,7 @@
MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
EXTRA_LTLIBRARIES = libintf_imb.la
noinst_LTLIBRARIES = @INTF_IMB_LIB@
diff --git a/src/plugins/imb/Makefile.in b/src/plugins/imb/Makefile.in
index d1ded78..1e40e15 100644
--- a/src/plugins/imb/Makefile.in
+++ b/src/plugins/imb/Makefile.in
@@ -338,7 +338,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
MAINTAINERCLEANFILES = Makefile.in
-INCLUDES = -I$(top_srcdir)/include
+AM_CPPFLAGS = -I$(top_srcdir)/include
EXTRA_LTLIBRARIES = libintf_imb.la
noinst_LTLIBRARIES = @INTF_IMB_LIB@
libintf_imb_la_LIBADD = $(top_builddir)/lib/libipmitool.la
diff --git a/src/plugins/imb/imb.c b/src/plugins/imb/imb.c
index 0044159..1514fa7 100644
--- a/src/plugins/imb/imb.c
+++ b/src/plugins/imb/imb.c
@@ -43,6 +43,7 @@
#include <ipmitool/ipmi.h>
#include <ipmitool/ipmi_intf.h>
#include <ipmitool/helper.h>
+#include <ipmitool/ipmi_sel.h>
#include "imbapi.h"
diff --git a/src/plugins/imb/imbapi.c b/src/plugins/imb/imbapi.c
index 899c47a..84eec2e 100644
--- a/src/plugins/imb/imbapi.c
+++ b/src/plugins/imb/imbapi.c
@@ -97,7 +97,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <string.h>
#endif
#include "imbapi.h"
-#include <asm/socket.h>
+#include <sys/socket.h>
#ifdef SCO_UW
#define NO_MACRO_ARGS 1
@@ -105,9 +105,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define IMB_DEVICE "/dev/instru/mismic"
#else
#define IMB_DEVICE "/dev/imb"
-#ifndef PAGESIZE
-# define PAGESIZE EXEC_PAGESIZE
#endif
+
+#if !defined(PAGESIZE) && defined(PAGE_SIZE)
+# define PAGESIZE PAGE_SIZE
+#endif
+
+#if !defined(_SC_PAGESIZE) && defined(_SC_PAGE_SIZE)
+# define _SC_PAGESIZE _SC_PAGE_SIZE
#endif
/*Just to make the DEBUG code cleaner.*/
@@ -545,7 +550,7 @@ SendTimedI2cRequest (
if( status != TRUE ) {
DWORD error;
error = GetLastError();
- return ACCESN_ERROR;
+ return error;
}
if( respLength == 0 ) {
return ACCESN_ERROR;
@@ -1134,7 +1139,7 @@ SendTimedImbpRequest (
if( status != TRUE ) {
DWORD error;
error = GetLastError();
- return ACCESN_ERROR;
+ return error;
}
if( respLength == 0 ) {
return ACCESN_ERROR;
@@ -1211,7 +1216,7 @@ SendAsyncImbpRequest (
if( status != TRUE ) {
DWORD error;
error = GetLastError();
- return ACCESN_ERROR;
+ return error;
}
if( respLength != 2 ) {
return ACCESN_ERROR;
@@ -1985,6 +1990,16 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
off_t startpAddress = (off_t)startAddress;
unsigned int diff;
char *startvAddress;
+#if defined(PAGESIZE)
+ long int pagesize = PAGESIZE;
+#elif defined(_SC_PAGESIZE)
+ long int pagesize = sysconf(_SC_PAGESIZE);
+ if (pagesize < 1) {
+ perror("Invalid pagesize");
+ }
+#else
+# error PAGESIZE unsupported
+#endif
if ((startAddress == 0) || (addressLength <= 0))
return ACCESN_ERROR;
@@ -1999,7 +2014,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress )
}
/* aliging the offset to a page boundary and adjusting the length */
- diff = (int)startpAddress % PAGESIZE;
+ diff = (int)startpAddress % pagesize;
startpAddress -= diff;
length += diff;
@@ -2043,9 +2058,19 @@ ACCESN_STATUS
UnmapPhysicalMemory( int virtualAddress, int Length )
{
unsigned int diff = 0;
+#if defined(PAGESIZE)
+ long int pagesize = PAGESIZE;
+#elif defined(_SC_PAGESIZE)
+ long int pagesize = sysconf(_SC_PAGESIZE);
+ if (pagesize < 1) {
+ perror("Invalid pagesize");
+ }
+#else
+# error PAGESIZE unsupported
+#endif
/* page align the virtual address and adjust length accordingly */
- diff = ((unsigned int) virtualAddress) % PAGESIZE;
+ diff = ((unsigned int) virtualAddress) % pagesize;
virtualAddress -= diff;
Length += diff;
#ifndef NO_MACRO_ARGS
diff --git a/src/plugins/imb/imbapi.h b/src/plugins/imb/imbapi.h
index 74975c6..6ba4121 100644
--- a/src/plugins/imb/imbapi.h
+++ b/src/plugins/imb/imbapi.h
@@ -46,10 +46,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endif
#ifndef WIN32
/* WIN32 defines this in stdio.h */
-#ifndef _WCHAR_T
-#define _WCHAR_T
-typedef long wchar_t;
-#endif
+#include <wchar.h>
#endif
#define far
#define near