@@ -51,7 +51,7 @@ with addresses as follows:
51
51
` usize ` are used to store the raw value. Pointers such as ` *u8 ` , can not be
52
52
used as an implementation of ` AddressValue ` because the ` Add ` and ` Sub `
53
53
traits are not implemented for that type.
54
- - ` Address ` : implementation of `AddressValue.
54
+ - ` Address ` : implementation of ` AddressValue ` .
55
55
- ` Bytes ` : trait for volatile access to memory. The ` Bytes ` trait can be
56
56
parameterized with types that represent addresses, in order to enforce that
57
57
addresses are used with the right "kind" of volatile memory.
@@ -78,7 +78,7 @@ of the VM using the following traits:
78
78
main responsibilities of the ` GuestMemory ` trait are:
79
79
- hide the detail of accessing physical addresses (for example complex
80
80
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
82
82
request to it.
83
83
- handle cases where an access request is spanning two or more
84
84
` GuestMemoryRegion ` objects.
@@ -88,7 +88,7 @@ access VM's physical memory and not on the implementation of the traits.
88
88
89
89
### Backend Implementation Based on ` mmap `
90
90
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
92
92
memory into the current process.
93
93
94
94
- ` MmapRegion ` : implementation of mmap a continuous range of physical memory
@@ -109,7 +109,7 @@ simplicity and code complexity:
109
109
``` rust
110
110
let guest_memory_mmap : GuestMemoryMmap = ...
111
111
let addr : GuestAddress = ...
112
- let buf = & mut [0u8 ; 5 ];
112
+ let buf = & mut [0u8 ; 5 ];
113
113
let result = guest_memory_mmap . find_region (addr ). unwrap (). write (buf , addr );
114
114
```
115
115
@@ -118,7 +118,7 @@ let result = guest_memory_mmap.find_region(addr).unwrap().write(buf, addr);
118
118
``` rust
119
119
let guest_memory_mmap : GuestMemoryMmap = ...
120
120
let addr : GuestAddress = ...
121
- let buf = & mut [0u8 ; 5 ];
121
+ let buf = & mut [0u8 ; 5 ];
122
122
let result = guest_memory_mmap . write (buf , addr );
123
123
```
124
124
@@ -142,7 +142,7 @@ with minor changes:
142
142
143
143
- ` Address ` inherits ` AddressValue `
144
144
- ` GuestMemoryRegion ` inherits ` Bytes<MemoryRegionAddress, E = Error> ` . The
145
- ` Bytes ` must be implemented.
145
+ ` Bytes ` trait must be implemented.
146
146
- ` GuestMemory ` has a generic implementation of ` Bytes<GuestAddress> ` .
147
147
148
148
** Types** :
0 commit comments