<div dir="ltr">Thank you, that does simplify things quite a bit.<div><br></div><div>-Patrick</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 20, 2017 at 5:50 PM, Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 21/04/2017 07:22, Patrick Gauvin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I so not like the reset value being written to like this. I know you<br>
need to set the lower 4 bits to 1 when loading the fabric via PCAP<br>
but there are 4 independent resets and I have applications that have<br>
individual control once loaded. What about a mask be provided and<br>
only the bits we are interested in are set or cleared depending on<br>
the mask?<br>
<br>
Note adding mask support will require a lock to be SMP safe.<br>
<br>
<br>
I see, masking sounds good. Since the lock will need to be initialized<br>
before the SLCR functions are called, should I turn this into a full<br>
driver like device config, or is it acceptable to call an SLCR init<br>
function during BSP startup?<br>
</blockquote>
<br></span>
I suggest you take the simple approach first and create a static initialised lock:<br>
<br>
static rtems_interrupt_lock slcr_lock = RTEMS_INTERRUPT_LOCK_INITIALIZ<wbr>ER("zynq_slcr");<br>
<br>
To use:<br>
<br>
void foo(void)<br>
{<br>
rtems_interrupt_lock_context lcontext;<br>
rtems_interrupt_lock_acquire(<wbr>&slcr_lock, &lcontext);<br>
<br>
blah_blah = ho_hum;<br>
<br>
rtems_interrupt_lock_release(<wbr>&slcr_lock, &lcontext);<br>
}<span class="HOEnZb"><font color="#888888"><br>
<br>
Chris<br>
</font></span></blockquote></div><br></div>