Changeset 328f2934 in mainline for arch/ia32/src/mm


Ignore:
Timestamp:
2005-12-04T19:37:13Z (20 years ago)
Author:
Sergey Bondari <bondari@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf585c9
Parents:
d7ac642
Message:

Buddy allocator for physical memory complete implementation.
Tested on IA32, AMD64, MIPS32. RWLock Test #5 is not passed.
NOTE: Other architectures could be broken (but should not be)

Location:
arch/ia32/src/mm
Files:
2 edited

Legend:

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

    rd7ac642 r328f2934  
    3434#include <arch/boot/memmap.h>
    3535#include <panic.h>
     36#include <debug.h>
    3637
    3738size_t hardcoded_unmapped_ktext_size = 0;
     
    4142{
    4243        zone_t *z;
     44        __address start, stop;
     45        size_t size;
    4346        __u8 i;
    4447       
    4548        if (config.cpu_active == 1) {
     49
     50                /* Reserve frame 0 (BIOS data) */
     51                frame_region_not_free(0, FRAME_SIZE);
     52               
     53                /* Reserve real mode bootstrap memory */
     54                frame_region_not_free(BOOTSTRAP_OFFSET, hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size);
     55               
    4656                for (i=0;i<e820counter;i++) {
    4757                        if (e820table[i].type==MEMMAP_MEMORY_AVAILABLE) {
    48                                 z = zone_create(e820table[i].base_address, e820table[i].size & ~(FRAME_SIZE-1), 0);
    49                                 if (!z) {
    50                                         panic("Cannot allocate zone (%dB).\n", e820table[i].size & ~(FRAME_SIZE-1));
    51                                 }
    52                                 zone_attach(z);
     58                                zone_create_in_region(e820table[i].base_address,  e820table[i].size & ~(FRAME_SIZE-1));
    5359                        }
    5460                }
    55                
    56                 frame_not_free(0);
    57 
    58                 /* Reserve real mode bootstrap memory */
    59                 frame_region_not_free(BOOTSTRAP_OFFSET, BOOTSTRAP_OFFSET + hardcoded_unmapped_ktext_size + hardcoded_unmapped_kdata_size);
    6061        }
    6162}
  • arch/ia32/src/mm/page.c

    rd7ac642 r328f2934  
    4848
    4949        if (config.cpu_active == 1) {
    50                 dba = frame_alloc(FRAME_KA | FRAME_PANIC);
     50                dba = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
    5151                memsetb(dba, PAGE_SIZE, 0);
    5252
     
    7070                 */
    7171
    72                 dba = frame_alloc(FRAME_KA | FRAME_PANIC);
     72                dba = frame_alloc(FRAME_KA | FRAME_PANIC, 0);
    7373                memcpy((void *)dba, (void *)bootstrap_dba , PAGE_SIZE);
    7474                write_cr3(KA2PA(dba));
Note: See TracChangeset for help on using the changeset viewer.