[Toybox] [PATCH] devmem: new command.

enh enh at google.com
Sat Mar 2 15:05:24 PST 2019


On Sat, Mar 2, 2019 at 12:10 PM Rob Landley <rob at landley.net> 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.)



More information about the Toybox mailing list