Changeset ef67bab in mainline for arch/amd64/src/mm/page.c


Ignore:
Timestamp:
2006-02-01T00:02:16Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
071a8ae6
Parents:
fc1e4f6
Message:

Memory management work.
Remove the last (i.e. 'root') argument from page_mapping_insert() and page_mapping_find().
Page table address is now extracted from the first (i.e. 'as') argument.
Add a lot of infrastructure to make the above possible.
sparc64 is now broken, most likely because of insufficient identity mapping of physical memory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/mm/page.c

    rfc1e4f6 ref67bab  
    3939#include <interrupt.h>
    4040
    41 static __address bootstrap_dba;
    42 
    4341void page_arch_init(void)
    4442{
    45         __address dba;
    4643        __address cur;
    4744
     
    4946                page_operations = &page_pt_operations;
    5047       
    51                 dba = frame_alloc(FRAME_KA | FRAME_PANIC, ONE_FRAME, NULL);
    52                 memsetb(dba, PAGE_SIZE, 0);
    53 
    54                 bootstrap_dba = dba;
    55 
    5648                /*
    5749                 * PA2KA(identity) mapping for all frames.
    5850                 */
    5951                for (cur = 0; cur < last_frame; cur += FRAME_SIZE) {
    60                         page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE | PAGE_EXEC, KA2PA(dba));
     52                        page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, PAGE_CACHEABLE | PAGE_EXEC);
    6153                }
    6254
    6355                exc_register(14, "page_fault", page_fault);
    64                 write_cr3(KA2PA(dba));
     56                write_cr3((__address) AS_KERNEL->page_table);
    6557        }
    6658        else {
    67                 write_cr3(KA2PA(bootstrap_dba));
     59                write_cr3((__address) AS_KERNEL->page_table);
    6860        }
    6961}
Note: See TracChangeset for help on using the changeset viewer.