On 21/04/2017 07:22, Patrick Gauvin wrote:

    I so not like the reset value being written to like this. I know you
    need to set the lower 4 bits to 1 when loading the fabric via PCAP
    but there are 4 independent resets and I have applications that have
    individual control once loaded. What about a mask be provided and
    only the bits we are interested in are set or cleared depending on
    the mask?

    Note adding mask support will require a lock to be SMP safe.


I see, masking sounds good. Since the lock will need to be initialized
before the SLCR functions are called, should I turn this into a full
driver like device config, or is it acceptable to call an SLCR init
function during BSP startup?

I suggest you take the simple approach first and create a static initialised lock:

static rtems_interrupt_lock slcr_lock = RTEMS_INTERRUPT_LOCK_INITIALIZER("zynq_slcr");

To use:

 void foo(void)
 {
   rtems_interrupt_lock_context lcontext;
   rtems_interrupt_lock_acquire(&slcr_lock, &lcontext);

   blah_blah = ho_hum;

   rtems_interrupt_lock_release(&slcr_lock, &lcontext);
}

Chris
_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to