2012-07-20 09:50:39 +02: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 19:17:22 +01:00
|
|
|
#include "qemu/osdep.h"
|
2012-07-20 09:50:39 +02:00
|
|
|
#include "cpu.h"
|
2016-03-15 13:18:37 +01:00
|
|
|
#include "exec/exec-all.h"
|
2014-03-28 19:42:10 +01:00
|
|
|
#include "exec/cpu_ldst.h"
|
2012-07-20 09:50:39 +02:00
|
|
|
|
|
|
|
#ifndef CONFIG_USER_ONLY
|
|
|
|
|
2018-01-18 20:38:40 +01:00
|
|
|
void tlb_fill(CPUState *cs, target_ulong addr, int size,
|
|
|
|
MMUAccessType access_type, int mmu_idx, uintptr_t retaddr)
|
2012-07-20 09:50:39 +02:00
|
|
|
{
|
2012-07-20 09:50:40 +02:00
|
|
|
int ret;
|
|
|
|
|
2018-01-18 20:38:40 +01:00
|
|
|
ret = openrisc_cpu_handle_mmu_fault(cs, addr, size, access_type, mmu_idx);
|
2012-07-20 09:50:40 +02:00
|
|
|
|
|
|
|
if (ret) {
|
|
|
|
/* Raise Exception. */
|
2017-11-14 11:25:35 +01:00
|
|
|
cpu_loop_exit_restore(cs, retaddr);
|
2012-07-20 09:50:40 +02:00
|
|
|
}
|
2012-07-20 09:50:39 +02:00
|
|
|
}
|
|
|
|
#endif
|