diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-02-20 02:12:42 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-02-20 02:12:42 +0100 |
commit | a61a5992cefc2204a99f25b2395b108092098e2c (patch) | |
tree | 3b25da535866adf0458f6d172fd242fc933c77db /src/plugins/imb/imbapi.c | |
parent | 15edf42f095e3cc26e372547ebcaaae558d0cce2 (diff) | |
parent | 97d6a2e491c6ed08473beb2c4bac47c5cbc1201a (diff) |
Merge tag 'upstream/1.8.16'
Upstream version 1.8.16
Diffstat (limited to 'src/plugins/imb/imbapi.c')
-rw-r--r-- | src/plugins/imb/imbapi.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/imb/imbapi.c b/src/plugins/imb/imbapi.c index 37d3abe..899c47a 100644 --- a/src/plugins/imb/imbapi.c +++ b/src/plugins/imb/imbapi.c @@ -97,6 +97,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <string.h> #endif #include "imbapi.h" +#include <asm/socket.h> #ifdef SCO_UW #define NO_MACRO_ARGS 1 @@ -104,7 +105,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define IMB_DEVICE "/dev/instru/mismic" #else #define IMB_DEVICE "/dev/imb" -#define PAGESIZE EXEC_PAGESIZE +#ifndef PAGESIZE +# define PAGESIZE EXEC_PAGESIZE +#endif #endif /*Just to make the DEBUG code cleaner.*/ @@ -1981,7 +1984,7 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress ) unsigned int length = addressLength; off_t startpAddress = (off_t)startAddress; unsigned int diff; - caddr_t startvAddress; + char *startvAddress; if ((startAddress == 0) || (addressLength <= 0)) return ACCESN_ERROR; @@ -2000,13 +2003,13 @@ MapPhysicalMemory(int startAddress,int addressLength, int *virtualAddress ) startpAddress -= diff; length += diff; - if ( (startvAddress = mmap( (caddr_t)0, + if ( (startvAddress = mmap(0, length, PROT_READ, MAP_SHARED, fd, startpAddress - ) ) == (caddr_t)-1) + ) ) == MAP_FAILED) { char buf[128]; |