File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 27
27
- Added ` LoadedImageDevicePath ` protocol.
28
28
- Added ` FileAttribute::is_directory(&self) ` and
29
29
` FileAttribute::is_regular_file(&self) `
30
+ - Added ` LoadedImage::code_type() ` and ` LoadedImage::data_type() `
30
31
31
32
### Changed
32
33
Original file line number Diff line number Diff line change @@ -170,4 +170,26 @@ impl LoadedImage {
170
170
pub const fn info ( & self ) -> ( * const c_void , u64 ) {
171
171
( self . image_base , self . image_size )
172
172
}
173
+
174
+ /// Get the memory type of the image's code sections.
175
+ ///
176
+ /// Normally the returned value is one of:
177
+ /// - `MemoryType::LOADER_CODE` for UEFI applications
178
+ /// - `MemoryType::BOOT_SERVICES_CODE` for UEFI boot drivers
179
+ /// - `MemoryType::RUNTIME_SERVICES_CODE` for UEFI runtime drivers
180
+ #[ must_use]
181
+ pub fn code_type ( & self ) -> MemoryType {
182
+ self . image_code_type
183
+ }
184
+
185
+ /// Get the memory type of the image's data sections.
186
+ ///
187
+ /// Normally the returned value is one of:
188
+ /// - `MemoryType::LOADER_DATA` for UEFI applications
189
+ /// - `MemoryType::BOOT_SERVICES_DATA` for UEFI boot drivers
190
+ /// - `MemoryType::RUNTIME_SERVICES_DATA` for UEFI runtime drivers
191
+ #[ must_use]
192
+ pub fn data_type ( & self ) -> MemoryType {
193
+ self . image_data_type
194
+ }
173
195
}
You can’t perform that action at this time.
0 commit comments