Changeset fc1e4f6 in mainline for genarch/src


Ignore:
Timestamp:
2006-01-31T00:44:08Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef67bab
Parents:
6a3c9a7
Message:

Change page_mapping_find/insert interfaces to take as_t * as first argument
and not asid_t as second argument. This change was necessitated by the
removal of mapping array from as_area_t and the fact that an address
space doesn't have an ASID when it is created.

Location:
genarch/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/acpi/acpi.c

    r6a3c9a7 rfc1e4f6  
    3030#include <genarch/acpi/madt.h>
    3131#include <arch/bios/bios.h>
    32 #include <mm/asid.h>
     32#include <mm/as.h>
    3333#include <mm/page.h>
    3434#include <print.h>
     
    8080static void map_sdt(struct acpi_sdt_header *sdt)
    8181{
    82         page_mapping_insert((__address) sdt, ASID_KERNEL, (__address) sdt, PAGE_NOT_CACHEABLE, 0);
     82        page_mapping_insert(AS_KERNEL, (__address) sdt, (__address) sdt, PAGE_NOT_CACHEABLE, 0);
    8383        map_structure((__address) sdt, sdt->length);
    8484}
  • genarch/src/mm/page_ht.c

    r6a3c9a7 rfc1e4f6  
    3131#include <mm/frame.h>
    3232#include <mm/heap.h>
     33#include <mm/as.h>
    3334#include <arch/mm/asid.h>
    3435#include <arch/types.h>
     
    5354pte_t *page_ht = NULL;
    5455
    55 static void ht_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root);
    56 static pte_t *ht_mapping_find(__address page, asid_t asid, __address root);
     56static void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root);
     57static pte_t *ht_mapping_find(as_t *as, __address page, __address root);
    5758
    5859page_operations_t page_ht_operations = {
     
    6869 * chain.
    6970 *
     71 * @param as Address space to which page belongs. Must be locked prior the call.
    7072 * @param page Virtual address of the page to be mapped.
    71  * @param asid Address space to which page belongs.
    7273 * @param frame Physical address of memory frame to which the mapping is done.
    7374 * @param flags Flags to be used for mapping.
    7475 * @param root Ignored.
    7576 */
    76 void ht_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root)
     77void ht_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root)
    7778{
    7879        pte_t *t, *u;
     
    8182        ipl = interrupts_disable();
    8283        spinlock_lock(&page_ht_lock);
    83        
    84         t = HT_HASH(page, asid);
     84
     85        t = HT_HASH(page, as->asid);
    8586        if (!HT_SLOT_EMPTY(t)) {
    8687       
     
    9293                do {
    9394                        u = t;
    94                         if (HT_COMPARE(page, asid, t)) {
     95                        if (HT_COMPARE(page, as->asid, t)) {
    9596                                /*
    9697                                 * Nothing to do,
     
    110111        }
    111112       
    112         HT_SET_RECORD(t, page, asid, frame, flags);
     113        HT_SET_RECORD(t, page, as->asid, frame, flags);
    113114        HT_SET_NEXT(t, NULL);
    114115       
     
    123124 * Interrupts must be disabled.
    124125 *
     126 * @param as Address space to wich page belongs. Must be locked prior the call.
    125127 * @param page Virtual page.
    126  * @param asid Address space to wich page belongs.
    127128 * @param root Ignored.
    128129 *
    129130 * @return NULL if there is no such mapping; requested mapping otherwise.
    130131 */
    131 pte_t *ht_mapping_find(__address page, asid_t asid, __address root)
     132pte_t *ht_mapping_find(as_t *as, __address page, __address root)
    132133{
    133134        pte_t *t;
    134135       
    135136        spinlock_lock(&page_ht_lock);
    136         t = HT_HASH(page, asid);
     137        t = HT_HASH(page, as->asid);
    137138        if (!HT_SLOT_EMPTY(t)) {
    138                 while (!HT_COMPARE(page, asid, t) && HT_GET_NEXT(t))
     139                while (!HT_COMPARE(page, as->asid, t) && HT_GET_NEXT(t))
    139140                        t = HT_GET_NEXT(t);
    140                 t = HT_COMPARE(page, asid, t) ? t : NULL;
     141                t = HT_COMPARE(page, as->asid, t) ? t : NULL;
    141142        } else {
    142143                t = NULL;
  • genarch/src/mm/page_pt.c

    r6a3c9a7 rfc1e4f6  
    3131#include <mm/frame.h>
    3232#include <arch/mm/page.h>
    33 #include <arch/mm/asid.h>
     33#include <arch/mm/as.h>
    3434#include <arch/types.h>
    3535#include <typedefs.h>
     
    3737#include <memstr.h>
    3838
    39 static void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root);
    40 static pte_t *pt_mapping_find(__address page, asid_t asid, __address root);
     39static void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root);
     40static pte_t *pt_mapping_find(as_t *as, __address page, __address root);
    4141
    4242page_operations_t page_pt_operations = {
     
    5050 * using 'flags'.
    5151 *
     52 * @param as Ignored.
    5253 * @param page Virtual address of the page to be mapped.
    53  * @param asid Ignored.
    5454 * @param frame Physical address of memory frame to which the mapping is done.
    5555 * @param flags Flags to be used for mapping.
    5656 * @param root Explicit PTL0 address.
    5757 */
    58 void pt_mapping_insert(__address page, asid_t asid, __address frame, int flags, __address root)
     58void pt_mapping_insert(as_t *as, __address page, __address frame, int flags, __address root)
    5959{
    6060        pte_t *ptl0, *ptl1, *ptl2, *ptl3;
     
    9898 * Find mapping for virtual page.
    9999 *
     100 * @param as Ignored.
    100101 * @param page Virtual page.
    101  * @param asid Ignored.
    102102 * @param root PTL0 address if non-zero.
    103103 *
    104104 * @return NULL if there is no such mapping; entry from PTL3 describing the mapping otherwise.
    105105 */
    106 pte_t *pt_mapping_find(__address page, asid_t asid, __address root)
     106pte_t *pt_mapping_find(as_t *as, __address page, __address root)
    107107{
    108108        pte_t *ptl0, *ptl1, *ptl2, *ptl3;
Note: See TracChangeset for help on using the changeset viewer.