MCPcopy Create free account
hub / github.com/bendudson/EuraliOS / allocate_consecutive_frames

Method allocate_consecutive_frames

kernel/src/memory/frame_allocator.rs:371–382  ·  view source on GitHub ↗

Allocate a set of consecutive frames

(
        &mut self,
        needed_frames: u64,
        max_address: u64
    )

Source from the content-addressed store, hash-verified

369
370 /// Allocate a set of consecutive frames
371 pub fn allocate_consecutive_frames(
372 &mut self,
373 needed_frames: u64,
374 max_address: u64
375 ) -> Option<PhysFrame> {
376 if let Some(frame_number) = self.consecutive_frames(needed_frames, max_address) {
377 // Convert from frame number to physical address
378 return PhysFrame::from_start_address(
379 self.frame_phys_addr + frame_number * 4096).ok();
380 }
381 None
382 }
383}
384
385unsafe impl FrameAllocator<Size4KiB> for MultilevelBitmapFrameAllocator {

Callers 1

create_consecutive_pagesFunction · 0.80

Calls 1

consecutive_framesMethod · 0.80

Tested by

no test coverage detected