Changeset 10e0cee in mainline for arch/ppc32/src/mm/as.c


Ignore:
Timestamp:
2006-06-18T00:31:14Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1bb2e7a
Parents:
8e3bf3e2
Message:

ppc32: BAT-less memory mapping (broken yet)
VSID support (broken yet)
boot API change
cleanup

File:
1 edited

Legend:

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

    r8e3bf3e2 r10e0cee  
    3535#include <arch/mm/as.h>
    3636#include <genarch/mm/as_pt.h>
     37#include <genarch/mm/asid_fifo.h>
     38#include <arch.h>
    3739
    3840/** Architecture dependent address space init. */
     
    4042{
    4143        as_operations = &as_pt_operations;
     44        asid_fifo_init();
     45}
     46
     47/** Install address space.
     48 *
     49 * Install ASID.
     50 *
     51 * @param as Address space structure.
     52 *
     53 */
     54void as_install_arch(as_t *as)
     55{
     56        asid_t asid;
     57        ipl_t ipl;
     58        __u8 sr;
     59
     60        ipl = interrupts_disable();
     61        spinlock_lock(&as->lock);
     62       
     63        asid = as->asid;
     64       
     65        /* Lower 2 GB, user and supervisor access */
     66        for (sr = 0; sr < 8; sr++) {
     67                asm volatile (
     68                        "mtsrin %0, %1\n"
     69                        :
     70                        : "r" (0x6000 + (asid << 4) + sr), "r" (sr * 0x1000)
     71                );
     72        }
     73       
     74        /* Upper 2 GB, only supervisor access */
     75        for (sr = 8; sr < 16; sr++) {
     76                asm volatile (
     77                        "mtsrin %0, %1\n"
     78                        :
     79                        : "r" (0x4000 + (asid << 4) + sr), "r" (sr * 0x1000)
     80                );
     81        }
     82       
     83        spinlock_unlock(&as->lock);
     84        interrupts_restore(ipl);
    4285}
    4386
Note: See TracChangeset for help on using the changeset viewer.