diff options
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]; |