OK.
Tom, here's a simple test.
After this we will know for sure whether mmap works, or not.
I hard-coded the physical memory offset to
1ff00100000 (this seems to be what you have), you can find out the real offset
for the first resource from lspci -vv or from cat /proc/iomem.

You have to be root to run.




==================================
#define BAR0 0x1ff00100000ull
#define _XOPEN_SOURCE 500
#define _FILE_OFFSET_BITS 64
#include <sys/mman.h>
#include <fcntl.h>

#include <unistd.h>

#include <stdio.h>


int main()
{
        int fd;
        void *ptr;
        unsigned value;
        unsigned long long offset = BAR0;
        fd = open("/dev/mem",O_RDWR | O_SYNC);
        if (fd<0) {
                perror("open");
                return 1;
        }

        ptr = mmap(NULL, 0x100000, PROT_READ | PROT_WRITE,
                        MAP_SHARED, fd, offset);

        if ( (! ptr) || (ptr == MAP_FAILED) ) {
                perror("map");
                return 1;
        }

        value= *( (unsigned*)(ptr + 0x000f0014) );
        
        printf("value at 0x000f0014 is %#8.8x\n", value);

        return 0;
err:
        return 1;
}

_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to