lkml.org 
[lkml]   [2002]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: PCI #LOCK assertion
    On Fri, 25 Jan 2002, chus Medina wrote:

    >
    > Hola,
    >
    > I need to create module to perform atomic transactions through the PCI bus
    > between the processor and an IDE hard disk. The PCI bus specifications 2.2
    > point to the #LOCK signal to perform such a transaction. Is possible to
    > assert the #LOCK signal of the PCI bus using the Linux Kernel? How? I didnt
    > see any pointers in include/pci.h or anywhere in the source code.
    >
    > I will truly appreciate any help/pointers,
    >
    > Jesus
    >

    On Intel machines, you precede a memory access with the 'lock'
    instruction. With CPUs i486, and later, only the accessed page
    is locked at that instant. Earlier CPUs locked the whole bus.

    The PCI/Bus controller handles the #LOCK signal itself to guarantee
    the atomicity of a transaction. You should never have to do this
    yourself. If you think you have to, just precede each PCI/Bus
    address-space access with the 'lock' instruction. You just make
    your own version of the readl/readw/readb/etc macros that are
    provided. You may find that this deadlocks, though, and all bets
    are off. You may have just locked the PCI/Bus off the bus when
    you needed it most!!

    If you are finding something 'strange' in your PCI/Bus accesses,
    it is probably because you didn't use 'nocache' when you obtained
    address-space for your PCI Device, i.e., ioremap_nocache() instead of
    ioremap().


    Cheers,
    Dick Johnson

    Penguin : Linux version 2.4.1 on an i686 machine (797.90 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

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