On Sat, Mar 2, 2019 at 12:10 PM Rob Landley <[email protected]> wrote: > > On 3/2/19 1:02 PM, enh via Toybox wrote: > > Intended to replace Android's toolbox `r`, but behaving more like a > > drop-in replacement for busybox's `devmem`. > > Applied, but not yet prompted, because question: > > Have you seen the peek() and poke() functions in lib that basically do this > except they can handle unaligned access (on platforms that care) and can even > do > endianness conversions? Should let you skip a couple of if/else staircases. It > would also let you just atolx_range(1,8) the size input since peek and poke do > read-and-shift of bytes so a peek of size 7 isn't going to bother it. :)
given that the use case for this is hardware registers, silently turning a single read or write into multiple reads or read/modify/write seemed like a bad idea. non-power of two accesses seem more likely to be a typo than a genuinely useful feature. (i did consider adding a `-f FILE` so we could actually write some tests, but my assumption is that we'll never touch this again. the ancestors have been basically unchanged for decades.) _______________________________________________ Toybox mailing list [email protected] http://lists.landley.net/listinfo.cgi/toybox-landley.net
