diff options
| author | Gary Guo <gary@garyguo.net> | 2026-07-06 13:44:33 +0100 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-07-11 18:09:04 +0200 |
| commit | 11a4784f902ebf3e674dbaf07dbec9a37aabb5e4 (patch) | |
| tree | cb80d3d4a2dc330adab6bb432bb097aa12ebe651 /tools/perf/scripts/python/bin/stackcollapse-report | |
| parent | e7219e53c525db87b43f4a9064d0e6331d7dc710 (diff) | |
rust: io: implement `IoSysMap`
Add an enum as sum type for `Mmio` and `SysMem`. This serves similar
purpose of `iosys_map`. Thanks to Rust's type system, all of projection and
struct read/write can be handled by the generic I/O projection mechanism
(i.e. `io_project!`, `io_read!, `io_write!`) for free, and there is no need
to provide things like `iosys_map_rd_field` or `iosys_map_wr_field`. An
enum type also makes it very easy to construct or destruct.
This could be made more generic by implementing on a general purpose sum
type like `Either`; however this is kept specific unless a need arises that
warrants this to be generic over other I/O backends.
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260706-io_projection-v6-20-72cd5d055d54@garyguo.net
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-report')
0 files changed, 0 insertions, 0 deletions
