Changeset 20d50a1 in mainline for arch/mips32/src/mm/as.c


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

Memory management work.

  • vm.* → as.* (as like address space is, imho, more fitting)
  • Don't do TLB shootdown on vm_install(). Some architectures only need to call tlb_invalidate_asid().
  • Don't allocate all frames for as_area in as_area_create(), but let them be allocated on-demand by as_page_fault().
  • Add high-level page fault handler as_page_fault().
  • Add as_area_load_mapping().
File:
1 moved

Legend:

Unmodified
Added
Removed
  • arch/mips32/src/mm/as.c

    r0369911 r20d50a1  
    2727 */
    2828
    29 #include <arch/mm/vm.h>
     29#include <arch/mm/as.h>
    3030#include <arch/mm/tlb.h>
    31 #include <mm/vm.h>
     31#include <mm/tlb.h>
     32#include <mm/as.h>
    3233#include <arch/cp0.h>
    3334#include <arch.h>
    3435
    35 /** Install ASID of the current VM
     36/** Install address space.
    3637 *
    37  * Install ASID of the current VM.
     38 * Install ASID and if necessary, purge TLB.
    3839 *
    39  * @param vm VM structure.
     40 * @param as Address space structure.
    4041 */
    41 void vm_install_arch(vm_t *vm)
     42void as_install_arch(as_t *as)
    4243{
    4344        entry_hi_t hi;
    4445        ipl_t ipl;
    45        
     46
     47        /*
     48         * If necessary, purge TLB.
     49         */
     50        tlb_invalidate_asid(as->asid);  /* TODO: do it only if necessary */
     51
     52        /*
     53         * Install ASID.
     54         */     
    4655        hi.value = cp0_entry_hi_read();
    4756
    4857        ipl = interrupts_disable();
    49         spinlock_lock(&vm->lock);
    50         hi.asid = vm->asid;
     58        spinlock_lock(&as->lock);
     59        hi.asid = as->asid;
    5160        cp0_entry_hi_write(hi.value);   
    52         spinlock_unlock(&vm->lock);
     61        spinlock_unlock(&as->lock);
    5362        interrupts_restore(ipl);
    5463}
Note: See TracChangeset for help on using the changeset viewer.