qemu-e2k/target/e2k/helper_sm.c

36 lines
955 B
C

#include "qemu/osdep.h"
#include "qemu/log.h"
#include "cpu.h"
#include "exec/exec-all.h"
#include "qemu/host-utils.h"
#include "exec/helper-proto.h"
static int e2k_probe_access(CPUE2KState *env, target_ulong addr, int size,
MMUAccessType access_type, int mmu_idx)
{
int flags;
void *ignore;
flags = probe_access_flags(env, addr, access_type, mmu_idx,
true, &ignore, 0);
if ((addr & (size - 1)) && !(flags & TLB_INVALID_MASK)) {
flags = probe_access_flags(env, addr + size, access_type, mmu_idx,
true, &ignore, 0);
}
return !(flags & TLB_INVALID_MASK);
}
int HELPER(probe_read_access)(CPUE2KState *env, target_ulong addr,
int size, int mmu_idx)
{
return e2k_probe_access(env, addr, size, MMU_DATA_LOAD, mmu_idx);
}
int HELPER(probe_write_access)(CPUE2KState *env, target_ulong addr,
int size, int mmu_idx)
{
return e2k_probe_access(env, addr, size, MMU_DATA_STORE, mmu_idx);
}