Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 142084b2 in mainline


Ignore:
Timestamp:
2010-07-27T16:37:33Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial
Children:
9ded977
Parents:
af96dd5
Message:

safer way how to register memory zones, do not ignore zones with unknown flag, but register them simply as reserved
register ACPI NVS zones as firmware zones

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/mm/frame.c

    raf96dd5 r142084b2  
    131131                        if (last_frame < ALIGN_UP(new_base + new_size, FRAME_SIZE))
    132132                                last_frame = ALIGN_UP(new_base + new_size, FRAME_SIZE);
    133                 }
    134                
    135                 if (e820table[i].type == MEMMAP_MEMORY_RESERVED) {
     133                } else if ((e820table[i].type == MEMMAP_MEMORY_ACPI) ||
     134                    (e820table[i].type == MEMMAP_MEMORY_NVS)) {
     135                        /* To be safe, make the firmware zone possibly larger */
     136                        uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE);
     137                        uint64_t new_size = ALIGN_UP(size + (base - new_base),
     138                            FRAME_SIZE);
     139                       
     140                        zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0,
     141                            ZONE_FIRMWARE);
     142                } else {
    136143                        /* To be safe, make the reserved zone possibly larger */
    137144                        uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE);
     
    141148                        zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0,
    142149                            ZONE_RESERVED);
    143                 }
    144                
    145                 if (e820table[i].type == MEMMAP_MEMORY_ACPI) {
    146                         /* To be safe, make the firmware zone possibly larger */
    147                         uint64_t new_base = ALIGN_DOWN(base, FRAME_SIZE);
    148                         uint64_t new_size = ALIGN_UP(size + (base - new_base),
    149                             FRAME_SIZE);
    150                        
    151                         zone_create(ADDR2PFN(new_base), SIZE2FRAMES(new_size), 0,
    152                             ZONE_FIRMWARE);
    153150                }
    154151        }
     
    203200#ifdef CONFIG_SMP
    204201                /* Reserve AP real mode bootstrap memory */
    205                 frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, 
     202                frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH,
    206203                    (hardcoded_unmapped_ktext_size +
    207204                    hardcoded_unmapped_kdata_size) >> FRAME_WIDTH);
Note: See TracChangeset for help on using the changeset viewer.