2021-04-18 16:09:50 +03:00
|
|
|
/*
|
|
|
|
* MIPS internal definitions and helpers (TCG accelerator)
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MIPS_TCG_INTERNAL_H
|
|
|
|
#define MIPS_TCG_INTERNAL_H
|
|
|
|
|
2021-04-13 21:19:52 +03:00
|
|
|
#include "tcg/tcg.h"
|
2021-04-13 11:47:10 +03:00
|
|
|
#include "exec/memattrs.h"
|
2021-04-18 16:09:50 +03:00
|
|
|
#include "hw/core/cpu.h"
|
2021-04-19 01:43:02 +03:00
|
|
|
#include "cpu.h"
|
2021-04-18 16:09:50 +03:00
|
|
|
|
2021-04-13 11:47:10 +03:00
|
|
|
void mips_tcg_init(void);
|
|
|
|
|
2021-04-13 22:40:33 +03:00
|
|
|
void mips_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb);
|
2022-04-20 16:26:02 +03:00
|
|
|
G_NORETURN void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
|
|
|
|
MMUAccessType access_type, int mmu_idx,
|
|
|
|
uintptr_t retaddr);
|
2022-10-24 13:35:06 +03:00
|
|
|
void mips_restore_state_to_opc(CPUState *cs,
|
|
|
|
const TranslationBlock *tb,
|
|
|
|
const uint64_t *data);
|
2021-04-18 16:09:50 +03:00
|
|
|
|
2021-04-13 22:40:33 +03:00
|
|
|
const char *mips_exception_name(int32_t exception);
|
|
|
|
|
2022-04-20 16:26:02 +03:00
|
|
|
G_NORETURN void do_raise_exception_err(CPUMIPSState *env, uint32_t exception,
|
|
|
|
int error_code, uintptr_t pc);
|
2021-04-13 22:40:33 +03:00
|
|
|
|
2022-04-20 16:26:02 +03:00
|
|
|
static inline G_NORETURN
|
|
|
|
void do_raise_exception(CPUMIPSState *env,
|
|
|
|
uint32_t exception,
|
|
|
|
uintptr_t pc)
|
2021-04-13 22:40:33 +03:00
|
|
|
{
|
|
|
|
do_raise_exception_err(env, exception, 0, pc);
|
|
|
|
}
|
|
|
|
|
2021-04-19 01:43:02 +03:00
|
|
|
#if !defined(CONFIG_USER_ONLY)
|
|
|
|
|
2021-09-11 19:54:24 +03:00
|
|
|
void mips_cpu_do_interrupt(CPUState *cpu);
|
|
|
|
bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req);
|
|
|
|
|
2021-04-18 17:25:49 +03:00
|
|
|
void mmu_init(CPUMIPSState *env, const mips_def_t *def);
|
|
|
|
|
2021-04-19 01:43:02 +03:00
|
|
|
void update_pagemask(CPUMIPSState *env, target_ulong arg1, int32_t *pagemask);
|
|
|
|
|
2021-04-13 12:46:18 +03:00
|
|
|
void r4k_invalidate_tlb(CPUMIPSState *env, int idx, int use_extra);
|
2021-04-19 01:43:02 +03:00
|
|
|
uint32_t cpu_mips_get_random(CPUMIPSState *env);
|
|
|
|
|
2021-04-13 21:19:52 +03:00
|
|
|
bool mips_io_recompile_replay_branch(CPUState *cs, const TranslationBlock *tb);
|
|
|
|
|
2021-04-13 12:46:18 +03:00
|
|
|
hwaddr cpu_mips_translate_address(CPUMIPSState *env, target_ulong address,
|
|
|
|
MMUAccessType access_type, uintptr_t retaddr);
|
2021-04-13 11:47:10 +03:00
|
|
|
void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr,
|
|
|
|
vaddr addr, unsigned size,
|
|
|
|
MMUAccessType access_type,
|
|
|
|
int mmu_idx, MemTxAttrs attrs,
|
|
|
|
MemTxResult response, uintptr_t retaddr);
|
2021-04-13 12:46:18 +03:00
|
|
|
void cpu_mips_tlb_flush(CPUMIPSState *env);
|
|
|
|
|
2021-09-15 03:26:02 +03:00
|
|
|
bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
|
|
|
MMUAccessType access_type, int mmu_idx,
|
|
|
|
bool probe, uintptr_t retaddr);
|
|
|
|
|
2022-05-02 10:11:25 +03:00
|
|
|
void mips_semihosting(CPUMIPSState *env);
|
|
|
|
|
2021-04-19 01:43:02 +03:00
|
|
|
#endif /* !CONFIG_USER_ONLY */
|
|
|
|
|
2021-04-18 16:09:50 +03:00
|
|
|
#endif
|