Commit 64bcad5
Bytes: Do not use to_region_addr()
When we switch to a (potentially) virtual memory model, we want to
compact the interface, especially removing references to memory regions
because virtual memory is not just split into regions, but pages first.
`to_region_addr()` will no longer work then, as it does not communicate
to the caller for how many bytes that mapping is valid. (Currently, it
is generally valid until the end of the region, but this will not be the
case with virtual memory.)
So instead, get a `VolatileSlice` via `get_slices()` and do the atomic
access on it.
(Note: We cannot really have a test case for this, as right now, memory
fragmentation will only happen exactly at memory region boundaries. In
this case, `region.load()` and `region.store()` would have already
returned errors. This change is necessary for when page boundaries
result in different mappings within a single region, but because we
don’t have IOMMU support yet, this can’t be tested.)
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>1 parent 1d3c09b commit 64bcad5
2 files changed
+16
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
685 | 686 | | |
686 | 687 | | |
687 | 688 | | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | | - | |
692 | | - | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
693 | 696 | | |
694 | 697 | | |
695 | 698 | | |
696 | | - | |
697 | | - | |
698 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
699 | 706 | | |
700 | 707 | | |
701 | 708 | | |
| |||
0 commit comments