@@ -101,26 +101,6 @@ pub mod builder;
101
101
/// that the Rust compiler output changes `eax` before you can access it.
102
102
pub const MAGIC : u32 = 0x36d76289 ;
103
103
104
- /// # Safety
105
- /// Deprecated. Please use BootInformation::load() instead.
106
- #[ deprecated = "Please use BootInformation::load() instead." ]
107
- pub unsafe fn load < ' a > ( address : usize ) -> Result < BootInformation < ' a > , MbiLoadError > {
108
- let ptr = address as * const BootInformationHeader ;
109
- BootInformation :: load ( ptr)
110
- }
111
-
112
- /// # Safety
113
- /// Deprecated. Please use BootInformation::load() instead.
114
- #[ deprecated = "Please use BootInformation::load() instead." ]
115
- pub unsafe fn load_with_offset < ' a > (
116
- address : usize ,
117
- offset : usize ,
118
- ) -> Result < BootInformation < ' a > , MbiLoadError > {
119
- let ptr = address as * const u8 ;
120
- let ptr = ptr. add ( offset) ;
121
- BootInformation :: load ( ptr. cast ( ) )
122
- }
123
-
124
104
/// Error type that describes errors while loading/parsing a multiboot2 information structure
125
105
/// from a given address.
126
106
#[ derive( Display , Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
@@ -262,7 +242,9 @@ impl<'a> BootInformation<'a> {
262
242
/// This is the same as doing:
263
243
///
264
244
/// ```rust,no_run
265
- /// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
245
+ /// # use multiboot2::{BootInformation, BootInformationHeader};
246
+ /// # let ptr = 0xdeadbeef as *const BootInformationHeader;
247
+ /// # let boot_info = unsafe { BootInformation::load(ptr).unwrap() };
266
248
/// let end_addr = boot_info.start_address() + boot_info.total_size();
267
249
/// ```
268
250
pub fn end_address ( & self ) -> usize {
@@ -285,7 +267,9 @@ impl<'a> BootInformation<'a> {
285
267
/// # Examples
286
268
///
287
269
/// ```rust,no_run
288
- /// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
270
+ /// # use multiboot2::{BootInformation, BootInformationHeader};
271
+ /// # let ptr = 0xdeadbeef as *const BootInformationHeader;
272
+ /// # let boot_info = unsafe { BootInformation::load(ptr).unwrap() };
289
273
/// if let Some(sections) = boot_info.elf_sections() {
290
274
/// let mut total = 0;
291
275
/// for section in sections {
@@ -414,7 +398,7 @@ impl<'a> BootInformation<'a> {
414
398
///
415
399
/// ```no_run
416
400
/// use std::str::Utf8Error;
417
- /// use multiboot2::{Tag, TagTrait, TagType, TagTypeId};
401
+ /// use multiboot2::{BootInformation, BootInformationHeader, Tag, TagTrait, TagType, TagTypeId};
418
402
///
419
403
/// #[repr(C)]
420
404
/// #[derive(multiboot2::Pointee)] // Only needed for DSTs.
@@ -442,8 +426,8 @@ impl<'a> BootInformation<'a> {
442
426
/// Tag::get_dst_str_slice(&self.name)
443
427
/// }
444
428
/// }
445
- ///
446
- /// let mbi = unsafe { multiboot2 ::load(0xdeadbeef ).unwrap() };
429
+ /// let mbi_ptr = 0xdeadbeef as *const BootInformationHeader;
430
+ /// let mbi = unsafe { BootInformation ::load(mbi_ptr ).unwrap() };
447
431
///
448
432
/// let tag = mbi
449
433
/// .get_tag::<CustomTag>()
@@ -1258,15 +1242,6 @@ mod tests {
1258
1242
let bi = bi. unwrap ( ) ;
1259
1243
test_grub2_boot_info ( & bi, addr, string_addr, & bytes. 0 , & string_bytes. 0 ) ;
1260
1244
1261
- let bi = unsafe { load_with_offset ( addr, 0 ) } ;
1262
- let bi = bi. unwrap ( ) ;
1263
- test_grub2_boot_info ( & bi, addr, string_addr, & bytes. 0 , & string_bytes. 0 ) ;
1264
-
1265
- let offset = 8usize ;
1266
- let bi = unsafe { load_with_offset ( addr - offset, offset) } ;
1267
- let bi = bi. unwrap ( ) ;
1268
- test_grub2_boot_info ( & bi, addr, string_addr, & bytes. 0 , & string_bytes. 0 ) ;
1269
-
1270
1245
// Check that the MBI's debug output can be printed without SEGFAULT.
1271
1246
// If this works, it is a good indicator than transitively a lot of
1272
1247
// stuff works.
0 commit comments