File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727- Added ` LoadedImageDevicePath ` protocol.
2828- Added ` FileAttribute::is_directory(&self) ` and
2929 ` FileAttribute::is_regular_file(&self) `
30+ - Added ` LoadedImage::code_type() ` and ` LoadedImage::data_type() `
3031
3132### Changed
3233
Original file line number Diff line number Diff line change @@ -170,4 +170,26 @@ impl LoadedImage {
170170 pub const fn info ( & self ) -> ( * const c_void , u64 ) {
171171 ( self . image_base , self . image_size )
172172 }
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+ }
173195}
You can’t perform that action at this time.
0 commit comments