On 09/19/2011 03:32 PM, Jan Kiszka wrote:
>  It's opt-in.  If a device sets
>  MemoryRegionOps::impl.{min,max}_access_size = 1, it will only be fed
>  byte accesses (the core will take care of breaking apart larger
>  writes).  If it sets MemoryRegionOps::impl.{min,max}_access_size = 4, it
>  will only get long accesses (and the core will/should shift/mask or
>  RMW).  Refusing illegal access sizes is done using
>  MemoryRegionOps::valid.  Most of this is unimplemented unfortunately.

That makes sense (for non-old_portio users).



The trick of having a way to register N callbacks with one shot is worth growing. Ideally each register in a BAR would have a callback and we'd do something like

    MemoryRegionOps mydev_ops = {
        .registers = {
             { MYDEV_REG_x, 4, 4, mydev_reg_x_read, mydev_reg_x_write, },
             ...
         },
    }

with hints to the core like "this register sits at this offset, use it for reads instead of a callback", or, "this is a read-only register".

--
error compiling committee.c: too many arguments to function


Reply via email to