예제 #1
0
/*
 *  ======== Mmu_disable ========
 *  Function to disable the MMU.
 */
Void Mmu_disable()
{
    UInt16 type;
    UInt   key;

    /* if MMU is alreay disabled, just return */
    if (!(Mmu_isEnabled())) {
        return;
    }

    key = Hwi_disable();

    /* get the current enabled bits */
    type = Cache_getEnabled();

    /* disable all enabled caches */
    Cache_disable(type);

    /* disables the MMU */
    Mmu_disableAsm();

    /* set cache back to initial settings */
    Cache_enable(type);

    Hwi_restore(key);
}
예제 #2
0
파일: Mmu.c 프로젝트: CheredHerry/ti-bios
/*
 *  ======== Mmu_disable ========
 *  Function to disable the MMU.
 */
Void Mmu_disable()
{
    UInt16 type;
    UInt   key;

    /* if MMU is alreay disabled, just return */
    if (!(Mmu_isEnabled())) {
        return;
    }
    
    key = Hwi_disable();

    /* get the current enabled bits */
    type = Cache_getEnabled();
    
    if (type & Cache_Type_L1D) {
        /* writeback invalidate all data cache */ 
        Cache_wbInvAll();
        
        /* drain the write buffer */
        Cache_wait();
        
        /* disable the L1 data cache */
        Cache_disable(Cache_Type_L1D);
    }
    
    if (type & Cache_Type_L1P) {
        /* invalidate all L1 program cache */
        Cache_invL1pAll();

        /* disable L1P cache */
        Cache_disable(Cache_Type_L1P);
    }
    
    /* disables the MMU */
    Mmu_disableAsm();
    
    /* set cache back to initial settings */
    Cache_enable(type);

    Hwi_restore(key);
}