Changeset ef67bab in mainline for genarch/src/mm/page_pt.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
  • genarch/src/mm/page_pt.c

    rfc1e4f6 ref67bab  
    3030#include <mm/page.h>
    3131#include <mm/frame.h>
     32#include <mm/as.h>
    3233#include <arch/mm/page.h>
    3334#include <arch/mm/as.h>
     
    3738#include <memstr.h>
    3839
    39 static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root);
    40 static pte_t *pt_mapping_find(as_t *as, __address page, __address root);
     40static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags);
     41static pte_t *pt_mapping_find(as_t *as, __address page);
    4142
    4243page_operations_t page_pt_operations = {
     
    5051 * using 'flags'.
    5152 *
    52  * @param as Ignored.
     53 * The address space must be locked and interrupts must be disabled.
     54 *
     55 * @param as Address space to wich page belongs.
    5356 * @param page Virtual address of the page to be mapped.
    5457 * @param frame Physical address of memory frame to which the mapping is done.
    5558 * @param flags Flags to be used for mapping.
    56  * @param root Explicit PTL0 address.
    5759 */
    58 void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root)
     60void pt_mapping_insert(as_t *as, __address page, __address frame, int flags)
    5961{
    6062        pte_t *ptl0, *ptl1, *ptl2, *ptl3;
    6163        __address newpt;
    6264
    63         ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
     65        ptl0 = (pte_t *) PA2KA((__address) as->page_table);
    6466
    6567        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT) {
     
    98100 * Find mapping for virtual page.
    99101 *
    100  * @param as Ignored.
     102 * The address space must be locked and interrupts must be disabled.
     103 *
     104 * @param as Address space to which page belongs.
    101105 * @param page Virtual page.
    102  * @param root PTL0 address if non-zero.
    103106 *
    104107 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise.
    105108 */
    106 pte_t *pt_mapping_find(as_t *as, __address page, __address root)
     109pte_t *pt_mapping_find(as_t *as, __address page)
    107110{
    108111        pte_t *ptl0, *ptl1, *ptl2, *ptl3;
    109112
    110         ptl0 = (pte_t *) PA2KA(root ? root : (__address) GET_PTL0_ADDRESS());
     113        ptl0 = (pte_t *) PA2KA((__address) as->page_table);
    111114
    112115        if (GET_PTL1_FLAGS(ptl0, PTL0_INDEX(page)) & PAGE_NOT_PRESENT)
Note: See TracChangeset for help on using the changeset viewer.