Maybe, but it is cleaner and works later on down the road when we add EL2 registers that use the same write functions.
I'm fine either way if you feel strongly about it. On 5 November 2014 09:15, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 5 November 2014 15:09, Greg Bellows <greg.bell...@linaro.org> wrote: > > Ah... I was confused and thinking of ttbcr_raw_write. Yes, raw_write > does > > not actually touch the masks. > > > > The reason we used raw_write is that it updates the correct ri offset. > We > > could be calling with the secure or non-secure ri so it was necessary to > > make sure the correct offset gets updated. > > ...but this doesn't help if you need to also update the mask etc. > > > Staying with this pattern, I introduced a new utility function raw_ptr() > > that gives back the pointer calculation based on the ri fieldoffset. For > > TCR, this will be the base of the TCR struct which we can then update. > > Seems like overkill for one register, compared to just doing > if (ri->secure == ...) > > thanks > -- PMM >