/* armmmu.c - Memory Management Unit emulation. ARMulator extensions for the ARM7100 family. Copyright (C) 1999 Ben Williamson This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _ARMMMU_H_ #define _ARMMMU_H_ #define WORD_SHT 2 #define WORD_SIZE (1<mmu.control) #define MMU_Enabled (state->mmu.control & CONTROL_MMU) #define MMU_Disabled (!(MMU_Enabled)) #define MMU_Aligned (state->mmu.control & CONTROL_ALIGN_FAULT) #define MMU_ICacheEnabled (MMU_CTL & CONTROL_INSTRUCTION_CACHE) #define MMU_ICacheDisabled (!(MMU_ICacheDisabled)) #define MMU_DCacheEnabled (MMU_CTL & CONTROL_DATA_CACHE) #define MMU_DCacheDisabled (!(MMU_DCacheEnabled)) #define MMU_CacheEnabled (MMU_CTL & CONTROL_CACHE) #define MMU_CacheDisabled (!(MMU_CacheEnabled)) #define MMU_WBEnabled (MMU_CTL & CONTROL_WRITE_BUFFER) #define MMU_WBDisabled (!(MMU_WBEnabled)) /*virt_addr exchange according to CP15.R13(process id virtul mapping)*/ #define PID_VA_MAP_MASK 0xfe000000 //#define mmu_pid_va_map(va) ({\ // ARMword ret; \ // if ((va) & PID_VA_MAP_MASK)\ // ret = (va); \ // else \ // ret = ((va) | (state->mmu.process_id & PID_VA_MAP_MASK));\ // ret;\ //}) #define mmu_pid_va_map(va) ((va) & PID_VA_MAP_MASK) ? (va) : ((va) | (state->mmu.process_id & PID_VA_MAP_MASK)) /* FS[3:0] in the fault status register: */ typedef enum fault_t { NO_FAULT = 0x0, ALIGNMENT_FAULT = 0x1, SECTION_TRANSLATION_FAULT = 0x5, PAGE_TRANSLATION_FAULT = 0x7, SECTION_DOMAIN_FAULT = 0x9, PAGE_DOMAIN_FAULT = 0xB, SECTION_PERMISSION_FAULT = 0xD, SUBPAGE_PERMISSION_FAULT = 0xF, /* defined by skyeye */ TLB_READ_MISS = 0x30, TLB_WRITE_MISS = 0x40, } fault_t; #endif /* _ARMMMU_H_ */