2012-07-20 11:50:39 +04:00
|
|
|
/*
|
|
|
|
* OpenRISC MMU helper routines
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011-2012 Jia Liu <proljc@gmail.com>
|
|
|
|
* Zhizhou Zhang <etouzh@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2016-01-26 21:17:22 +03:00
|
|
|
#include "qemu/osdep.h"
|
2012-07-20 11:50:39 +04:00
|
|
|
#include "cpu.h"
|
2016-03-15 15:18:37 +03:00
|
|
|
#include "exec/exec-all.h"
|
2014-03-28 22:42:10 +04:00
|
|
|
#include "exec/cpu_ldst.h"
|
2012-07-20 11:50:39 +04:00
|
|
|
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
|
2018-01-18 22:38:40 +03:00
|
|
|
void tlb_fill(CPUState *cs, target_ulong addr, int size,
|
|
|
|
MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
|
2012-07-20 11:50:39 +04:00
|
|
|
{
|
2012-07-20 11:50:40 +04:00
|
|
|
int ret;
|
|
|
|
|
2018-01-18 22:38:40 +03:00
|
|
|
ret = openrisc_cpu_handle_mmu_fault(cs, addr, size, access_type, mmu_idx);
|
2012-07-20 11:50:40 +04:00
|
|
|
|
|
|
|
if (ret) {
|
|
|
|
/* Raise Exception. */
|
2017-11-14 13:25:35 +03:00
|
|
|
cpu_loop_exit_restore(cs, retaddr);
|
2012-07-20 11:50:40 +04:00
|
|
|
}
|
2012-07-20 11:50:39 +04:00
|
|
|
}
|
|
|
|
#endif
|