Skip to content

Commit 4237db3

Browse files
Serban Iorgaalxiord
authored andcommitted
[DESIGN.rs] documentation improvements and fixes
Signed-off-by: Serban Iorga <seriorga@amazon.com>
1 parent bf5b29e commit 4237db3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

DESIGN.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ with addresses as follows:
5151
`usize` are used to store the raw value. Pointers such as `*u8`, can not be
5252
used as an implementation of `AddressValue` because the `Add` and `Sub`
5353
traits are not implemented for that type.
54-
- `Address`: implementation of `AddressValue.
54+
- `Address`: implementation of `AddressValue`.
5555
- `Bytes`: trait for volatile access to memory. The `Bytes` trait can be
5656
parameterized with types that represent addresses, in order to enforce that
5757
addresses are used with the right "kind" of volatile memory.
@@ -78,7 +78,7 @@ of the VM using the following traits:
7878
main responsibilities of the `GuestMemory` trait are:
7979
- hide the detail of accessing physical addresses (for example complex
8080
hierarchical structures).
81-
- map a address request to a `GuestMemoryRegion` object and relay the
81+
- map an address request to a `GuestMemoryRegion` object and relay the
8282
request to it.
8383
- handle cases where an access request is spanning two or more
8484
`GuestMemoryRegion` objects.
@@ -88,7 +88,7 @@ access VM's physical memory and not on the implementation of the traits.
8888

8989
### Backend Implementation Based on `mmap`
9090

91-
Provides an implementation of the `GuestMemory` trait by mmapping VM's physical
91+
Provides an implementation of the `GuestMemory` trait by mmapping the VM's physical
9292
memory into the current process.
9393

9494
- `MmapRegion`: implementation of mmap a continuous range of physical memory
@@ -109,7 +109,7 @@ simplicity and code complexity:
109109
```rust
110110
let guest_memory_mmap: GuestMemoryMmap = ...
111111
let addr: GuestAddress = ...
112-
let buf = &mut [0u8; 5];
112+
let buf = &mut [0u8; 5];
113113
let result = guest_memory_mmap.find_region(addr).unwrap().write(buf, addr);
114114
```
115115

@@ -118,7 +118,7 @@ let result = guest_memory_mmap.find_region(addr).unwrap().write(buf, addr);
118118
```rust
119119
let guest_memory_mmap: GuestMemoryMmap = ...
120120
let addr: GuestAddress = ...
121-
let buf = &mut [0u8; 5];
121+
let buf = &mut [0u8; 5];
122122
let result = guest_memory_mmap.write(buf, addr);
123123
```
124124

@@ -142,7 +142,7 @@ with minor changes:
142142

143143
- `Address` inherits `AddressValue`
144144
- `GuestMemoryRegion` inherits `Bytes<MemoryRegionAddress, E = Error>`. The
145-
`Bytes` must be implemented.
145+
`Bytes` trait must be implemented.
146146
- `GuestMemory` has a generic implementation of `Bytes<GuestAddress>`.
147147

148148
**Types**:

0 commit comments

Comments
 (0)