[Toybox] [PATCH] devmem: add -f FILE, arbitrary amounts of data.

enh enh at google.com
Thu Jul 25 11:17:51 PDT 2024


-f lets people use /dev/port for x86 i/o ports (rather than needing a
separate x86-only command), or /dev/nvram, or /dev/cpu/*/msr, or
/sys/bus/pci/devices/*:*:*.* ... you get the idea.

It also means we can write some tests. (Though of course, the tests
don't tell us whether this actually works with, /dev/foo, or whether
you actually need to lseek()+write() rather than mmap().)

Also support arbitrary numbers of writes (with address auto-increment).
---
 tests/devmem.test   | 22 ++++++++++++++++++++++
 toys/other/devmem.c | 33 ++++++++++++++++++++-------------
 2 files changed, 42 insertions(+), 13 deletions(-)
 create mode 100755 tests/devmem.test
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-devmem-add-f-FILE-arbitrary-amounts-of-data.patch
Type: text/x-patch
Size: 5562 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20240725/5f9b8d94/attachment.bin>


More information about the Toybox mailing list