lkml.org 
[lkml]   [1996]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: pre 2.1: Neat Oops with ncrBsd


    On Tue, 24 Sep 1996, Gerard Roudier wrote:
    >
    > The 1rst memory mapped IO done by the driver is at offset 4 of the IO
    > window of the chip. The code uses "readb()" with the vremmaped virtual
    > address + 4. Is that ok?
    > Probably not ...

    Nope. readb() and vremap() don't mix.

    Hmm, that's actually hard to handle. In general "vremap()" is only necessary
    on x86 (where we share the processor memory and PCI IO space). On a alpha
    (or PPC, or..) you can use "readb()" without any remapping at all, while on a
    PC you'd do the vremap() and then directly access the remapped area.

    > Something has added 0xc0000000 to the offset.

    That's the readb().

    Hmm, I think I have an idea.

    The readb() (and other macros) right now use __va() to change the address
    into a virtual one. But on the x86 we'd actually be better off with a new
    "__io()" macro, which instead of adding PAGE_OFFSET would do a logical OR
    operation.

    Could you test this change:

    - in include/asm-i386/io.h, add a macro like this:

    #define __io(x) ((void *)(PAGE_ADDRESS | (unsigned long)(x)))

    - in the same file, change all uses of "__va" to "__io".

    That should make things work, and we can easily make it work on the alpha too
    (by making "vremap()" a NULL operation on the alpha, as we don't need any
    remapping, and we can just return the original address)

    Linus

    \
     
     \ /
      Last update: 2005-03-22 13:37    [W:5.566 / U:0.172 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site