Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. void pmm_init(tboot_info_t* info) {
  2. /*
  3. * NOTE: we assume the bootloader set the range of the kernel
  4. * stuff as reserved
  5. */
  6.  
  7. TRACE("Preparing pmm");
  8.  
  9. // go over the entries
  10. for(int i = 0; i < info->mmap.count; i++) {
  11. tboot_mmap_entry_t* entry = &info->mmap.entries[i];
  12. TRACE("\t%lx-%lx: (%lx) %s", entry->addr, entry->addr + entry->len, entry->len, tboot_mmap_names[entry->type]);
  13.  
  14. // add useable entries
  15. if(entry->type == TBOOT_MEMORY_TYPE_USABLE) {
  16. // set the memory top
  17. if(mem_memory_top < entry->addr + entry->len) {
  18. mem_memory_top = entry->addr + entry->len;
  19. }
  20.  
  21. // add the range of addresses
  22. add_range(false, entry->addr, entry->addr + entry->len);
  23. move_temp_entries();
  24. }
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement