[lkml]   [2006]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Document Linux's memory barriers
    On Tuesday 07 March 2006 18:40, David Howells wrote:

    > +Older and less complex CPUs will perform memory accesses in exactly the order
    > +specified, so if one is given the following piece of code:
    > +
    > + a = *A;
    > + *B = b;
    > + c = *C;
    > + d = *D;
    > + *E = e;
    > +
    > +It can be guaranteed that it will complete the memory access for each
    > +instruction before moving on to the next line, leading to a definite sequence
    > +of operations on the bus:

    Actually gcc is free to reorder it
    (often it will not when it cannot prove that they don't alias, but sometimes
    it can)

    > +
    > + Consider, for example, an ethernet chipset such as the AMD PCnet32. It
    > + presents to the CPU an "address register" and a bunch of "data registers".
    > + The way it's accessed is to write the index of the internal register you
    > + want to access to the address register, and then read or write the
    > + appropriate data register to access the chip's internal register:
    > +
    > + *ADR = ctl_reg_3;
    > + reg = *DATA;

    You're not supposed to do it this way anyways. The official way to access
    MMIO space is using read/write[bwlq]

    Haven't read all of it sorry, but thanks for the work of documenting


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-03-07 19:04    [W:0.374 / U:9.328 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site