Changeset 95498e5 in mainline for arch/ia32/src


Ignore:
Timestamp:
2005-12-05T23:18:18Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59b6a70
Parents:
eef75f6
Message:

Map all available frames of memory on ia32 and amd64 (ticket #10).

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

Legend:

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

    reef75f6 r95498e5  
    3535#include <panic.h>
    3636#include <debug.h>
     37#include <align.h>
    3738
    3839size_t hardcoded_unmapped_ktext_size = 0;
    3940size_t hardcoded_unmapped_kdata_size = 0;
     41
     42__address last_frame = 0;
    4043
    4144void frame_arch_init(void)
     
    5457                for (i = 0; i < e820counter; i++) {
    5558                        if (e820table[i].type == MEMMAP_MEMORY_AVAILABLE) {
    56                                 zone_create_in_region(e820table[i].base_address,  e820table[i].size & ~(FRAME_SIZE-1));
    57                         }
     59                                zone_create_in_region(e820table[i].base_address, e820table[i].size & ~(FRAME_SIZE-1));
     60                                if (last_frame < ALIGN(e820table[i].base_address + e820table[i].size, FRAME_SIZE))
     61                                        last_frame = ALIGN(e820table[i].base_address + e820table[i].size, FRAME_SIZE);
     62                        }                       
    5863                }
    5964        }
  • arch/ia32/src/mm/page.c

    reef75f6 r95498e5  
    2727 */
    2828
     29#include <arch/mm/page.h>
     30#include <arch/mm/frame.h>
     31#include <mm/frame.h>
     32#include <mm/page.h>
    2933#include <arch/types.h>
    3034#include <config.h>
    3135#include <func.h>
    32 #include <mm/frame.h>
    33 #include <mm/page.h>
    34 #include <arch/mm/page.h>
    3536#include <arch/interrupt.h>
    3637#include <arch/asm.h>
     
    4546{
    4647        __address dba;
    47         __u32 i;
     48        __address cur;
    4849
    4950        if (config.cpu_active == 1) {
     
    5455               
    5556                /*
    56                  * PA2KA(identity) mapping for all frames.
     57                 * PA2KA(identity) mapping for all frames until last_frame.
    5758                 */
    58                 for (i = 0; i < config.memory_size/PAGE_SIZE; i++)
    59                         page_mapping_insert(PA2KA(i * PAGE_SIZE), i * PAGE_SIZE, PAGE_CACHEABLE, KA2PA(dba));
     59                for (cur = 0; cur < last_frame; cur += FRAME_SIZE)
     60                        page_mapping_insert(PA2KA(cur), cur, PAGE_CACHEABLE, KA2PA(dba));
    6061
    6162                trap_register(14, page_fault);
Note: See TracChangeset for help on using the changeset viewer.