Problem mapping PCI memory space to user space - Solaris

This is a discussion on Problem mapping PCI memory space to user space - Solaris ; Hi, I want to map a local address space of my PCI device to user space. The local adress space is mapped in PCI memory space and its size is 1024 bytes. I have created a devmap entry point in ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Problem mapping PCI memory space to user space

  1. Problem mapping PCI memory space to user space

    Hi,

    I want to map a local address space of my PCI device to user space. The
    local adress space is mapped in PCI memory space and its size is 1024
    bytes. I have created a devmap entry point in my driver according to
    the "Writing Device Drivers" document. The drivers works on a Sparc
    platform but when I use it on a x86 platform mmap fails. The global
    error returns ENXIO. The devmap_devmem_setup() function in my driver
    returns -1. When I change the size of the local address space to 4096
    bytes equal to page size, it works. Anyway this is no solution for me,
    I want to be able to map local address spaces smaller as the space
    size. By the way I round up the len parameter to a multiple of the page
    size, so thats not the problem.

    What could be the problem? What is the difference with the Sparc
    platform? Is it not possible to map a local address space smaller as
    the page size?

    Someone who can help me?


  2. Re: Problem mapping PCI memory space to user space

    jeffrey.grunsven@wxs.nl wrote:
    > Hi,
    >
    > I want to map a local address space of my PCI device to user space. The
    > local adress space is mapped in PCI memory space and its size is 1024
    > bytes. I have created a devmap entry point in my driver according to
    > the "Writing Device Drivers" document. The drivers works on a Sparc
    > platform but when I use it on a x86 platform mmap fails. The global
    > error returns ENXIO. The devmap_devmem_setup() function in my driver
    > returns -1. When I change the size of the local address space to 4096
    > bytes equal to page size, it works. Anyway this is no solution for me,
    > I want to be able to map local address spaces smaller as the space
    > size. By the way I round up the len parameter to a multiple of the page
    > size, so thats not the problem.
    >
    > What could be the problem? What is the difference with the Sparc
    > platform? Is it not possible to map a local address space smaller as
    > the page size?
    >
    > Someone who can help me?
    >


    I've had identical problems with every bit of hardware I've tried to
    map that's "small". When I wrote a driver for a card that wanted to
    map a 1MB space suddenly everything worked great. I asked about
    this issue on Sun's device driver forum and the answer was basically
    "nobody needs to map small address spaces, so a minimum size is
    imposed." I just left it at that (no well-deserved flaming this
    time...) and still use pread()/pwrite() for devices with "small" maps.

    Sun screwed us on this one, indeed.


    Dave

+ Reply to Thread